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 committed May 30, 2024
1 parent 7097104 commit 1c0593d
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 @@ -147,6 +147,7 @@ import Distribution.Types.VersionRange
( anyVersion
, orLaterVersion
)
import Distribution.Types.ParStrat
import Distribution.Utils.Generic
( safeHead
)
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 1c0593d

Please sign in to comment.