Skip to content

Commit b1ab8ce

Browse files
authored
Merge pull request #3581 from commercialhaskell/add-to-yaml-config-docs
yaml_configuration.md coverage for all options
2 parents 69410bf + 248ad29 commit b1ab8ce

File tree

2 files changed

+117
-28
lines changed

2 files changed

+117
-28
lines changed

doc/GUIDE.md

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,8 +1577,9 @@ what needs to be removed:
15771577
We've already used `stack exec` used multiple times in this guide. As you've
15781578
likely already guessed, it allows you to run executables, but with a slightly
15791579
modified environment. In particular: `stack exec` looks for executables on
1580-
stack's bin paths, and sets a few additional environment variables (like
1581-
`GHC_PACKAGE_PATH`, which tells GHC which package databases to use).
1580+
stack's bin paths, and sets a few additional environment variables (like adding
1581+
those paths to `PATH`, and setting `GHC_PACKAGE_PATH`, which tells GHC which
1582+
package databases to use).
15821583
15831584
If you want to see exactly what the modified environment looks like, try:
15841585
@@ -1906,21 +1907,6 @@ __Other tools for comparison (including active and historical)__
19061907
* [cabal-src](https://hackage.haskell.org/package/cabal-src) is mostly irrelevant in the presence of both stack and cabal sandboxes, both of which make it easier to add additional package sources easily. The mega-sdist executable that ships with cabal-src is, however, still relevant. Its functionality may some day be folded into stack
19071908
* [stackage-cli](https://hackage.haskell.org/package/stackage-cli) was an initial attempt to make cabal-install work more easily with curated snapshots, but due to a slight impedance mismatch between cabal.config constraints and snapshots, it did not work as well as hoped. It is deprecated in favor of stack.
19081909
1909-
## More resources
1910-
1911-
There are lots of resources available for learning more about stack:
1912-
1913-
* `stack --help`
1914-
* `stack --version` — identify the version and Git hash of the stack executable
1915-
* `--verbose` (or `-v`) — much more info about internal operations (useful for bug reports)
1916-
* The [home page](http://haskellstack.org)
1917-
* The [stack mailing list](https://groups.google.com/d/forum/haskell-stack)
1918-
* The [the FAQ](faq.md)
1919-
* The [stack wiki](https://github.com/commercialhaskell/stack/wiki)
1920-
* The [haskell-stack tag on Stack Overflow](http://stackoverflow.com/questions/tagged/haskell-stack)
1921-
* [Another getting started with stack tutorial](http://seanhess.github.io/2015/08/04/practical-haskell-getting-started.html)
1922-
* [Why is stack not cabal?](https://www.fpcomplete.com/blog/2015/06/why-is-stack-not-cabal)
1923-
19241910
19251911
## Fun features
19261912
@@ -1969,11 +1955,11 @@ As a starting point you can use [the "simple" template](https://github.com/comme
19691955
An introduction into template-writing and a place for submitting official templates,
19701956
you will find at [the stack-templates repository](https://github.com/commercialhaskell/stack-templates#readme).
19711957
1972-
### IDE
1958+
### Editor integration
19731959
1974-
stack has a work-in-progress suite of editor integrations, to do things like
1975-
getting type information in Emacs. For more information, see
1976-
[stack-ide](https://github.com/commercialhaskell/stack-ide#readme).
1960+
For editor integration, stack has a related project called
1961+
[intero](https://github.com/commercialhaskell/intero). It is particularly well
1962+
supported by emacs, but some other editors have integration for it as well.
19771963
19781964
### Visualizing dependencies
19791965
@@ -2166,6 +2152,14 @@ build:
21662152
executable-profiling: true
21672153
```
21682154

2155+
### Further reading
2156+
2157+
For more commands and uses, see [the official GHC chapter on
2158+
profiling](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html),
2159+
[the Haskell wiki](https://wiki.haskell.org/How_to_profile_a_Haskell_program),
2160+
and [the chapter on profiling in Real World
2161+
Haskell](http://book.realworldhaskell.org/read/profiling-and-optimization.html).
2162+
21692163
### Tracing
21702164

21712165
To generate a backtrace in case of exceptions during a test or benchmarks run,
@@ -2180,10 +2174,17 @@ using the `--no-strip`, `--no-library-stripping`, and `--no-executable-stripping
21802174
flags to disable the default behavior of removing such information from compiled
21812175
libraries and executables.
21822176

2183-
### Further reading
2177+
## More resources
21842178

2185-
For more commands and uses, see [the official GHC chapter on
2186-
profiling](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html),
2187-
[the Haskell wiki](https://wiki.haskell.org/How_to_profile_a_Haskell_program),
2188-
and [the chapter on profiling in Real World
2189-
Haskell](http://book.realworldhaskell.org/read/profiling-and-optimization.html).
2179+
There are lots of resources available for learning more about stack:
2180+
2181+
* `stack --help`
2182+
* `stack --version` — identify the version and Git hash of the stack executable
2183+
* `--verbose` (or `-v`) — much more info about internal operations (useful for bug reports)
2184+
* The [home page](http://haskellstack.org)
2185+
* The [stack mailing list](https://groups.google.com/d/forum/haskell-stack)
2186+
* The [the FAQ](faq.md)
2187+
* The [stack wiki](https://github.com/commercialhaskell/stack/wiki)
2188+
* The [haskell-stack tag on Stack Overflow](http://stackoverflow.com/questions/tagged/haskell-stack)
2189+
* [Another getting started with stack tutorial](http://seanhess.github.io/2015/08/04/practical-haskell-getting-started.html)
2190+
* [Why is stack not cabal?](https://www.fpcomplete.com/blog/2015/06/why-is-stack-not-cabal)

doc/yaml_configuration.md

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ save-hackage-creds: true
759759

760760
Since 1.5.0
761761

762-
# urls
762+
### urls
763763

764764
Customize the URLs where `stack` looks for snapshot build plans.
765765

@@ -774,3 +774,91 @@ urls:
774774

775775
**Note:** The `latest-snapshot-url` field has been deprecated in favor of `latest-snapshot`
776776
and will be removed in a future version of `stack`.
777+
778+
### jobs
779+
780+
Specifies how many build tasks should be run in parallel. This can be overloaded
781+
on the commandline via `-jN`, for example `-j2`. The default is to use the
782+
number of processors reported by your CPU. One usage for this might be to avoid
783+
running out of memory by setting it to 1, like this:
784+
785+
```yaml
786+
jobs: 1
787+
```
788+
789+
### work-dir
790+
791+
Specifies relative path of work directory (default is `.stack-work`. This can
792+
also be specified by env var or cli flag, in particular, the earlier items in
793+
this list take precedence:
794+
795+
1. `--work-dir DIR` passed on the commandline
796+
2. `work-dir` in stack.yaml
797+
3. `STACK_WORK` environment variable
798+
799+
Since 0.1.10.0
800+
801+
### skip-msys
802+
803+
Skips checking for and installing msys2 when stack is setting up the
804+
environment. This is only useful on Windows machines, and usually doesn't make
805+
sense in project configurations, just in `config.yaml`. Defaults to `false`, so
806+
if this is used, it only really makes sense to use it like this:
807+
808+
```yaml
809+
skip-msys: true
810+
```
811+
812+
Since 0.1.2.0
813+
814+
### concurrent-tests
815+
816+
This option specifies whether test-suites should be executed concurrently with
817+
each-other. The default for this is true, since this is usually fine and it
818+
often means that tests can complete earlier. However, if some test-suites
819+
require exclusive access to some resource, or require a great deal of CPU or
820+
memory resources, then it makes sense to set this to `false` (the default is
821+
`true`).
822+
823+
```yaml
824+
concurrent-tests: false
825+
```
826+
827+
Since 0.1.2.0
828+
829+
### extra-path
830+
831+
This option specifies additional directories to prepend to the PATH environment
832+
variable. These will be used when resolving the location of executables, and
833+
will also be visible in the `PATH` variable of processes run by stack.
834+
835+
For example, to prepend `/path-to-some-dep/bin` to your PATh:
836+
837+
```yaml
838+
extra-path:
839+
- /path-to-some-dep/bin
840+
```
841+
842+
One thing to note is that other paths added by stack - things like the project's
843+
bin dir and the compiler's bin dir - will take precedence over those specified
844+
here (the automatic paths get prepended).
845+
846+
Since 0.1.4.0
847+
848+
### local-programs-path
849+
850+
This overrides the location of the programs directory, where tools like ghc and
851+
msys get installed.
852+
853+
On most systems, this defaults to a folder called `programs`
854+
within the stack root directory. On windows, if the `LOCALAPPDATA` environment
855+
variable exists, then it defaults to `$LOCALAPPDATA/Programs/stack/`, which
856+
follows windows conventions.
857+
858+
Since 1.3.0
859+
860+
### default-template
861+
862+
This option specifies which template to use with `stack new`, when none is
863+
specified. The default is called `new-template`. The other templates are listed
864+
in [the stack-templates repo](https://github.com/commercialhaskell/stack-templates/).

0 commit comments

Comments
 (0)