Current-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: [ANALYSED] kernel object compilation failure unnoticed ?
On Fri, Mar 05, 2010 at 01:24:43PM -0500, Greg A. Woods wrote:
> The only problem I've had with both the elimination of "sh -e" and other
> trickery make uses to avoid using "sh" when possible is that this is all
> very confusing. It's hard sometimes even for an expert to understand
> the difference between a "complex shell" command and a simple one and to
> know intuitively when make will see a non-zero exit code from the rule
> and when it will not.
Not really. Once you remember that each separate line is passed as a
unit to sh -c, the rest follows from how the shell works.
The real complication is that in make -j mode, our make doesn't do
that but instead feeds stuff in blobs to the shell's stdin, so the
effects of operations like cd persist longer than one expects.
This behavior is definitely questionable...
> To eliminate all possibility of surprises it
> seems to me that the same result should happen regardless of whether
> make executes a multi-line script one line at a time or all at once
> through a single shell invocation:
> [snip]
Well no, because that's hard, thanks to the way the shell works... and
as I noted before, set -e doesn't help because POSIX screwed it up.
> FYI, one example of how confusing it can be to know when "sh" is used
> and when it is not, consider that NetBSD's "make" does not seem to know
> that "~" is a special shell character.
I suspect that's because historically sh doesn't do tilde-expansion.
If we're committed to doing so we should teach make accordingly.
--
David A. Holland
dholland%netbsd.org@localhost
Home |
Main Index |
Thread Index |
Old Index