remove "rerun with --parallelBuild:1" message and show error inline
This commit is contained in:
parent
9f33baf51b
commit
ded5753292
1 changed files with 13 additions and 12 deletions
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
import
|
import
|
||||||
lists, ropes, os, strutils, osproc, platform, condsyms, options, msgs,
|
lists, ropes, os, strutils, osproc, platform, condsyms, options, msgs,
|
||||||
securehash
|
securehash, streams
|
||||||
|
|
||||||
type
|
type
|
||||||
TSystemCC* = enum
|
TSystemCC* = enum
|
||||||
|
|
@ -672,6 +672,12 @@ proc callCCompiler*(projectfile: string) =
|
||||||
var prettyCmds: TStringSeq = @[]
|
var prettyCmds: TStringSeq = @[]
|
||||||
let prettyCb = proc (idx: int) =
|
let prettyCb = proc (idx: int) =
|
||||||
echo prettyCmds[idx]
|
echo prettyCmds[idx]
|
||||||
|
let runCb = proc (idx: int, p: Process) =
|
||||||
|
let exitCode = p.peekExitCode
|
||||||
|
if exitCode != 0:
|
||||||
|
echo p.outputStream.readAll
|
||||||
|
rawMessage(errGenerated, "execution of an external compiler program '" &
|
||||||
|
cmds[idx] & "' failed with exit code: " & $exitCode)
|
||||||
compileCFile(toCompile, script, cmds, prettyCmds, false)
|
compileCFile(toCompile, script, cmds, prettyCmds, false)
|
||||||
compileCFile(externalToCompile, script, cmds, prettyCmds, true)
|
compileCFile(externalToCompile, script, cmds, prettyCmds, true)
|
||||||
if optCompileOnly notin gGlobalOptions:
|
if optCompileOnly notin gGlobalOptions:
|
||||||
|
|
@ -682,22 +688,17 @@ proc callCCompiler*(projectfile: string) =
|
||||||
res = execWithEcho(cmds[i])
|
res = execWithEcho(cmds[i])
|
||||||
if res != 0: rawMessage(errExecutionOfProgramFailed, cmds[i])
|
if res != 0: rawMessage(errExecutionOfProgramFailed, cmds[i])
|
||||||
elif optListCmd in gGlobalOptions or gVerbosity > 1:
|
elif optListCmd in gGlobalOptions or gVerbosity > 1:
|
||||||
res = execProcesses(cmds, {poEchoCmd, poUsePath, poParentStreams},
|
res = execProcesses(cmds, {poEchoCmd, poStdErrToStdOut, poUsePath, poParentStreams},
|
||||||
gNumberOfProcessors)
|
gNumberOfProcessors, afterRunEvent=runCb)
|
||||||
elif gVerbosity == 1:
|
elif gVerbosity == 1:
|
||||||
res = execProcesses(cmds, {poUsePath, poParentStreams},
|
res = execProcesses(cmds, {poStdErrToStdOut, poUsePath, poParentStreams},
|
||||||
gNumberOfProcessors, prettyCb)
|
gNumberOfProcessors, prettyCb, afterRunEvent=runCb)
|
||||||
else:
|
else:
|
||||||
res = execProcesses(cmds, {poUsePath, poParentStreams},
|
res = execProcesses(cmds, {poStdErrToStdOut, poUsePath, poParentStreams},
|
||||||
gNumberOfProcessors)
|
gNumberOfProcessors, afterRunEvent=runCb)
|
||||||
if res != 0:
|
if res != 0:
|
||||||
if gNumberOfProcessors <= 1:
|
if gNumberOfProcessors <= 1:
|
||||||
rawMessage(errExecutionOfProgramFailed, cmds.join())
|
rawMessage(errExecutionOfProgramFailed, cmds.join())
|
||||||
else:
|
|
||||||
rawMessage(errGenerated,
|
|
||||||
" execution of an external compiler program failed: " &
|
|
||||||
cmds.join() & "; " &
|
|
||||||
"rerun with --parallelBuild:1 to see the error message")
|
|
||||||
if optNoLinking notin gGlobalOptions:
|
if optNoLinking notin gGlobalOptions:
|
||||||
# call the linker:
|
# call the linker:
|
||||||
var it = PStrEntry(toLink.head)
|
var it = PStrEntry(toLink.head)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue