Skip to content

Commit

Permalink
Have ghci include CWD if configured with no packages #2878
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsloan committed Jan 31, 2017
1 parent 224580f commit 7cc6551
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 4 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Other enhancements:
* Internal cleanup: configuration types are now based much more on lenses
* `stack build` and related commands now allow the user to disable debug symbol stripping
with new `--no-strip`, `--no-library-stripping`, and `--no-executable-shipping` flags,
closing [#877](https://github.com/commercialhaskell/stack/issues/877).
closing [#877](https://github.com/commercialhaskell/stack/issues/877).
Also turned error message for missing targets more readable ([#2384](https://github.com/commercialhaskell/stack/issues/2384))
* `stack haddock` now shows index.html paths when documentation is already up to
date. Resolved [#781](https://github.com/commercialhaskell/stack/issues/781)
Expand All @@ -52,6 +52,9 @@ Other enhancements:
shows warning suggesting to run `apt-get update` or similar, depending on the
OS.
([#2898](https://github.com/commercialhaskell/stack/issues/2898))
* When `stack ghci` is run with a config with no packages (e.g. global project),
it will now look for source files in the current work dir.
([#2878](https://github.com/commercialhaskell/stack/issues/2878))

Bug fixes:

Expand Down
9 changes: 5 additions & 4 deletions src/Stack/Ghci.hs
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,11 @@ runGhci GhciOpts{..} targets mainIsTargets pkgs = do
menv <- liftIO $ configEnvOverride config defaultEnvSettings
execSpawn menv
(fromMaybe (compilerExeName wc) ghciGhcCommand)
("--interactive" :
-- This initial "-i" resets the include directories to not
-- include CWD.
"-i" :
(("--interactive" : ) $
-- This initial "-i" resets the include directories to
-- not include CWD. If there aren't any packages, CWD
-- is included.
(if null pkgs then id else ("-i" : )) $
odir <> pkgopts <> ghciArgs <> extras)
interrogateExeForRenderFunction = do
menv <- liftIO $ configEnvOverride config defaultEnvSettings
Expand Down

0 comments on commit 7cc6551

Please sign in to comment.