summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-05-31 16:59:03 -0400
committerBen Gamari <ben@smart-cactus.org>2020-05-31 16:59:03 -0400
commit0c7901615e2d2a68703d3df183448de9d7d35861 (patch)
tree7948827e3c57fe20b00c2f07bbf38b6667262ad8
parent58fad7d43479766f3a66dd1ef9cc4edbe84ff372 (diff)
downloadhaskell-wip/T18274.tar.gz
compiler: Disable use of process jobs with process < 1.6.9wip/T18274
Due to #17926.
-rw-r--r--compiler/GHC/SysTools/Process.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/GHC/SysTools/Process.hs b/compiler/GHC/SysTools/Process.hs
index a7649ed534..4f11a29ea1 100644
--- a/compiler/GHC/SysTools/Process.hs
+++ b/compiler/GHC/SysTools/Process.hs
@@ -33,13 +33,17 @@ import System.Process
import GHC.SysTools.FileCleanup
-- | Enable process jobs support on Windows if it can be expected to work (e.g.
--- @process >= 1.6.8.0@).
+-- @process >= 1.6.9.0@).
enableProcessJobs :: CreateProcess -> CreateProcess
#if defined(MIN_VERSION_process)
+#if MIN_VERSION_process(1,6,9)
enableProcessJobs opts = opts { use_process_jobs = True }
#else
enableProcessJobs opts = opts
#endif
+#else
+enableProcessJobs opts = opts
+#endif
-- Similar to System.Process.readCreateProcessWithExitCode, but stderr is
-- inherited from the parent process, and output to stderr is not captured.
@@ -48,7 +52,7 @@ readCreateProcessWithExitCode'
-> IO (ExitCode, String) -- ^ stdout
readCreateProcessWithExitCode' proc = do
(_, Just outh, _, pid) <-
- createProcess proc{ std_out = CreatePipe }
+ createProcess $ enableProcessJobs $ proc{ std_out = CreatePipe }
-- fork off a thread to start consuming the output
output <- hGetContents outh
@@ -77,7 +81,7 @@ readProcessEnvWithExitCode
-> IO (ExitCode, String, String) -- ^ (exit_code, stdout, stderr)
readProcessEnvWithExitCode prog args env_update = do
current_env <- getEnvironment
- readCreateProcessWithExitCode (enableProcessJobs $ proc prog args) {
+ readCreateProcessWithExitCode (proc prog args) {
env = Just (replaceVar env_update current_env) } ""
-- Don't let gcc localize version info string, #8825