Skip to content

Commit

Permalink
Merge pull request #5306 from commercialhaskell/5213-fix-repl-for-tes…
Browse files Browse the repository at this point in the history
…t-components

Fix repl for test components
  • Loading branch information
snoyberg authored Jun 21, 2020
2 parents c2a4e06 + 88aaf59 commit a374f5f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Other enhancements:
Bug fixes:

* When using the `STACK_YAML` env var with Docker, make the path absolute.
* Fix the problem of `stack repl foo:test:bar` failing without a project
build before that. See
[#5213](https://github.com/commercialhaskell/stack/issues/5213)

* Fix `stack sdist` introducing unneded sublibrary syntax when using
pvp-bounds. See
Expand Down
7 changes: 6 additions & 1 deletion src/Stack/Ghci.hs
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,13 @@ ghci opts@GhciOpts{..} = do
-- need is the location of main modules, not the rest.
pkgs0 <- getGhciPkgInfos installMap addPkgs (fmap fst mfileTargets) pkgDescs
figureOutMainFile bopts mainIsTargets localTargets pkgs0
let pkgTargets pn targets =
case targets of
TargetAll _ -> [T.pack (packageNameString pn)]
TargetComps comps -> [renderPkgComponent (pn, c) | c <- toList comps]
-- Build required dependencies and setup local packages.
buildDepsAndInitialSteps opts (map (T.pack . packageNameString . fst) localTargets)
buildDepsAndInitialSteps opts $
concatMap (\(pn, (_, t)) -> pkgTargets pn t) localTargets
targetWarnings localTargets nonLocalTargets mfileTargets
-- Load the list of modules _after_ building, to catch changes in
-- unlisted dependencies (#1180)
Expand Down

0 comments on commit a374f5f

Please sign in to comment.