Skip to content

Commit cf2c9aa

Browse files
authored
Merge pull request #12103 from haskell/mergify/bp/3.18/pr-12022
Backport #12022: Re #11498 Better document Cabal's --semaphore=SEMAPHORE option
2 parents 328a387 + f5aeafb commit cf2c9aa

3 files changed

Lines changed: 24 additions & 5 deletions

File tree

Cabal/src/Distribution/Simple/Setup/Build.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ buildOptions progDb showOrParseArgs =
152152
, option
153153
[]
154154
["semaphore"]
155-
"Use the specified semaphore so GHC can compile components in parallel"
155+
"Use the specified semaphore identifier so GHC can compile components in parallel"
156156
buildUseSemaphore
157157
(\v flags -> flags{buildUseSemaphore = v})
158158
(reqArg' "SEMAPHORE" Flag flagToList)

changelog.d/pr-12022.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
synopsis: Better document Cabal's `--semaphore=SEMAPHORE` option in light of `semaphore-compat-2.0.0`
2+
packages: Cabal
3+
prs: #12022
4+
significance:
5+
6+
description: {
7+
8+
- Cabal's `--semaphore=SEMAPHORE` option is better documented in the user's guide and in `--help`.
9+
10+
}

doc/setup-commands.rst

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,13 +1089,22 @@ This command takes the following options:
10891089

10901090
:since: 3.12.0.0
10911091

1092+
This option causes Cabal to control parallelism by using the specified
1093+
semaphore.
1094+
10921095
GHC 9.8.1 and later can act as a jobserver client, which enables two or more
10931096
GHC processes running at once to share system resources with each other,
1094-
communicating via a specified system semaphore. The system semaphore is
1095-
identified by a name (a string).
1097+
communicating via a semaphore.
10961098

1097-
This option causes Cabal to control parallelism by using the specified
1098-
system semaphore.
1099+
The expected use is that the system controlling the build (e.g.
1100+
``cabal-install``, ``stack``, ``nix`` or ``buck2``) (a jobserver) creates or
1101+
obtains a semaphore using the ``semaphore-compat`` library. It then passes
1102+
the semaphore to jobserver clients in order to control the amount of
1103+
parallelism. This is done by passing the corresponding semaphore identifier
1104+
to Cabal via the ``--semaphore`` option.
1105+
1106+
For more information, see
1107+
`semaphore-compat <https://hackage.haskell.org/package/semaphore-compat>`_.
10991108

11001109
.. _setup-haddock:
11011110

0 commit comments

Comments
 (0)