Skip to content

Commit 1fea03d

Browse files
committed
Re #11498 Better document Cabal's --semaphore=SEMAPHORE option
This is follows GHC's dependency on `semaphore-compat-2.0.0` (first reflected in GHC 9.12.5-rc2). The terminology of the dependency package now: * introduces the concept of protocol versions for semaphores (there remains only one protocol version on Windows); * distinguishes server semaphores and corresponding client semaphores; and * distinguishes unversioned client semaphore names and client semaphore identifiers. This conforms the language in Cabal's User Guide to that of the package.
1 parent 4f84593 commit 1fea03d

3 files changed

Lines changed: 22 additions & 3 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: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,8 +1091,17 @@ This command takes the following options:
10911091

10921092
GHC 9.8.1 and later can act as a jobserver client, which enables two or more
10931093
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).
1094+
communicating via a semaphore, as implemented by the
1095+
`semaphore-compat <https://hackage.haskell.org/package/semaphore-compat>`_
1096+
library.
1097+
1098+
The expected usage is that a jobserver (the build system controlling the build,
1099+
e.g. ``cabal-install``, ``stack``, ``nix``, ``buck2``...) creates or obtains a semaphore using ``semaphore-compat``,
1100+
passing down the semaphore to jobclients in order to control the total
1101+
amount of parallelism. This is done by passing the corresponding semaphore identifier to ``Cabal`` via the ``--semaphore`` flag.
1102+
1103+
Refer to `semaphore-compat <https://hackage.haskell.org/package/semaphore-compat>`_
1104+
for more details.
10961105

10971106
This option causes Cabal to control parallelism by using the specified
10981107
system semaphore.

0 commit comments

Comments
 (0)