how to prevent 'stack' from installing 'ghc'?

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.

You can use the install-ghc option, either in your stack.yaml, or on the command line. On Sun, Jun 10, 2018, 6:52 AM Johannes Waldmann < johannes.waldmann@htwk-leipzig.de> wrote:
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. _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
participants (2)
-
Johannes Waldmann
-
Michael Snoyman