Revert "cabal-install configureCompiler: configure progdb"
This reverts commit 8bdda9c0. In configureCompiler the call to configureAllKnownPrograms was too eager. When called it selected the version of tools from PATH (such as alex), and then when a package was configured these tools were passed using `--with-alex` options to configure, which meant that the build-tool-depends versions were not used. (See #10692) Why was this call introduced in the first place? Because configureCompiler would a different result depending on whether: * It is run for the first time, the `ProgramDb` will contain unconfigured programs. * It is run subsequently, `ProgramDb` is read from disk, it does not contain unconfigured programs. Reverting this commit rexposes the bug that the serialised ProgramDb will not contain UnconfiguredPrograms (in the case where reconfiguring is avoided). However, there are no code paths which require this logic in `cabal-install` currently. The configuration phase happens again each time that `Cabal` is called, with a populated `ProgramDb`. We will fix this before the next major `cabal-install` release, but it would not be suitable to backport. In the future we will fix this properly by refactoring `configureCompiler` so that `ProgramDb` is not serialised. The general approach will be to make `configCompilerEx` return a pair of configured programs (`ghc` and `ghc-pkg`) and expose an additional function from `Cabal` which uses these two programs to perform the modifications to the `ProgramDb` which `configCompilerEx` performs. Also see #2238 and #9840 Fixes #10692
Showing
- cabal-install/src/Distribution/Client/ProjectPlanning.hs 45 additions, 6 deletionscabal-install/src/Distribution/Client/ProjectPlanning.hs
- cabal-testsuite/PackageTests/ExtraProgPath/setup.out 4 additions, 2 deletionscabal-testsuite/PackageTests/ExtraProgPath/setup.out
- changelog.d/pr-10731 4 additions, 0 deletionschangelog.d/pr-10731
Loading