Skip to content

Commit 196bdba

Browse files
committed
Fix package-hiding option parsing + always expose base to ghci
1 parent c56d74e commit 196bdba

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Stack/Ghci.hs

+7-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,13 @@ runGhci GhciOpts{..} targets mainIsTargets pkgs extraFiles exposePackages = do
323323
fromMaybe (not (null pkgs && null exposePackages)) ghciHidePackages
324324
hidePkgOpts =
325325
if shouldHidePackages
326-
then "-hide-all-packages" : concatMap (\n -> ["-package", packageNameString n]) exposePackages
326+
then "-hide-all-packages" :
327+
-- This is necessary, because current versions of ghci
328+
-- will entirely fail to start if base isn't visible. This
329+
-- is because it tries to use the interpreter to set
330+
-- buffering options on standard IO.
331+
"-package" : "base" :
332+
concatMap (\n -> ["-package", packageNameString n]) exposePackages
327333
else []
328334
oneWordOpts bio
329335
| shouldHidePackages = bioOneWordOpts bio ++ bioPackageFlags bio

src/Stack/Options/GhciParser.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ ghciOptsParser = GhciOpts
5252
<*> switch (long "load-local-deps" <> help "Load all local dependencies of your targets")
5353
-- TODO: deprecate this? probably useless.
5454
<*> switch (long "skip-intermediate-deps" <> help "Skip loading intermediate target dependencies" <> internal)
55-
<*> optional (boolFlags True "package-hiding" "package hiding" idm)
55+
<*> optional (boolFlagsNoDefault "package-hiding" "package hiding" idm)
5656
<*> switch (long "no-build" <> help "Don't build before launching GHCi" <> internal)
5757
<*> switch (long "only-main" <> help "Only load and import the main module. If no main module, no modules will be loaded.")

0 commit comments

Comments
 (0)