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

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

 



On 3/12/20 3:53 PM, Zack Weinberg wrote:


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
$as_echo in _AS_DETECT_BETTER_SHELL, causing _AS_DETECT_BETTER_SHELL
*not to work at all*!

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
configure.ac's and it *is* 30% faster than bash (on my computer,
according to "time make check"), but not supporting $LINENO is a big
loss.

Here's a thought - now that we know that bash 5 has a severe bug where the presence of a file named '%sn' in the current working directory causes ./configure to fail (for any configure that uses $as-echo), should we teach _AS_DETECT_BETTER_SHELL to catch that bash bug and prefer dash (even with no LINENO support) over bash in that scenario?

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org





[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux