Skip to content

Commit

Permalink
Default to using a stack-installed, isolated GHC #2221
Browse files Browse the repository at this point in the history
  • Loading branch information
sjakobi committed Aug 28, 2016
1 parent b79dae1 commit bc8b3af
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions doc/yaml_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Stack/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Stack/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/Stack/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Stack/SetupCmd.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit bc8b3af

Please sign in to comment.