-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ninja hides the exit status of failing subprocesses #1507
Comments
I don't see any "FAILED:" message, but instead Is it the same issue? @schultetwin1 Would #1805 address this situation too, and reveal the exit code of the failed subcommand? |
Thanks @schultetwin1. Indeed it seems the "subcommand failed" message is coming from Line 883 in 54959b0
The effect is the same however: an exit code that is lost, while it could have been printed. |
@jonesmz @jimis @schultetwin1 have you guys figured this out? My make file:
Error in github actions (it still thinks the build is successful):
|
@jonatino you have a clear indication of what's wrong in your case:
Please file separate issues for irrelevant problems. |
@jimis thats obvious. The problem is that github CI does not fail because that exit code is hidden because its a ninja subproces... which is exactly what this issue is reporting. |
@jonatino ninja exits with its own error code in case of failure. It is your bash script that hides that. Try adding |
I've been hit hard with this when ccache started |
I have set -e set, check for the exit status of ninja and return it, and yet my script continues on as if ninja's exit code were zero. I'm pretty sure this ticket is valid. |
I am trying to address it in #2540 |
In build.cc, Ninja checks if the subprocess succeeded or failed
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.
The text was updated successfully, but these errors were encountered: