Modify the GHC_ENVIRONMENT env var in Stack.Setup #4715
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CC @phadej @tfausak
This fixes #4706. Since GHC 8.0, GHC will now implicitly read in from a
.ghc.environment.* file, which can cause commands like
stack exec ghcito fail. Due to the use case of
stack exec, it doesn't make sense totry to create our own environment file, but instead tell GHC to ignore
it. Unfortunately, the ability to ignore environment files was only
added in GHC 8.4.4. This patch:
GHC_ENVIRONMENTvariable already set outside of Stack-This will help work around situations where
cabal new-buildcreates anenvironment file without the user's awareness. This may be somewhat
superfluous in the future depending on changes to either GHC or
cabal-install, but shouldn't present any harm for the foreseeable future
(unless GHC changes its understanding of
GHC_ENVIRONMENT).Note: Documentation fixes for https://docs.haskellstack.org/en/stable/ should target the "stable" branch, not master.
Please include the following checklist in your PR:
Please also shortly describe how you tested your change. Bonus points for added tests!