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

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

 



On Fri, Mar 20, 2020 at 10:39 AM Eric Blake <eblake@xxxxxxxxxx> wrote:
> On 3/12/20 3:53 PM, Zack Weinberg wrote:
>
> > ... 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?

(I'm adding Ross Burton to the cc: list because he just posted a patch
which would cause _AS_DETECT_BETTER_SHELL to prefer a shell named
'bash' to one named 'sh', all else being equal, on performance
grounds.)

Given that Debian is _deliberately_ configuring dash without LINENO
support in order to work around configure scripts containing bashisms,
I think we should make changes in this area cautiously and with a lot
of public notice.  It's my personal opinion that we should push
configure-script authors in the direction of not using bash
extensions, maybe even at the expense of performance.

If I were writing the patches they would go something like this:
Change _AS_DETECT_BETTER_SHELL so that if there is more than one shell
that supports all of the "as_required" features, it prefers a shell
that doesn't set either BASH_VERSION or ZSH_VERSION, even if that one
doesn't support all of the "as_suggested" features.  However, if
CONFIG_SHELL is set and supports all of the "as_required" features, it
is used regardless.  Write in the release notes that we are
intentionally avoiding running configure scripts with bash or zsh, to
discourage people from using extensions in configure scripts, and that
if you encounter a configure script that won't work with /bin/sh you
can work around the problem by setting CONFIG_SHELL when you run
configure.  If possible, arrange to have that advice printed when the
shell bombs out on a syntax error (this appears to be possible using
'trap', at least for dash).

Also, I have near-term plans to ask Debian to do an archive rebuild
with LINENO turned back on in dash and find out how much stuff breaks.

zw




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

  Powered by Linux