commercialhaskell / commercialhaskell/stack

Is the current default for `--[no-]system-ghc` the most appropriate?

Open
#6,580 6 comments 0 reactions 0 assignees View on GitHub
component: setup type: discuss
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

Motivation: A discussion on Matrix about the merits and drawbacks of the current default (`--no-system-ghc`).

`--system-ghc` asks Stack to try and use the GHC on the path, if it exists and is the appropriate version. (The `compiler-check:` configuration tailors what is 'appropriate') This may avoid Stack creating a duplicate GHC elsewhere (if it has not already done so).

History:
* https://github.com/commercialhaskell/stack/issues/1125#issuecomment-146733987
* https://github.com/commercialhaskell/stack/issues/1129
* https://github.com/commercialhaskell/stack/issues/1901
* https://github.com/commercialhaskell/stack/issues/2221
* https://github.com/commercialhaskell/stack/pull/2537

The current default has applied since [Stack 1.3.0](https://docs.haskellstack.org/en/stable/ChangeLog/#130-2016-12-12) (released 2016-12-12).

(The default `compiler-check: match-minor` matches GHC X.Y.Z, but allows patch-level differences. So, in the case of GHC release candidates, GHC 9.10.0.20240413 and GHC 9.10.0.20240426 (for example) are not distinguished by default.)

Certain GitHub-hosted runners come with GHC on the PATH (currently, not `macos-latest` or `macos-13`). However, that is only useful in practice if the GHC version in question is specified by a Stackage snapshot. Currently, GitHub provides GHC 9.10.1 but that is not specified by any snapshot.

In the case of CI scripts, Stack provides `stack config set system-ghc [--global] true`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.