On Thu, Mar 12, 2020 at 12:12 PM Bob Friesenhahn <bfriesen@xxxxxxxxxxxxxxxxxxx> wrote: > On Thu, 12 Mar 2020, Zack Weinberg wrote: > > > > does not, assuming the stock `autoreconf` is from Autoconf 2.69. > > This is because `make check` in this sequence re-runs configure > > via `config.status --recheck`, which doesn’t recalculate *everything*. > > In particular, the value of @SHELL@ will remain at whatever the first > > run of ./configure picked. @SHELL@ controls which shell is used to > > run tests/testsuite from `make check`. And, on a system where /bin/sh > > is dash (and /bin/bash also exists), autoconf 2.69’s > > `_AS_DETECT_BETTER_SHELL` picks /bin/bash for @SHELL@, > > but autoconf trunk’s `_AS_DETECT_BETTER_SHELL` picks /bin/sh. > > It would be useful if Autoconf does not require bash. If it requires > bash and can not work with a reasonably POSIX-conformant shell > (perhaps even ash/dash, bosh, or ksh), then there is a problem. The > automatic use of bash is a crutch which may be hiding problems. 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 $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. zw