Skip to content

Commit

Permalink
Fix package-hiding option parsing + always expose base to ghci
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsloan committed Nov 22, 2017
1 parent c56d74e commit 196bdba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/Stack/Ghci.hs
Expand Up @@ -323,7 +323,13 @@ runGhci GhciOpts{..} targets mainIsTargets pkgs extraFiles exposePackages = do
fromMaybe (not (null pkgs && null exposePackages)) ghciHidePackages
hidePkgOpts =
if shouldHidePackages
then "-hide-all-packages" : concatMap (\n -> ["-package", packageNameString n]) exposePackages
then "-hide-all-packages" :
-- This is necessary, because current versions of ghci
-- will entirely fail to start if base isn't visible. This
-- is because it tries to use the interpreter to set
-- buffering options on standard IO.
"-package" : "base" :
concatMap (\n -> ["-package", packageNameString n]) exposePackages
else []
oneWordOpts bio
| shouldHidePackages = bioOneWordOpts bio ++ bioPackageFlags bio
Expand Down
2 changes: 1 addition & 1 deletion src/Stack/Options/GhciParser.hs
Expand Up @@ -52,6 +52,6 @@ ghciOptsParser = GhciOpts
<*> switch (long "load-local-deps" <> help "Load all local dependencies of your targets")
-- TODO: deprecate this? probably useless.
<*> switch (long "skip-intermediate-deps" <> help "Skip loading intermediate target dependencies" <> internal)
<*> optional (boolFlags True "package-hiding" "package hiding" idm)
<*> optional (boolFlagsNoDefault "package-hiding" "package hiding" idm)
<*> switch (long "no-build" <> help "Don't build before launching GHCi" <> internal)
<*> switch (long "only-main" <> help "Only load and import the main module. If no main module, no modules will be loaded.")

0 comments on commit 196bdba

Please sign in to comment.