Skip to content

Commit

Permalink
Have "stack ghci" only use "-package base" if there are no local targets
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsloan committed Jan 20, 2018
1 parent c7e7919 commit 99950cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ Bug fixes:
associated with the relevant custom snapshot. See
[#3714](https://github.com/commercialhaskell/stack/issues/3714).
* `stack ghci` now allows loading multiple packages with the same
module name, as long as they are the same filepath. See
module name, as long as they have the same filepath. See
[#3776](https://github.com/commercialhaskell/stack/pull/3776).
* `stack ghci` no longer always adds a dependency on `base`. It is
now only added when there are no local targets. This allows it to
be to load code that uses replacements for `base`. See
[#3589](https://github.com/commercialhaskell/stack/issues/3589#issuecomment)

## v1.6.3

Expand Down
5 changes: 3 additions & 2 deletions src/Stack/Ghci.hs
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,13 @@ runGhci GhciOpts{..} targets mainIsTargets pkgs extraFiles exposePackages = do
fromMaybe (not (null pkgs && null exposePackages)) ghciHidePackages
hidePkgOpts =
if shouldHidePackages
then "-hide-all-packages" :
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" :
(if null targets then ["-package", "base"] else []) ++
concatMap (\n -> ["-package", packageNameString n]) exposePackages
else []
oneWordOpts bio
Expand Down

0 comments on commit 99950cf

Please sign in to comment.