-
Notifications
You must be signed in to change notification settings - Fork 29
On errors let make return with non-zero exitvalue #119
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
Conversation
This fixes gridcf#118 There are probably a few other places where we should bail out with a non-zero exit value.
Since we join the lines via && \ we should only keep the first at sign.
Since make automatically returns to the top_srcdir after running, we should not combine the mkdir and cp with it.
|
@msalle , @matyasselmeci : If there isn't a switch for our case, let's pull these changes. |
|
I'm confused. Exiting when a command returns nonzero is the default behavior for make. I see why the |
|
Also, you can add then the line will fail if the |
|
What I understood was, that even if a recipe line exits with !0, that does not mean, that And the patches should make sure that |
|
If you're running parallel make ( |
Ok, that could explain why it doesn't stop right away. #118 explicitly mentions the use of
So @msalle's patches won't change that behaviour for parallel make runs? |
|
I wouldn't recommend parallel make for make install. make install is I/O bound anyway (since it's mostly file system operations), so adding And yes, @msalle's patches won't help that case. I think keeping the |
|
Hi, |
|
Well it works for getting a nonzero error code, but it doesn't interrupt the make. I ran some tests on my laptop (Fedora 31, make 4.2.1). Here's my Makefile ( .PHONY: all error ok
all: error ok
error:
exit 1
ok:
sleep 5
echo okand here's what happens if I run it: |
|
Sure, it won't kill the running parallel jobs (see also https://www.gnu.org/software/make/manual/html_node/Parallel.html), but I think it is useful if at least the outer make process exit with a non-zero exit value if one of its child parallel jobs have failed? |
It already does: the exit status is 2. |
|
Hmm, you have a point there. I'm not sure what originally went wrong, but I agree it's probably indeed not necessary. Perhaps I got confused with the |
This fixes #118
There are probably a few other places where we should bail out with a non-zero
exit value but this certainly fixes the main ones.