summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorgenotrance <dev@genotrance.com>2020-02-20 16:04:48 -0600
committerGitHub <noreply@github.com>2020-02-20 23:04:48 +0100
commit7a2b623d2a160f2a9a9464a29a51a343dec303ec (patch)
tree25a5b5aba06ad0290251d5ad250b863e3744d2a3
parentbb777fef76057d594e48848693b7032b3b97068a (diff)
downloadNim-7a2b623d2a160f2a9a9464a29a51a343dec303ec.tar.gz
Fix #8648 - use parent streams to avoid hang (#13445)
-rw-r--r--compiler/extccomp.nim11
1 files changed, 5 insertions, 6 deletions
diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim
index e94cf87c2..7cc43d56e 100644
--- a/compiler/extccomp.nim
+++ b/compiler/extccomp.nim
@@ -555,7 +555,7 @@ proc getCompileOptions(conf: ConfigRef): string =
 proc vccplatform(conf: ConfigRef): string =
   # VCC specific but preferable over the config hacks people
   # had to do before, see #11306
-  if conf.cCompiler == ccVcc: 
+  if conf.cCompiler == ccVcc:
     let exe = getConfigVar(conf, conf.cCompiler, ".exe")
     if "vccexe.exe" == extractFilename(exe):
       result = case conf.target.targetCPU
@@ -845,8 +845,7 @@ proc execCmdsInParallel(conf: ConfigRef; cmds: seq[string]; prettyCb: proc (idx:
     let exitCode = p.peekExitCode
     if exitCode != 0:
       rawMessage(conf, errGenerated, "execution of an external compiler program '" &
-        cmds[idx] & "' failed with exit code: " & $exitCode & "\n\n" &
-        p.outputStream.readAll.strip)
+        cmds[idx] & "' failed with exit code: " & $exitCode & "\n\n")
   if conf.numberOfProcessors == 0: conf.numberOfProcessors = countProcessors()
   var res = 0
   if conf.numberOfProcessors <= 1:
@@ -859,13 +858,13 @@ proc execCmdsInParallel(conf: ConfigRef; cmds: seq[string]; prettyCb: proc (idx:
   else:
     tryExceptOSErrorMessage(conf, "invocation of external compiler program failed."):
       if optListCmd in conf.globalOptions or conf.verbosity > 1:
-        res = execProcesses(cmds, {poEchoCmd, poStdErrToStdOut, poUsePath},
+        res = execProcesses(cmds, {poEchoCmd, poStdErrToStdOut, poUsePath, poParentStreams},
                             conf.numberOfProcessors, afterRunEvent=runCb)
       elif conf.verbosity == 1:
-        res = execProcesses(cmds, {poStdErrToStdOut, poUsePath},
+        res = execProcesses(cmds, {poStdErrToStdOut, poUsePath, poParentStreams},
                             conf.numberOfProcessors, prettyCb, afterRunEvent=runCb)
       else:
-        res = execProcesses(cmds, {poStdErrToStdOut, poUsePath},
+        res = execProcesses(cmds, {poStdErrToStdOut, poUsePath, poParentStreams},
                             conf.numberOfProcessors, afterRunEvent=runCb)
   if res != 0:
     if conf.numberOfProcessors <= 1: