@@ -155,23 +155,39 @@ the following line to your .cabal file:
155155
156156# # I already have GHC installed, can I still use stack?
157157
158- Yes. stack will default to using whatever GHC is on your `PATH`. If that GHC is
159- a compatible version with the snapshot you're using, it will simply use it.
160- Otherwise, it will prompt you to run `stack setup`. Note that `stack setup`
161- installs GHC into `~/.stack/programs/$platform/ghc-$version/` and not a global
162- location.
158+ Yes. In its default configuration, stack will simply ignore any system GHC
159+ installation and use a sandboxed GHC that it has installed itself (typically
160+ via the `stack setup` command). You can find these sandboxed GHC installations
161+ in `~/.stack/programs/$platform/ghc-$version/`.
163162
164- Note that GHC installation doesn't work for all OSes, so in some cases the
165- first option will need to install GHC yourself.
163+ If you would like stack to use your system GHC installation, use the
164+ [`--system-ghc` flag](yaml_configuration.md#system-ghc) or run
165+ ` stack config set system-ghc --global true` to make stack check your
166+ ` PATH` for a suitable GHC by default.
167+
168+ Note that stack can only use a system GHC installation if its version is
169+ compatible with the configuration of the current project, particularly the
170+ [`resolver` setting](yaml_configuration.md#resolver).
171+
172+ Note that GHC installation doesn't work for all OSes, so in some cases you
173+ will need to use `system-ghc` and install GHC yourself.
166174
167175# # How does stack determine what GHC to use?
168176
169- It uses the first GHC that it finds on the `PATH`. If that GHC does not comply
170- with the various requirements (version, architecture) that your project needs,
171- it will prompt you to run `stack setup` to get it. `stack` is fully aware of
172- all GHCs that it has installed itself.
177+ In its default configuration, stack determines from the current project which
178+ GHC version, architecture etc. it needs. It then looks in
179+ ` ~/.stack/programs/$platform/ghc-$version/` for a compatible GHC, requesting
180+ to install one via `stack setup` if none is found.
181+
182+ If you are using the [`--system-ghc` flag](yaml_configuration.md/#system-ghc) or
183+ have configured `system-ghc : true` either in the project `stack.yaml`
184+ or the global `~/.stack/config.yaml`, stack will use the first GHC that it finds
185+ on your `PATH`, falling back on its sandboxed installations only if the found GHC
186+ doesn't comply with the various requirements (version, architecture) that your
187+ project needs.
173188
174- See [this issue](https://github.com/commercialhaskell/stack/issues/420) for a detailed discussion.
189+ See [this issue](https://github.com/commercialhaskell/stack/issues/420) for a
190+ detailed discussion of stack's behavior when `system-ghc` is enabled.
175191
176192# # How do I upgrade to GHC 7.10.2 with stack?
177193
0 commit comments