Skip to content

Commit

Permalink
Use target components when starting a REPL
Browse files Browse the repository at this point in the history
This partially fixes #5213 - starting a repl for an exe component
doesn't appear to work for some reason
  • Loading branch information
qrilka committed May 28, 2020
1 parent c467d1b commit a699e4f
Showing 1 changed file with 6 additions and 1 deletion.
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 a699e4f

Please sign in to comment.