Subject: Re: make -j and failure modes
To: Robert Elz <kre@munnari.OZ.AU>
From: Simon J. Gerraty <sjg@crufty.net>
List: tech-userlevel
Date: 12/10/2003 15:56:29
>It is absurd to require the shell to look inside the commands run by the
>sub-shell and see if they're the kind that should cause "set -e" mode to
>cause the shell to exit - but not doing so would mean the parent shell exiting
>if the sub-shell exits with an error code, even though that error code didn't
>actually cause the sub-shell to exit 1 because of the -e.
Ok, I buy your argument that our shell is correct.
> | If we really can't trust ourselves,
> | nbmake could always add "|| exit $?" to every command it passes to the
> | shell, hence avoiding the need to trust "sh -e" at all.
If the shell is correct, then the makefiles should be fixed.
Make should not attempt to edit the scripts in the above manner - as it
is likely to get it wrong as often as not.
>The suggestion to replace the '&&' with ';' is fairly interesting, relying
>upon the -e to abort the 2nd command if the first fails - except that relies
This one worries me however, as I've found many builds over the years with
scripts like
cd xxx; yyyy
to blow up because they did yyy even though cd xxx failed. So perhaps
-e cannot be relied on on all systems.
--sjg