-
Notifications
You must be signed in to change notification settings - Fork 842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'stack ghci': build project before launching GHCi #1228
Conversation
@@ -43,7 +43,7 @@ ide | |||
-> [String] -- ^ GHC options. | |||
-> m () | |||
ide targets useropts = do | |||
(_realTargets,_,pkgs) <- ghciSetup Nothing targets | |||
(_realTargets,_,pkgs) <- ghciSetup (Just BSAll) Nothing targets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chrisdone @mgsloan: Is building the project (and continuing even if it fails) the correct behaviour for stack ide
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think the right behavior for stack ide is to only build dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mgsloan: Should it stay with the old behaviour of not starting if the dependencies fail to build, or would the new behaviour of continuing anyway be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new behavior of continuing is better, I think. At least that way the user ends up with a GHCI session that's somewhat setup.
33121bf
to
660a765
Compare
I've rebased this to resolve merge conflicts. @chrisdone / @mgsloan: still not sure what the right behaviour for |
LGTM! should the |
@@ -215,12 +218,22 @@ ghciSetup mainIs stringTargets = do | |||
return (Just (name, (cabalfp, simpleTargets))) | |||
Nothing -> return Nothing | |||
else return Nothing | |||
-- Try to build, but optimistically launch GHCi anyway if it fails (#1065) | |||
case (mbuildFirst, M.null realTargets) of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
660a765
to
c54dff5
Compare
Don't build anything for 'stack ide targets', and only build dependencies before 'stack ide start'
@mgsloan I've updates based on your comments, please give this a final review and merge if good. |
LGTM! |
…efore-ghci 'stack ghci': build project before launching GHCi
(closes #1065, fixes #1180)
Optimistically, launch GHCi anyway even if the build fails.
@chrisdone, can you review?