Skip to content

Commit 570f11b

Browse files
authored
Merge pull request #5556 from commercialhaskell/sanity-check-env-vars
Sanity check does not include GHC_PACKAGE_PATH
2 parents 468b4b2 + 3456808 commit 570f11b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Bug fixes:
2222
[#5545](https://github.com/commercialhaskell/stack/issues/5545)
2323
* Bump `pantry` version for better OS support. See
2424
[pantry#33](https://github.com/commercialhaskell/pantry/issues/33)
25+
* When building the sanity check for a new GHC install, make sure to clear
26+
`GHC_PACKAGE_PATH`.
2527

2628

2729
## v2.7.1

src/Stack/Setup.hs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,9 +673,16 @@ ensureSandboxedCompiler sopts getSetupInfo' = do
673673
case res of
674674
Left _ -> loop xs
675675
Right y -> parseAbsFile y
676-
compiler <- withProcessContext menv $ loop names
676+
compiler <- withProcessContext menv $ do
677+
compiler <- loop names
678+
679+
-- Run this here to ensure that the sanity check uses the modified
680+
-- environment, otherwise we may infect GHC_PACKAGE_PATH and break sanity
681+
-- checks.
682+
when (soptsSanityCheck sopts) $ sanityCheck compiler
683+
684+
pure compiler
677685

678-
when (soptsSanityCheck sopts) $ sanityCheck compiler
679686
cp <- pathsFromCompiler wc compilerBuild True compiler
680687
pure (cp, paths)
681688

0 commit comments

Comments
 (0)