Forked from
Glasgow Haskell Compiler / GHC
5493 commits behind the upstream repository.
-
See https://github.com/ghc-proposals/ghc-proposals/pull/540/ for a complete description for the motivation for this feature. The `-jsem` option allows a build tool to pass a semaphore to GHC which GHC can use in order to control how much parallelism it requests. GHC itself acts as a client in the GHC jobserver protocol. ``` GHC Jobserver Protocol ~~~~~~~~~~~~~~~~~~~~~~ This proposal introduces the GHC Jobserver Protocol. This protocol allows a server to dynamically invoke many instances of a client process, while restricting all of those instances to use no more than <n> capabilities. This is achieved by coordination over a system semaphore (either a POSIX semaphore [6]_ in the case of Linux and Darwin, or a Win32 semaphore [7]_ in the case of Windows platforms). There are two kinds of participants in the GHC Jobserver protocol: - The *jobserver* creates a system semaphore with a certain number of available tokens. Each time the jobserver wants to spawn a new jobclient subprocess, it **must** first acquire a single token from the semaphore, before spawning the subprocess. This token **must** be released once the subprocess terminates. Once work is finished, the jobserver **must** destroy the semaphore it created. - A *jobclient* is a subprocess spawned by the jobserver or another jobclient. Each jobclient starts with one available token (its *implicit token*, which was acquired by the parent which spawned it), and can request more tokens through the Jobserver Protocol by waiting on the semaphore. Each time a jobclient wants to spawn a new jobclient subprocess, it **must** pass on a single token to the child jobclient. This token can either be the jobclient's implicit token, or another token which the jobclient acquired from the semaphore. Each jobclient **must** release exactly as many tokens as it has acquired from the semaphore (this does not include the implicit tokens). ``` Build tools such as cabal act as jobservers in the protocol and are responsibile for correctly creating, cleaning up and managing the semaphore. Adds a new submodule (semaphore-compat) for managing and interacting with semaphores in a cross-platform way. Fixes #19349
See https://github.com/ghc-proposals/ghc-proposals/pull/540/ for a complete description for the motivation for this feature. The `-jsem` option allows a build tool to pass a semaphore to GHC which GHC can use in order to control how much parallelism it requests. GHC itself acts as a client in the GHC jobserver protocol. ``` GHC Jobserver Protocol ~~~~~~~~~~~~~~~~~~~~~~ This proposal introduces the GHC Jobserver Protocol. This protocol allows a server to dynamically invoke many instances of a client process, while restricting all of those instances to use no more than <n> capabilities. This is achieved by coordination over a system semaphore (either a POSIX semaphore [6]_ in the case of Linux and Darwin, or a Win32 semaphore [7]_ in the case of Windows platforms). There are two kinds of participants in the GHC Jobserver protocol: - The *jobserver* creates a system semaphore with a certain number of available tokens. Each time the jobserver wants to spawn a new jobclient subprocess, it **must** first acquire a single token from the semaphore, before spawning the subprocess. This token **must** be released once the subprocess terminates. Once work is finished, the jobserver **must** destroy the semaphore it created. - A *jobclient* is a subprocess spawned by the jobserver or another jobclient. Each jobclient starts with one available token (its *implicit token*, which was acquired by the parent which spawned it), and can request more tokens through the Jobserver Protocol by waiting on the semaphore. Each time a jobclient wants to spawn a new jobclient subprocess, it **must** pass on a single token to the child jobclient. This token can either be the jobclient's implicit token, or another token which the jobclient acquired from the semaphore. Each jobclient **must** release exactly as many tokens as it has acquired from the semaphore (this does not include the implicit tokens). ``` Build tools such as cabal act as jobservers in the protocol and are responsibile for correctly creating, cleaning up and managing the semaphore. Adds a new submodule (semaphore-compat) for managing and interacting with semaphores in a cross-platform way. Fixes #19349
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
cabal.project-reinstall 2.26 KiB
packages: ./compiler
./utils/genprimopcode/
./utils/deriveConstants/
./ghc/
-- ./libraries/array
-- ./libraries/base
./libraries/binary
./libraries/bytestring
./libraries/Cabal/Cabal
./libraries/Cabal/Cabal-syntax
./libraries/containers/containers/
-- ./libraries/deepseq/
./libraries/directory/
./libraries/exceptions/
./libraries/filepath/
-- ./libraries/ghc-bignum/
./libraries/ghc-boot/
-- ./libraries/ghc-boot-th/
./libraries/ghc-compact
./libraries/ghc-heap
./libraries/ghci
-- ./libraries/ghc-prim
./libraries/haskeline
./libraries/directory
./libraries/hpc
-- ./libraries/integer-gmp
./libraries/mtl/
./libraries/parsec/
-- ./libraries/pretty/
./libraries/process/
./libraries/semaphore-compat
./libraries/stm
-- ./libraries/template-haskell/
./libraries/terminfo/
./libraries/text
./libraries/time
./libraries/transformers/
./libraries/unix/
./libraries/Win32/
./libraries/xhtml/
./utils/ghc-pkg
./utils/haddock
./utils/hp2ps
./utils/hpc
./utils/hsc2hs
./utils/runghc
./utils/unlit
./utils/iserv
./linters/**/*.cabal
constraints: ghc +internal-interpreter +dynamic-system-linke,
ghc-bin +internal-interpreter +threaded,
ghci +internal-interpreter,
haddock +in-ghc-tree,
any.array installed,
any.base installed,
any.deepseq installed,
any.ghc-bignum installed,
any.ghc-boot-th installed,
any.integer-gmp installed,
any.pretty installed,
any.template-haskell installed
allow-newer:
ghc-paths:Cabal,
*:base,
*:ghc-prim,
tree-diff:time
benchmarks: False
tests: False
allow-boot-library-installs: False
-- Workaround for https://github.com/haskell/cabal/issues/7297
package *
library-vanilla: True
shared: True
executable-profiling: False
executable-dynamic: True