Skip to content
Snippets Groups Projects
Unverified Commit f323d296 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub
Browse files

Merge pull request #10055 from wismill/semaphore/verbosity

fix: Make newSemaphoreJobControl respect verbosity
parents 3a8c69cb 225d2b15
No related branches found
No related tags found
No related merge requests found
Pipeline #95805 passed
......@@ -45,7 +45,6 @@ import Control.Monad (forever, replicateM_)
import Distribution.Client.Compat.Semaphore
import Distribution.Compat.Stack
import Distribution.Simple.Utils
import Distribution.Verbosity
import System.Semaphore
-- | A simple concurrency abstraction. Jobs can be spawned and can complete
......@@ -171,13 +170,13 @@ readAllTChan qvar = go []
--
-- This uses the GHC -jsem option to allow GHC to take additional semaphore slots
-- if we are not using them all.
newSemaphoreJobControl :: WithCallStack (Int -> IO (JobControl IO a))
newSemaphoreJobControl n
newSemaphoreJobControl :: WithCallStack (Verbosity -> Int -> IO (JobControl IO a))
newSemaphoreJobControl _ n
| n < 1 || n > 1000 =
error $ "newParallelJobControl: not a sensible number of jobs: " ++ show n
newSemaphoreJobControl maxJobLimit = do
newSemaphoreJobControl verbosity maxJobLimit = do
sem <- freshSemaphore "cabal_semaphore" maxJobLimit
notice normal $
notice verbosity $
"Created semaphore called "
++ getSemaphoreName (semaphoreName sem)
++ " with "
......
......@@ -366,7 +366,7 @@ rebuildTargets
NumJobs n -> newParallelJobControl (fromMaybe numberOfProcessors n)
UseSem n ->
if jsemSupported compiler
then newSemaphoreJobControl n
then newSemaphoreJobControl verbosity n
else do
warn verbosity "-jsem is not supported by the selected compiler, falling back to normal parallelism control."
newParallelJobControl n
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment