-
Notifications
You must be signed in to change notification settings - Fork 843
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
Make dot and ls dependencies work without ghc installed #4405
Conversation
. updateOpts True (globalOptsL.configMonoidInstallGHCL) (Just False) | ||
|
||
-- helper function for update some option | ||
updateOpts :: Bool -> Lens' opts v -> v -> opts -> opts |
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.
I like this combinator 👍
src/Stack/Runners.hs
Outdated
updateGlobalOpts | ||
= updateOpts (dotTestTargets opts) (globalOptsBuildOptsMonoidL.buildOptsMonoidTestsL) (Just True) | ||
. updateOpts (dotBenchTargets opts) (globalOptsBuildOptsMonoidL.buildOptsMonoidBenchmarksL) (Just True) | ||
. updateOpts True (globalOptsL.configMonoidSkipGHCCheckL) (Just True) |
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.
It doesn't look like the updateOpts
is really useful here, how about just set (globalOptsL...) (Just True)
? I think it would be clearer that this is always being set.
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.
Right!
Co-Authored-By: waddlaw <waddlaw@users.noreply.github.com>
Thank you for the review. updated! |
Great job, @waddlaw! I'll review shortly. I thought I might have a little longer to find you the next issue to tackle 🤩 |
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.
Generally good — just a few minor changes required.
It would be good to add some tests, too, perhaps modifying the integration test that checks this for stack clean
from the fix to #4181 (although that test needs a little work, too).
@@ -206,6 +206,17 @@ instance Show SetupException where | |||
show UnsupportedSetupConfiguration = | |||
"I don't know how to install GHC on your system configuration, please install manually" | |||
|
|||
checkDownloadCompiler :: (HasConfig env, HasGHCVariant env) |
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.
As @qrilka noted, this could do with some documentation. We may want to change the WithDownloadCompiler
enum as a result.
@@ -97,6 +97,7 @@ Bug fixes: | |||
[#4314](https://github.com/commercialhaskell/stack/pull/4314) | |||
* Add `--cabal-files` flag to `stack ide targets` command. | |||
* Don't download ghc when using `stack clean`. | |||
* `dot` and `ls dependencies` commands no longer require GHC to be installed. Also, ensures the `--no-install-ghc` flag is respected. See: [#4390](https://github.com/commercialhaskell/stack/issues/4390) |
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.
This would be better as two lines; respecting --no-install-ghc
in bug fixes and the lack of GHC requirement merged with the stack clean
line above, and moved to Other enhancements
.
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.
I think that 2nd second sentence is misleading, the flag was respected at least in version 1.7.1 already:
qrilka@qdesktop ~/ws/h/stack-test-ghc-7.8.4 $ cat stack.yaml
resolver: ghc-7.8.4
qrilka@qdesktop ~/ws/h/stack-test-ghc-7.8.4 $ stack --no-install-ghc clean
No compiler found, expected minor version match with ghc-7.8.4 (x86_64-tinfo6) (based on resolver setting in /home/qrilka/ws/h/stack-test-ghc-7.8.4/stack.yaml).
To install the correct GHC into /home/qrilka/.stack/programs/x86_64-linux/, try running "stack setup" or use the "--install-ghc" flag.
qrilka@qdesktop ~/ws/h/stack-test-ghc-7.8.4 $ stack --numeric-version
1.7.1
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.
It's perfectly clear, thanks!!
. set (globalOptsL.configMonoidSkipGHCCheckL) (Just True) | ||
. set (globalOptsL.configMonoidInstallGHCL) (Just False) | ||
|
||
-- helper function for update some option |
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.
-- helper function for update some option | |
-- helper function to update an option |
It would be good to document what the Bool
represents.
@dbaynard I was able to do it. $ stack --numeric-version
1.9.1
$ stack --no-install-ghc --skip-ghc-check --system-ghc dot --external
strict digraph deps {
"clean" [style=dashed];
{rank=max; "rts" [shape=box]; };
"base" -> "ghc-prim";
"base" -> "integer-gmp";
"base" -> "rts";
"clean" -> "base";
"ghc-prim" -> "rts";
"integer-gmp" -> "ghc-prim";
}
$ stack --no-install-ghc --skip-ghc-check dot --external
No compiler found...
Lines 386 to 391 in 0b68efc
Lines 395 to 399 in 0b68efc
In other words, ghci> :t any
any :: Foldable t => (a -> Bool) -> t a -> Bool
ghci> any (const True) Nothing
False I think that we should just only enable these option in What do you think? |
I don't think enabling |
Thanks @qrilka. I understand it. My implemented checkDownloadCompiler _ SkipDownloadCompiler = return (Nothing, Nothing, False)
checkDownloadCompiler sopts WithDownloadCompiler
| installIfMissing = ensureCompiler sopts
| otherwise = return (Nothing, Nothing, False)
where
installIfMissing = soptsInstallIfMissing sopts Hence, |
I think it's wrong, yes, disabling GHC installation doesn't mean that compiler check should get skipped. For |
All right. It was my mistake. I will fix asap! |
There are some changes in progress (e.g. #4500) which may affect this. |
@dbaynard |
It should be merged soon — but if you work on it before then just take into account those changes. I think the only changes left for that PR are in the test suite. |
I'm looking into this right now as part of my work on cleaning up |
Note: Documentation fixes for https://docs.haskellstack.org/en/stable/ should target the "stable" branch, not master.
Please include the following checklist in your PR:
Please also shortly describe how you tested your change. Bonus points for added tests!
@dbaynard fixed #4390. Could you please confirm it?