[Top][All Lists]

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

Re: How to change the shebang in 'configure' to require Bash

From: R. Diez
Subject: Re: How to change the shebang in 'configure' to require Bash
Date: Tue, 20 Mar 2018 11:07:49 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

I saw in the recent Automake release notes that there’s a tentative plan that
Autoconf 2.0 will require at least a POSIX shell.

Herr Diez, is this close enough to “Bash” to suit your purposes?
That is, are you just looking for things like $() instead of ``, > or are you 
intending to commit outright bash-isms?

First of all, thanks for your answer.

I know that Autoconf developers want to write extremely portable scripts. But that is a huge barrier for somebody like me. I am a user, not a shell expert.

I have heard that the POSIX standard, or maybe its implementation, is not exactly the same across all shells. There are subtle differences.

The generated 'configure' script changes shells on start-up. The logic is not documented. I looked inside, and it was not immediately obvious on what grounds some shells are preferred. Depending on what is installed, I seems possible that zsh is taken, for example.

I am unwilling to test my on several shells. Furthermore, the features in the POSIX standard are very limited. I am using arrays and regular expressions, for example. An my scripts are not really that complex.

In any case, the behaviour of my script cannot depend on what shells the end-user has currently installed. I do not know of any shell linters like ShellCheck that accept files.

I would be very happy if my software ran on 10 % of the platforms where Bash is installed by default. Therefore, demanding Bash is for me the best solution.

In fact, it is the only sane solution. Not even hard-core Autoconf developers should take such risks. My guess is that Autoconf-generated 'configure' scripts usually work because they tend to switch to Bash on start-up.

Even if you really wanted, there is no way to properly test your scripts. Autoconf requires a Bourne shell, but exactly what is required, is not documented. There is no guide as to what shells and shell versions you should be testing against.

Autoconf works because most bugs have been reported and fixed over many years. But trying to change the shell requirement now is probably a big nightmare.

Requiring a POSIX shell in the next version is an improvement, but POSIX is too limiting to really help. It is 2018. No wonder so many people want to ditch Autoconf!

Best regards,
  R. Diez

reply via email to

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