There are quite a few problems with the current way we determine which re-configure steps need to be performed.
- 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.
- 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).
There are quite a few problems with the current way we determine which re-configure steps need to be performed.
configureAllKnownPrograms), runningghc-pkgto build anInstalledPackageIndex(getInstalledPackages), runningpkg-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.PkgConfigdata, we don't monitor that, so if the data changes we fail to re-configure even though we should (seeupdatePackageConfigFileMonitor).