Repository navigation
Cabal: Always pass -package-env=- to supported GHC versions - #10828
Conversation
9932689 to
b2be1f8
Compare
0b9a368 to
27110d7
Compare
|
Can this break users' workflows? IIRC |
|
On one hand, it fixes a regression, on the other: it does seem to have a potential for breaking things. I'm torn on this one.. |
|
@Mikolaj Do you have a test case you are imagining? The change is about isolating times |
|
@mpickering: my memory of this functionality is too fuzzy, unfortunately, and moreover, it probably got simplified and so your changes are harmless. The idea was that somebody calls |
|
A user calling |
|
Well, that's good, but it seems at least a year ago users did expect (though some did not and were confused) ghc called by cabal-install to use the env files created by |
|
@Mikolaj I skimmed through the thread and there are multiple comments by different people about bugs running For example, these three issues are fixed by this patch I imagine.
You can see from the test that I added, that if |
Issue #10759 highlighted the issue that we were not isolating the calls to ghc from the existence of environment files. This manifested in a terminal bug where extra arguments form the environment file were causing a link failure which was due to a combination of #10692. However, even before this bug the test executable was relinked to due to the extra flags from the environment file. ``` Building test suite 'aeson-schemas-test' for aeson-schemas-1.4.2.1... Loaded package environment from /home/runner/work/aeson-schemas/aeson-schemas/dist-newstyle/tmp/environment.-69233/.ghc.environment.x86_64-linux-9.6.6 Loaded package environment from /home/runner/work/aeson-schemas/aeson-schemas/dist-newstyle/tmp/environment.-69233/.ghc.environment.x86_64-linux-9.6.6 [23 of 23] Linking /home/runner/work/aeson-schemas/aeson-schemas/dist-newstyle/build/x86_64-linux/ghc-9.6.6/aeson-schemas-1.4.2.1/t/aeson-schemas-test/build/aeson-schemas-test/aeson-schemas-test [Flags changed] ``` The correct solution is that calls to `ghc` made by `Cabal` should never implicitly use an environment file. This is similar to how `GHC_PACKAGE_PATH` is treated. Fixes #10759
The test tries to run `cabal` in an environment where `GHC_ENVIRONMENT` is set, and checks that the compilation of a simple package isn't affected by the variable being set.
|
This pull request has been removed from the queue for the following reason: The pull request #10828 has been manually updated If you want to requeue this pull request, you can post a |
* Add release notes for 3.14.2.0 release (cherry picked from commit 7bd6198) # Conflicts: # Cabal-hooks/CHANGELOG.md # cabal-install/changelog # changelog.d/pr-10493 # changelog.d/pr-10546 # changelog.d/pr-10828.md * Remove redundant Other Changes header Fixes #10685 (cherry picked from commit b2606fe) * Apply suggestions from code review Co-authored-by: Artem Pelenitsyn <[email protected]> (cherry picked from commit 822997d) * fix conflicts * typos * remove little changelog files that somehow Mergify failed to remove during cherry-pick * add the missing new entry in cabal-install/ChangeLog.md --------- Co-authored-by: Matthew Pickering <[email protected]> Co-authored-by: Mikolaj Konarski <[email protected]> Co-authored-by: Artem Pelenitsyn <[email protected]>
Issue #10759 highlighted the issue that we were not isolating the calls
to ghc from the existence of environment files.
This manifested in a terminal bug where extra arguments form the
environment file were causing a link failure which was due to a
combination of #10692.
However, even before this bug the test executable was relinked to due to
the extra flags from the environment file.
The correct solution is that calls to
ghcmade byCabalshould neverimplicitly use an environment file. This is similar to how
GHC_PACKAGE_PATHis treated.Fixes #10759
Template Α: This PR modifies behaviour or interface
Include the following checklist in your PR:
significance: significantin the changelog file.