haskell / haskell/cabal

Improve re-configure recompilation checking

Open
#11,761 0 comments 6 reactions 0 assignees View on GitHub
attention: pr-welcome Cabal: cmd/configure type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

There are quite a few problems with the current way we determine which re-configure steps need to be performed.

1. **All-or-nothing reconfiguration**. If we determine re-configuration is needed, we re-run every single configure step, which includes needlessly probing programs on PATH (`configureAllKnownPrograms`), running `ghc-pkg` to build an `InstalledPackageIndex` (`getInstalledPackages`), running `pkg-config` (`configurePkgconfigPackages`), etc. Moreover, it's always **package-wide**: if we only need to re-run configure because of a single component changing, we re-run the configure step for the entire package, which will also re-run code for other components.
2. **Insufficient tracking of external state**. If we depend on particular `PkgConfig` data, we don't monitor that, so if the data changes we fail to re-configure even though we should (see `updatePackageConfigFileMonitor`).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.