Making bash a formal requirement for build-infra?

Kelly O'Hair kelly.ohair at oracle.com
Wed Sep 19 11:15:12 PDT 2012


I have no problem standardizing on bash, but I suspect we need to continue with the convention of a .sh file suffix
for shell scripts, even if they say "#!/bin/bash", it's not like we can have executable *.sh files in the repos anyway.

As far as I know, all the Solaris systems should all have bash at /bin/bash
however, each OS and revision has differing versions of bash, anything from 3.0 to 4.2+

-kto

On Sep 19, 2012, at 4:57 AM, Magnus Ihse Bursie wrote:

> I was thinking of making bash a formal requirement for build-infra. In practice, this means that we should check if bash is present in configure, and fail directly otherwise.
> 
> Right now, I believe we have several "bash-isms" as it is already, but we try to execute with whatever shell we have, and we'll just get weird and hard-to-debug failures. The autoconf framework will, as it first action, go and look for bash, and run the generated configure script using bash, if that is available (regardless of what shell was used to start the configure script). Therefore we are unlikely to notice any bash-isms during development of build-infra.
> 
> I believe that we can count on bash being installed on all platforms we support, with the possible exception of Solaris systems -- I don't know how common it is to have bash there. On linux, cygwin and macosx I think it's ubiquitous.
> 
> If we choose *not* to require bash, then we really must start testing our scripts with other shells. Since autoconf will autodetect bash if present, that means setting up a machine where there is no bash installed (the horror! :-)).
> 
> If we conclude that we want to have bash as a formal requirement, that would mean that we can write much easier shell code, mostly in the configure script but possible also in the makefiles.
> 
> Any thoughts on this?
> 
> /Magnus




More information about the build-infra-dev mailing list