diff --git a/ChangeLog.md b/ChangeLog.md index 9d5350b131..5cf6e7d24a 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -8,6 +8,10 @@ Major changes: Behavior changes: +* Use a stack-installed, isolated GHC by default, ignoring any system + installations (overridable with `--system-ghc`). + [#2221](https://github.com/commercialhaskell/stack/issues/2221) + Other enhancements: Bug fixes: diff --git a/doc/yaml_configuration.md b/doc/yaml_configuration.md index ad18401f09..5bc153a41c 100644 --- a/doc/yaml_configuration.md +++ b/doc/yaml_configuration.md @@ -299,13 +299,13 @@ other projects by installing into your shared snapshot database. ### system-ghc -Enables or disables using the GHC available on the PATH. Useful to disable if -you want to force stack to use its own installed GHC (via `stack setup`), in -cases where your system GHC my be incomplete for some reason. Default is `true`. +Enables or disables using the GHC available on the PATH. +Useful to disable if you want to save the time, bandwidth or storage space needed to setup an isolated GHC. +Default is `false`. ```yaml -# Turn off system GHC -system-ghc: false +# Turn on system GHC +system-ghc: true ``` ### install-ghc diff --git a/src/Stack/Config.hs b/src/Stack/Config.hs index a13a2e91cb..0287c12040 100644 --- a/src/Stack/Config.hs +++ b/src/Stack/Config.hs @@ -227,7 +227,7 @@ configFromConfigMonoid configStackRoot configUserConfigPath mresolver mproject C configGHCVariant0 = getFirst configMonoidGHCVariant - configSystemGHC = fromFirst (isNothing configGHCVariant0) configMonoidSystemGHC + configSystemGHC = fromFirst False configMonoidSystemGHC configInstallGHC = fromFirst False configMonoidInstallGHC configSkipGHCCheck = fromFirst False configMonoidSkipGHCCheck configSkipMsys = fromFirst False configMonoidSkipMsys diff --git a/src/Stack/Options.hs b/src/Stack/Options.hs index b3f2d04d69..90923bdbf6 100644 --- a/src/Stack/Options.hs +++ b/src/Stack/Options.hs @@ -251,7 +251,7 @@ configOptsParser hide0 = <*> nixOptsParser True <*> firstBoolFlags "system-ghc" - "using the system installed GHC (on the PATH) if available and a matching version" + "using the system installed GHC (on the PATH) if available and a matching version. Disabled by default" hide <*> firstBoolFlags "install-ghc" @@ -861,7 +861,7 @@ ghcVariantParser hide = readGHCVariant (long "ghc-variant" <> metavar "VARIANT" <> help - "Specialized GHC variant, e.g. integersimple (implies --no-system-ghc)" <> + "Specialized GHC variant, e.g. integersimple" <> hideMods hide ) where diff --git a/src/Stack/Setup.hs b/src/Stack/Setup.hs index e4c7f5ff32..89f499709c 100644 --- a/src/Stack/Setup.hs +++ b/src/Stack/Setup.hs @@ -403,7 +403,8 @@ ensureCompiler sopts = do (soptsStackYaml sopts) (fromMaybe ("Try running \"stack setup\" to install the correct GHC into " - <> T.pack (toFilePath (configLocalPrograms config))) + <> T.pack (toFilePath (configLocalPrograms config)) + <> " or use \"--system-ghc\" to use a suitable compiler available on your PATH.") $ soptsResolveMissingGHC sopts) -- Install msys2 on windows, if necessary diff --git a/src/Stack/SetupCmd.hs b/src/Stack/SetupCmd.hs index b228d36d76..34d9190399 100644 --- a/src/Stack/SetupCmd.hs +++ b/src/Stack/SetupCmd.hs @@ -46,7 +46,7 @@ setupParser = SetupCmdOpts "The default is to install the version implied by the resolver."))) <*> OA.boolFlags False "reinstall" - "reinstalling GHC, even if available (implies no-system-ghc)" + "reinstalling GHC, even if available" OA.idm <*> OA.boolFlags False "upgrade-cabal"