Skip to content

Commit f323d29

Browse files
authored
Merge pull request #10055 from wismill/semaphore/verbosity
fix: Make newSemaphoreJobControl respect verbosity
2 parents 3a8c69c + 225d2b1 commit f323d29

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

cabal-install/src/Distribution/Client/JobControl.hs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ import Control.Monad (forever, replicateM_)
4545
import Distribution.Client.Compat.Semaphore
4646
import Distribution.Compat.Stack
4747
import Distribution.Simple.Utils
48-
import Distribution.Verbosity
4948
import System.Semaphore
5049

5150
-- | A simple concurrency abstraction. Jobs can be spawned and can complete
@@ -171,13 +170,13 @@ readAllTChan qvar = go []
171170
--
172171
-- This uses the GHC -jsem option to allow GHC to take additional semaphore slots
173172
-- if we are not using them all.
174-
newSemaphoreJobControl :: WithCallStack (Int -> IO (JobControl IO a))
175-
newSemaphoreJobControl n
173+
newSemaphoreJobControl :: WithCallStack (Verbosity -> Int -> IO (JobControl IO a))
174+
newSemaphoreJobControl _ n
176175
| n < 1 || n > 1000 =
177176
error $ "newParallelJobControl: not a sensible number of jobs: " ++ show n
178-
newSemaphoreJobControl maxJobLimit = do
177+
newSemaphoreJobControl verbosity maxJobLimit = do
179178
sem <- freshSemaphore "cabal_semaphore" maxJobLimit
180-
notice normal $
179+
notice verbosity $
181180
"Created semaphore called "
182181
++ getSemaphoreName (semaphoreName sem)
183182
++ " with "

cabal-install/src/Distribution/Client/ProjectBuilding.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ rebuildTargets
366366
NumJobs n -> newParallelJobControl (fromMaybe numberOfProcessors n)
367367
UseSem n ->
368368
if jsemSupported compiler
369-
then newSemaphoreJobControl n
369+
then newSemaphoreJobControl verbosity n
370370
else do
371371
warn verbosity "-jsem is not supported by the selected compiler, falling back to normal parallelism control."
372372
newParallelJobControl n

0 commit comments

Comments
 (0)