Skip to content

Commit 99950cf

Browse files
committed
Have "stack ghci" only use "-package base" if there are no local targets
1 parent c7e7919 commit 99950cf

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

ChangeLog.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,12 @@ Bug fixes:
6666
associated with the relevant custom snapshot. See
6767
[#3714](https://github.com/commercialhaskell/stack/issues/3714).
6868
* `stack ghci` now allows loading multiple packages with the same
69-
module name, as long as they are the same filepath. See
69+
module name, as long as they have the same filepath. See
7070
[#3776](https://github.com/commercialhaskell/stack/pull/3776).
71+
* `stack ghci` no longer always adds a dependency on `base`. It is
72+
now only added when there are no local targets. This allows it to
73+
be to load code that uses replacements for `base`. See
74+
[#3589](https://github.com/commercialhaskell/stack/issues/3589#issuecomment)
7175

7276
## v1.6.3
7377

src/Stack/Ghci.hs

+3-2
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,13 @@ runGhci GhciOpts{..} targets mainIsTargets pkgs extraFiles exposePackages = do
331331
fromMaybe (not (null pkgs && null exposePackages)) ghciHidePackages
332332
hidePkgOpts =
333333
if shouldHidePackages
334-
then "-hide-all-packages" :
334+
then
335+
["-hide-all-packages"] ++
335336
-- This is necessary, because current versions of ghci
336337
-- will entirely fail to start if base isn't visible. This
337338
-- is because it tries to use the interpreter to set
338339
-- buffering options on standard IO.
339-
"-package" : "base" :
340+
(if null targets then ["-package", "base"] else []) ++
340341
concatMap (\n -> ["-package", packageNameString n]) exposePackages
341342
else []
342343
oneWordOpts bio

0 commit comments

Comments
 (0)