1 module Distribution
.Types
.ParStrat
where
3 -- | How to control parallelism, e.g. a fixed number of jobs or by using a system semaphore.
5 = -- | Compile in parallel with the given number of jobs (`-jN` or `-j`).
7 |
-- | `--semaphore`: use a system semaphore to control parallelism.
9 |
-- | No parallelism (neither `-jN` nor `--semaphore`, but could be `-j1`).
13 -- | Used by Cabal to indicate that we want to use this specific semaphore (created by cabal-install)
14 type ParStrat
= ParStratX
String
16 -- | Used by cabal-install to say we want to create a semaphore with N slots.
17 type ParStratInstall
= ParStratX
Int
19 -- | Determine if the parallelism strategy enables parallel builds.
20 isParallelBuild
:: ParStratX n
-> Bool
21 isParallelBuild Serial
= False
22 isParallelBuild
(NumJobs
(Just
1)) = False
23 isParallelBuild
(NumJobs _
) = True
24 isParallelBuild UseSem
{} = True