Merge pull request #1033 from colincross/failed
authorNico Weber <nicolasweber@gmx.de>
Wed, 3 Feb 2016 21:11:28 +0000 (16:11 -0500)
committerNico Weber <nicolasweber@gmx.de>
Wed, 3 Feb 2016 21:11:28 +0000 (16:11 -0500)
Print output file on failure

src/build.cc

index 45d3f32..e33a007 100644 (file)
@@ -126,8 +126,15 @@ void BuildStatus::BuildEdgeFinished(Edge* edge,
     PrintStatus(edge);
 
   // Print the command that is spewing before printing its output.
-  if (!success)
-    printer_.PrintOnNewLine("FAILED: " + edge->EvaluateCommand() + "\n");
+  if (!success) {
+    string outputs;
+    for (vector<Node*>::const_iterator o = edge->outputs_.begin();
+         o != edge->outputs_.end(); ++o)
+      outputs += (*o)->path() + " ";
+
+    printer_.PrintOnNewLine("FAILED: " + outputs + "\n");
+    printer_.PrintOnNewLine(edge->EvaluateCommand() + "\n");
+  }
 
   if (!output.empty()) {
     // ninja sets stdout and stderr of subprocesses to a pipe, to be able to