[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: M4sh tests 77 and 78 vs /bin/sh -> dash

From: Bob Friesenhahn
Subject: Re: M4sh tests 77 and 78 vs /bin/sh -> dash
Date: Thu, 12 Mar 2020 16:04:36 -0500 (CDT)
User-agent: Alpine 2.20 (GSO 67 2015-01-07)

On Thu, 12 Mar 2020, Zack Weinberg wrote:

I agree in principle.

On further investigation, there is a concrete reason why autoconf 2.69
prefers SHELL=/bin/bash to SHELL=/bin/dash, namely that dash doesn't
support $LINENO, necessitating a complicated and fragile workaround
(see _AS_LINENO_PREPARE in lib/m4sugar/m4sh.m4).  This has been the
behavior for a very long time (since roughly 2008).  Moreover, the
changed behavior of autoconf trunk was not intentional; it's because
commit 2b59b6f8a79b8bf77e178ff4e5aa0ede433d39cf missed a direct use of
*not to work at all*!

This is a good find.  It explains a lot.

I'm still looking into why tests/testsuite malfunctions when run by
dash, but right now I am inclined to say that the bug in
_AS_DETECT_BETTER_SHELL should be fixed and then we should
independently discuss whether it makes sense to prefer dash to bash.
It *would* discourage people from writing bashisms in their's and it *is* 30% faster than bash (on my computer,
according to "time make check"), but not supporting $LINENO is a big

Years ago when we were investigating slowness of configure it was determined that Bash is the "world's slowest shell" since it was considerably slower than all other shells tested. The difference was often more significant outside of GNU/Linux. This likely has not changed.

One reason why some projects are discarding use of Autoconf (and moving to CMake and Meson/Ninja) is due to how long it takes to execute a configure script. Given modern multicore CPUs, it often takes as much (or more) time to run the configure script than to compile the software. If configure can select the fastest shell which works reliably, then Autoconf's reputation will improve.

Bob Friesenhahn
GraphicsMagick Maintainer,
Public Key,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]