-
Notifications
You must be signed in to change notification settings - Fork 707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, let's give users some time to be potentially burned by this change before it's released.
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 |
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
ghc
made byCabal
should neverimplicitly use an environment file. This is similar to how
GHC_PACKAGE_PATH
is treated.Fixes #10759
Template Α: This PR modifies behaviour or interface
Include the following checklist in your PR:
significance: significant
in the changelog file.