Skip to content

Commit 519d680

Browse files
committed
Improve online documentation for jobs
1 parent 589358f commit 519d680

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

doc/global_flags.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,18 @@ configuration [option](yaml_configuration.md#install-ghc).
101101
## `--jobs` or `-j` option
102102

103103
Pass the option `--jobs <number_of_jobs>` to specify the number of concurrent
104-
jobs to run. For further information, see the documentation for the
105-
corresponding non-project specific configuration
106-
[option](yaml_configuration.md#jobs).
104+
jobs (Stack actions during building) to run.
105+
106+
By default, Stack specifies a number of concurrent jobs equal to the number of
107+
CPUs (cores) that the machine has. In some circumstances, that default can cause
108+
some machines to run out of memory during building. If those circumstances
109+
arise, specify `--jobs 1`.
110+
111+
This configuration option is distinct from GHC's own `-j[<n>]` flag, which
112+
relates to parallel compilation of modules within a package.
113+
114+
For further information, see the documentation for the corresponding non-project
115+
specific configuration option: [`jobs`](yaml_configuration.md#jobs).
107116

108117
## `--local-bin-path` option
109118

doc/yaml_configuration.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -906,16 +906,18 @@ Whether or not to automatically install GHC when necessary.
906906

907907
### jobs
908908

909-
Default: the number of processors reported by your CPU.
909+
Default: the number of CPUs (cores) that the machine has.
910910

911-
Command line equivalent (takes precedence): `-j`, `--jobs` option
911+
Command line equivalent (takes precedence):
912+
[`-j`, `--jobs` option](global_flags.md#-jobs-or--j-option)
912913

913-
Specifies how many build tasks should be run in parallel. One usage for this
914-
might be to avoid running out of memory by setting it to 1, like this:
914+
Specifies the number of concurrent jobs (Stack actions during building) to run.
915915

916-
~~~yaml
917-
jobs: 1
918-
~~~
916+
In some circumstances, the default can cause some machines to run out of memory
917+
during building. If those circumstances arise, specify `jobs: 1`.
918+
919+
This configuration option is distinct from GHC's own `-j[<n>]` flag, which
920+
relates to parallel compilation of modules within a package.
919921

920922
### local-bin-path
921923

0 commit comments

Comments
 (0)