-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
In build.cc, Ninja checks if the subprocess succeeded or failed
// Print the command that is spewing before printing its output.
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");
}
But by this point in the build, Ninja has already discarded the actual exit value from the subprocess.
There are a variety of tools that don't print anything to the console when they fail to run, relying on the user to instead check the exit status to see what the reason for failure was.
This is especially problematic for third party tools where the source code is not available.
It's, of course, possible to get the exit status printed to the console using a wrapper script, but as discussed at extreme length, wrapper scripts are desired by basically no one.
Ninja should print the exit status of failing subprocesses.
reynoldsbd, jonatino, Fastering18, orenbenkiki, ArsenArsen and 2 more