Skip to content

Commit

Permalink
Fix ghci -package-id for lib dep from test #1222
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsloan committed Oct 28, 2015
1 parent 5883193 commit d2a195a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Stack/Ghci.hs
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,19 @@ ghciSetup mainIs stringTargets = do
return (Just (name, (cabalfp, simpleTargets)))
Nothing -> return Nothing
else return Nothing
let localLibs = [name | (name, (_, target)) <- locals, targetIncludesLib target]
infos <-
forM locals $
\(name,(cabalfp,component)) ->
makeGhciPkgInfo sourceMap installedMap (map fst locals) name cabalfp component
makeGhciPkgInfo sourceMap installedMap localLibs name cabalfp component
unless (M.null realTargets) (build (const (return ())) Nothing bopts)
return (realTargets, mainIsTargets, infos)
where
-- NOTE: this doesn't mean that the cabal package actually has a
-- library, just that if it does, the requested target includes it.
targetIncludesLib STLocalAll = True
targetIncludesLib (STLocalComps comps) = S.member CLib comps
targetIncludesLib _ = False
makeBuildOpts targets =
base
{ boptsTargets = stringTargets
Expand Down

0 comments on commit d2a195a

Please sign in to comment.