Skip to content

Commit c3708d2

Browse files
mpickeringMikolaj
authored andcommitted
Fix rendering of -j option in multi-repl
Before this was rendered as.. ``` /run/current-system/sw/bin/ghc --interactive -package-env - -j 'NumJobs (Just 8)' ... ``` Due to this place not being updated when support for semaphores was added.
1 parent 539cb7b commit c3708d2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ import Distribution.Types.Library
139139
( Library (..)
140140
, emptyLibrary
141141
)
142+
import Distribution.Types.ParStrat
142143
import Distribution.Types.Version
143144
( Version
144145
, mkVersion
@@ -467,6 +468,10 @@ replAction flags@NixStyleFlags{extraFlags = r@ReplFlags{..}, ..} targetStrings g
467468
in -- GHC considers the last unit passed to be the active one
468469
other_units ++ active_unit_files
469470

471+
render_j Serial = "1"
472+
render_j (UseSem n) = show @Int n
473+
render_j (NumJobs mn) = maybe "" (show @Int) mn
474+
470475
-- run ghc --interactive with
471476
runProgramInvocation verbosity $
472477
programInvocation ghcProg' $
@@ -475,7 +480,7 @@ replAction flags@NixStyleFlags{extraFlags = r@ReplFlags{..}, ..} targetStrings g
475480
, "-package-env"
476481
, "-" -- to ignore ghc.environment.* files
477482
, "-j"
478-
, show (buildSettingNumJobs (buildSettings ctx))
483+
, render_j (buildSettingNumJobs (buildSettings ctx))
479484
]
480485
: [ ["-unit", "@" ++ dir </> unit]
481486
| unit <- unit_files_ordered

0 commit comments

Comments
 (0)