From bb7604c06fb2adc6999d47fdfcbf9cf2979bef9e Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Sun, 27 Sep 2015 14:18:03 +0100 Subject: Improved "Execution of an external program failed" message. --- compiler/extccomp.nim | 10 ++++++---- compiler/msgs.nim | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'compiler') diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim index 02198d06e..29aa03c94 100644 --- a/compiler/extccomp.nim +++ b/compiler/extccomp.nim @@ -474,7 +474,7 @@ proc execWithEcho(cmd: string, msg = hintExecuting): int = proc execExternalProgram*(cmd: string, msg = hintExecuting) = if execWithEcho(cmd, msg) != 0: - rawMessage(errExecutionOfProgramFailed, "") + rawMessage(errExecutionOfProgramFailed, cmd) proc generateScript(projectFile: string, script: Rope) = let (dir, name, ext) = splitFile(projectFile) @@ -680,7 +680,7 @@ proc callCCompiler*(projectfile: string) = if gNumberOfProcessors <= 1: for i in countup(0, high(cmds)): res = execWithEcho(cmds[i]) - if res != 0: rawMessage(errExecutionOfProgramFailed, []) + if res != 0: rawMessage(errExecutionOfProgramFailed, cmds[i]) elif optListCmd in gGlobalOptions or gVerbosity > 1: res = execProcesses(cmds, {poEchoCmd, poUsePath, poParentStreams}, gNumberOfProcessors) @@ -692,9 +692,11 @@ proc callCCompiler*(projectfile: string) = gNumberOfProcessors) if res != 0: if gNumberOfProcessors <= 1: - rawMessage(errExecutionOfProgramFailed, []) + rawMessage(errExecutionOfProgramFailed, cmds.join()) else: - rawMessage(errGenerated, " execution of an external program failed; " & + rawMessage(errGenerated, + " execution of an external compiler program failed: " & + cmds.join() & "; " & "rerun with --parallelBuild:1 to see the error message") if optNoLinking notin gGlobalOptions: # call the linker: diff --git a/compiler/msgs.nim b/compiler/msgs.nim index c5bc44664..28f85ac00 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -203,7 +203,7 @@ const errUseQualifier: "ambiguous identifier: \'$1\' -- use a qualifier", errTypeExpected: "type expected", errSystemNeeds: "system module needs \'$1\'", - errExecutionOfProgramFailed: "execution of an external program failed", + errExecutionOfProgramFailed: "execution of an external program failed: '$1'", errNotOverloadable: "overloaded \'$1\' leads to ambiguous calls", errInvalidArgForX: "invalid argument for \'$1\'", errStmtHasNoEffect: "statement has no effect", -- cgit 1.4.1-2-gfad0