Skip to content

Commit e1e17e5

Browse files
authored
Merge of #12022
2 parents 73c60d9 + bb8463c commit e1e17e5

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
@@ -151,7 +151,7 @@ buildOptions progDb showOrParseArgs =
151151
, option
152152
[]
153153
["semaphore"]
154-
"Use the specified semaphore so GHC can compile components in parallel"
154+
"Use the specified semaphore identifier so GHC can compile components in parallel"
155155
buildUseSemaphore
156156
(\v flags -> flags{buildUseSemaphore = v})
157157
(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)