Skip to content

Commit 31a54bb

Browse files
authored
Merge pull request #6137 from commercialhaskell/fix5412
Fix #5412 sanityCheck passes GHC flag -hide-all-packages
2 parents a7cc488 + 5f7ab60 commit 31a54bb

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ Bug fixes:
2222

2323
* Restore building of Stack with Cabal flag `disable-git-info` (broken with
2424
Stack 2.11.1).
25+
* Stack's sanity check on a selected GHC now passes GHC flag
26+
`-hide-all-packages`, stopping GHC from looking for a package environment in
27+
default locations.
2528

2629
## v2.11.1 - 2023-05-18
2730

src/Stack/Setup.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,6 +2348,12 @@ sanityCheck ghc = withSystemTempDir "stack-sanity-check" $ \dir -> do
23482348
eres <- withWorkingDir (toFilePath dir) $ proc (toFilePath ghc)
23492349
[ fp
23502350
, "-no-user-package-db"
2351+
-- Required to stop GHC looking for a package environment in default
2352+
-- locations.
2353+
, "-hide-all-packages"
2354+
-- Required because GHC flag -hide-all-packages is passed.
2355+
, "-package base"
2356+
, "-package Cabal" -- required for "import Distribution.Simple"
23512357
] $ try . readProcess_
23522358
case eres of
23532359
Left e -> prettyThrowIO $ GHCSanityCheckCompileFailed e ghc

0 commit comments

Comments
 (0)