Skip to content

Commit

Permalink
Fix rendering of -j option in multi-repl
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mpickering authored and Mikolaj committed Jun 2, 2024
1 parent 539cb7b commit c3708d2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cabal-install/src/Distribution/Client/CmdRepl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ import Distribution.Types.Library
( Library (..)
, emptyLibrary
)
import Distribution.Types.ParStrat
import Distribution.Types.Version
( Version
, mkVersion
Expand Down Expand Up @@ -467,6 +468,10 @@ replAction flags@NixStyleFlags{extraFlags = r@ReplFlags{..}, ..} targetStrings g
in -- GHC considers the last unit passed to be the active one
other_units ++ active_unit_files

render_j Serial = "1"
render_j (UseSem n) = show @Int n
render_j (NumJobs mn) = maybe "" (show @Int) mn

-- run ghc --interactive with
runProgramInvocation verbosity $
programInvocation ghcProg' $
Expand All @@ -475,7 +480,7 @@ replAction flags@NixStyleFlags{extraFlags = r@ReplFlags{..}, ..} targetStrings g
, "-package-env"
, "-" -- to ignore ghc.environment.* files
, "-j"
, show (buildSettingNumJobs (buildSettings ctx))
, render_j (buildSettingNumJobs (buildSettings ctx))
]
: [ ["-unit", "@" ++ dir </> unit]
| unit <- unit_files_ordered
Expand Down

0 comments on commit c3708d2

Please sign in to comment.