Make dot and ls dependencies work without ghc installed#4405
Make dot and ls dependencies work without ghc installed#4405waddlaw wants to merge 7 commits intocommercialhaskell:masterfrom waddlaw:fix-T4390
Conversation
| . updateOpts True (globalOptsL.configMonoidInstallGHCL) (Just False) | ||
|
|
||
| -- helper function for update some option | ||
| updateOpts :: Bool -> Lens' opts v -> v -> opts -> opts |
| 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.
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.
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 🤩 |
dbaynard
left a comment
There was a problem hiding this comment.
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).
| 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.
As @qrilka noted, this could do with some documentation. We may want to change the WithDownloadCompiler enum as a result.
| [#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.
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.
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.
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.
| -- 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
FalseI 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 soptsHence, |
|
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?