Is the current default for --[no-]system-ghc
the most appropriate? #6580
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:
- yesod devel fails for stack-built and installed yesod-bin / yesod project #1125 (comment)
- Change default to not use system-ghc unless otherwise specified. #1129
- Prefer stack installed GHC even if it's the same as the system GHC #1901
- Stop using system-ghc silently…or at all. #2221
- Default to using a stack-installed, isolated GHC #2537
The current default has applied since Stack 1.3.0 (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
.