Fix project-local build flags being ignored.
I noticed that running ‘cabal install’ with two separate sets of dynamic / static build flags (e.g. one with none, and one with ‘--enable-shared --enable-executable-dynamic --disable-library-vanilla’) produced packages with the same hash, instead of different hashes. After debugging this issue I found that this command (with no explicit cabal project file) was resulting in these build configuration flags being ignored, because in ProjectPlanning.hs, the sdist was not considered a local package, so the (non-shared) local-package-only configuration was being dropped. This fix ensures that these command-line arguments properly make it through to where they belong in cases like this. Additionally, adjust the ‘style’ attribute in plan.json so that globally installed packages are designated as global even if they are local to the project. (Without this adjustment to ‘style2str’, the T5782Diamond test fails, because it looks up ‘dist-dirs’ in plan.json, where ‘dist-dirs’ is absent from the JSON.) Finally, take into account elabDynExe and configDynExe to provide GHC with ‘-dynamic’ appropriately rather than going about it with static linking.
Showing
- cabal-install/src/Distribution/Client/Configure.hs 6 additions, 0 deletionscabal-install/src/Distribution/Client/Configure.hs
- cabal-install/src/Distribution/Client/Install.hs 1 addition, 0 deletionscabal-install/src/Distribution/Client/Install.hs
- cabal-install/src/Distribution/Client/ProjectPlanOutput.hs 1 addition, 1 deletioncabal-install/src/Distribution/Client/ProjectPlanOutput.hs
- cabal-install/src/Distribution/Client/ProjectPlanning.hs 36 additions, 3 deletionscabal-install/src/Distribution/Client/ProjectPlanning.hs
- cabal-install/src/Distribution/Client/SetupWrapper.hs 12 additions, 3 deletionscabal-install/src/Distribution/Client/SetupWrapper.hs
- cabal-install/tests/IntegrationTests2.hs 1 addition, 1 deletioncabal-install/tests/IntegrationTests2.hs
- changelog.d/pr-8623 7 additions, 0 deletionschangelog.d/pr-8623
Loading