Skip to content

Commit

Permalink
Default delegate_ctlc to True
Browse files Browse the repository at this point in the history
  • Loading branch information
robx committed Feb 22, 2022
1 parent a5986e3 commit f972102
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cabal/src/Distribution/Compat/Process.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ enableProcessJobs cp = cp
-- | 'System.Process.proc' with process jobs enabled when appropriate,
-- and defaulting 'delegate_ctlc' to 'True'.
proc :: FilePath -> [String] -> CreateProcess
proc path args = enableProcessJobs (Process.proc path args)
proc path args = enableProcessJobs (Process.proc path args) { Process.delegate_ctlc = True }

-- | 'System.Process.createProcess' with process jobs enabled when appropriate.
-- See 'enableProcessJobs'.
Expand All @@ -76,7 +76,7 @@ createProcess = Process.createProcess . enableProcessJobs
-- See 'enableProcessJobs'.
rawSystem :: FilePath -> [String] -> IO ExitCode
rawSystem path args = do
(_,_,_,p) <- Process.createProcess (proc path args) { Process.delegate_ctlc = True }
(_,_,_,p) <- Process.createProcess (proc path args)
Process.waitForProcess p

-- | 'System.Process.runInteractiveProcess' with process jobs enabled when
Expand Down
7 changes: 2 additions & 5 deletions Cabal/src/Distribution/Simple/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,7 @@ rawSystemExit verbosity path args = withFrozenCallStack $
--
rawSystemExitCode :: Verbosity -> FilePath -> [String] -> IO ExitCode
rawSystemExitCode verbosity path args = withFrozenCallStack $
rawSystemProc verbosity $
(proc path args) { Process.delegate_ctlc = True }
rawSystemProc verbosity $ proc path args

-- | Execute the given command with the given arguments, returning
-- the command's exit code.
Expand Down Expand Up @@ -834,7 +833,6 @@ rawSystemExitWithEnv :: Verbosity
rawSystemExitWithEnv verbosity path args env = withFrozenCallStack $
maybeExit $ rawSystemProc verbosity $
(proc path args) { Process.env = Just env
, Process.delegate_ctlc = True
}

-- | Execute the given command with the given arguments, returning
Expand Down Expand Up @@ -884,7 +882,6 @@ rawSystemIOWithEnvAndAction verbosity path args mcwd menv action inp out err = w
, Process.std_in = mbToStd inp
, Process.std_out = mbToStd out
, Process.std_err = mbToStd err
, Process.delegate_ctlc = True
}
rawSystemProcAction verbosity cp (\_ _ _ -> action)
where
Expand All @@ -909,7 +906,6 @@ createProcessWithEnv verbosity path args mcwd menv inp out err = withFrozenCallS
, Process.std_in = inp
, Process.std_out = out
, Process.std_err = err
, Process.delegate_ctlc = True
}
logCommand verbosity cp
Process.createProcess cp
Expand Down Expand Up @@ -950,6 +946,7 @@ rawSystemStdInOut verbosity path args mcwd menv input _ = withFrozenCallStack $
, Process.std_in = Process.CreatePipe
, Process.std_out = Process.CreatePipe
, Process.std_err = Process.CreatePipe
, Process.delegate_ctlc = False -- !!!
}

(exitcode, (mberr1, mberr2)) <- rawSystemProcAction verbosity cp $ \mb_in mb_out mb_err -> do
Expand Down

0 comments on commit f972102

Please sign in to comment.