Skip to content
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

Merged
merged 3 commits into from
Oct 31, 2015

Conversation

borsboom
Copy link
Contributor

(closes #1065, fixes #1180)

Optimistically, launch GHCi anyway even if the build fails.

@chrisdone, can you review?

@@ -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
Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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.

@borsboom borsboom force-pushed the 1065-1180-build-all-before-ghci branch from 33121bf to 660a765 Compare October 29, 2015 14:21
@borsboom
Copy link
Contributor Author

I've rebased this to resolve merge conflicts. @chrisdone / @mgsloan: still not sure what the right behaviour for stack ide and stack targets should be.

@mgsloan
Copy link
Contributor

mgsloan commented Oct 29, 2015

LGTM! should the --dependencies-only alias be part of the BuildSubset parser?

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the check for (null realTargets) should be removed. See point 1 on #1249 for why. See also #817 for why the check was there in the first place.

@borsboom borsboom force-pushed the 1065-1180-build-all-before-ghci branch from 660a765 to c54dff5 Compare October 31, 2015 13:05
Don't build anything for 'stack ide targets', and only build
dependencies before 'stack ide start'
@borsboom
Copy link
Contributor Author

@mgsloan I've updates based on your comments, please give this a final review and merge if good.

@mgsloan
Copy link
Contributor

mgsloan commented Oct 31, 2015

LGTM!

mgsloan added a commit that referenced this pull request Oct 31, 2015
…efore-ghci

'stack ghci': build project before launching GHCi
@mgsloan mgsloan merged commit fecc934 into master Oct 31, 2015
@dysinger dysinger deleted the 1065-1180-build-all-before-ghci branch April 7, 2016 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'stack ghci' doesn't notice that a module got deleted Stack ghci before stack build fails
3 participants