I believe several stack sub-command like dot and ls dependencies should work without ghc installed; after all, these commands do not require compiling anything.
What I see instead when running stack --no-install-ghc --skip-ghc-check dot --external on this example project is that stack complains with
No compiler found, expected minor version match with ghc-8.2.2 (x86_64) (based on resolver setting in quickcheck-state-machine\example\stack.yaml).
To install the correct GHC into C:\Users\<name>\AppData\Local\Programs\stack\x86_64-windows\, try running "stack setup" or use the "--install-ghc" flag.
As can bee seen above, I was trying to work around that issue by specifying --no-install-ghc --skip-ghc-check, but stack is checking for ghc nonetheless.
This issue seems to be somewhat related to https://github.com/commercialhaskell/stack/issues/4181 where even a simple clean tries to bootstrap all of ghc.
Background: We use the OSS Review Toolkit to inspect Haskell project dependencies without building them. Right now, we still need to provide ghc, wasting time & space.
There's #4268 for clean, which should be ready soon.
Which commands have you encountered, then? Just the following?
dotls dependenciesThese two sub-commands are the ones I'd personally need to work without ghc installed, but I guess there's more.
I wonder whether a good first step to generically work around the issue is to make --no-install-ghc --skip-ghc-check actually work. These should work anyway.
As a second step, the real fix should be that sub-command which don't require ghc can actually be called without --no-install-ghc --skip-ghc-check.
So the bug (which I have not confirmed) would be for --no-install-ghc --skip-ghc-check.
The enhancement is for the subcommands.
@waddlaw (who implemented this for stack clean) is going to give this a go!
Thanks @snoyberg for implementing this! Is there a way to try this feature out immediately without waiting for a new release? E.g. by running https://github.com/commercialhaskell/stack/blob/master/etc/scripts/get-stack.sh from master instead of from https://get.haskellstack.org/?
You should be able to run stack upgrade --git.