[Haskell-cafe] how to prevent 'stack' from installing 'ghc'?

Johannes Waldmann johannes.waldmann at htwk-leipzig.de
Sun Jun 10 13:51:37 UTC 2018

Dear Cafe,

'stack'  tries to download and install a  'ghc'  binary
in case  'ghc'  in  $PATH  does not match
what is needed for the resolver given in  'stack.yaml'

How can I switch this off completely and reliably?
I much rather  'stack'  just fails when it detects the mismatch.
putting  'system-ghc: true'  in  'stack.yaml'
and  '~/.stack/config.yaml'  apparently is not enough.

'stack'  does warn before downloading,
but sometimes I'm not seeing the warning,
e.g., because the whole thing is triggered silently
from using  'intero'.

I do have several ghc executables (built from source)
in  /opt/ghc/ghc-$version/bin/ghc
and I just need to set  PATH  accordingly.

It would be even better if I could tell
'stack'  (once and for all) about these locations.

I think I understand why  'stack'  does what it does
(reproducible builds) but I really want to minimize
the number of other people's binaries on my machine.
I do use the auto-download feature for easier CI builds -
so I agree it can be useful.

- J.W.

More information about the Haskell-Cafe mailing list