GNU bug report logs - #9245
FreeBSD make in concurrent mode report spurious success in automake-generated tests harness

Previous Next

Package: automake;

Reported by: Stefano Lattarini <stefano.lattarini <at> gmail.com>

Date: Fri, 5 Aug 2011 09:10:02 UTC

Severity: normal

Tags: patch

Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Blake <eblake <at> redhat.com>
To: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Cc: Autoconf <Autoconf <at> gnu.org>, 9245 <at> debbugs.gnu.org
Subject: bug#9245: FreeBSD make in concurrent mode report spurious success in	automake-generated tests harness
Date: Tue, 16 Aug 2011 10:18:51 -0600
On 08/16/2011 10:04 AM, Stefano Lattarini wrote:
> The "proper fix" is even easier BTW: just use "$$exit || exit 1" instead.
>
> The updated patch should now work (and I've tested it properly this time).
> This new patch hasn't been derived by "cargo-cult guessing", but from the
> explanation of the relevant FreeBSD make bug provided by Jilles Tjoelker:
>   <http://www.freebsd.org/cgi/query-pr.cgi?pr=159730>
>
> Now that's something to be documented in the Autoconf manual I'd say ...

Indeed.  So it all boils down to BSD make rewriting rules (but only for 
make -j) to be roughly:

sh -c 'set -v; your rules; set +v'

and losing your exit status (not to mention sharing shell status between 
commands that are supposed to be in independent shells), when it really 
should have been rewriting as something more complex:

sh -c '(your rule 1); (your rule 2); st=$?; set +v; exit $st'

And your workaround of an explicit exit rather than relying on $? at the 
end of your 'set +e' invocation is indeed the proper way to force the 
parallel make bug to be avoided, by exiting prior to any post-commands 
injected by the BSD make rewriting going on that corrupt $?.

-- 
Eric Blake   eblake <at> redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




This bug report was last modified 13 years and 336 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.