summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2015-09-27 14:18:03 +0100
committerDominik Picheta <dominikpicheta@googlemail.com>2015-09-27 14:18:03 +0100
commitbb7604c06fb2adc6999d47fdfcbf9cf2979bef9e (patch)
treef4c1588419a66d531e80a99231d71343dbd950bc /compiler
parent0370dff8e07698228f56c02b05687321e04be402 (diff)
downloadNim-bb7604c06fb2adc6999d47fdfcbf9cf2979bef9e.tar.gz
Improved "Execution of an external program failed" message.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/extccomp.nim10
-rw-r--r--compiler/msgs.nim2
2 files changed, 7 insertions, 5 deletions
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",