Skip to content

Commit 5f7ab60

Browse files
committed
Fix #5412 sanityCheck passes GHC flag -hide-all-packages
1 parent 26e1c5e commit 5f7ab60

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
@@ -2336,6 +2336,12 @@ sanityCheck ghc = withSystemTempDir "stack-sanity-check" $ \dir -> do
23362336
eres <- withWorkingDir (toFilePath dir) $ proc (toFilePath ghc)
23372337
[ fp
23382338
, "-no-user-package-db"
2339+
-- Required to stop GHC looking for a package environment in default
2340+
-- locations.
2341+
, "-hide-all-packages"
2342+
-- Required because GHC flag -hide-all-packages is passed.
2343+
, "-package base"
2344+
, "-package Cabal" -- required for "import Distribution.Simple"
23392345
] $ try . readProcess_
23402346
case eres of
23412347
Left e -> prettyThrowIO $ GHCSanityCheckCompileFailed e ghc

0 commit comments

Comments
 (0)