The autotools build system typically relies on an insane amount of invocations of /bin/sh during the ./configure phase.
Each of these invocations take some fixed amount of startup time, even if the various available bash interpreters run shell code roughly as fast as each other once the startup time is not taken into account.
gettext in particular is so bad, that the actual setup phase that runs multiple ./configure scripts takes longer to run than the actual build phase.
To alleviate this, one route we could go is to ensure that every single ./configure test driven /bin/sh invocation starts dash in stead of bash.
Previously, when we were still using dash for everything during builds, we observed a difference of +20% time elapsed in dash's favour for the exact same build between using dash and bash.
Conversely, bash is much more ergonomic to use than dash. It is also trivial to exchange the user-facing shebangs in boulder to explicitly use bash, thus increasing the amount of shell usability features available to packagers drastically, compared to if we were just using dash as /bin/sh always, including in recipes.
Hence, the idea would be that autotools build systems use dash as /bin/sh by default, but that we can optionally call back to *_with_bash build action macros that instead ensure that /bin/sh points to bash for the few packages that need this to build.
Current Status:
- Boulder explicitly uses
#!/usr/bin/bash shebang for all build phases.
- The /usr/bin/sh symlink is now owned by /usr/bin/dash
- The dash build explicitly takes /usr/bin/sh symlink ownership during its own build
- The bash build explicitly takes /usr/bin/sh symlink ownership during its own build
- We have added
%*_with_bash macros that will explicitly execute autotools scripts with bash (suggested by @ReillyBrogan and appears to work well)
The autotools build system typically relies on an insane amount of invocations of /bin/sh during the ./configure phase.
Each of these invocations take some fixed amount of startup time, even if the various available bash interpreters run shell code roughly as fast as each other once the startup time is not taken into account.
gettextin particular is so bad, that the actual setup phase that runs multiple ./configure scripts takes longer to run than the actual build phase.To alleviate this, one route we could go is to ensure that every single ./configure test driven /bin/sh invocation starts dash in stead of bash.
Previously, when we were still using dash for everything during builds, we observed a difference of +20% time elapsed in dash's favour for the exact same build between using dash and bash.
Conversely, bash is much more ergonomic to use than dash. It is also trivial to exchange the user-facing shebangs in boulder to explicitly use bash, thus increasing the amount of shell usability features available to packagers drastically, compared to if we were just using dash as /bin/sh always, including in recipes.
Hence, the idea would be that autotools build systems use dash as /bin/sh by default, but that we can optionally call back to *_with_bash build action macros that instead ensure that /bin/sh points to bash for the few packages that need this to build.
Current Status:
#!/usr/bin/bashshebang for all build phases.%*_with_bash macrosthat will explicitly execute autotools scripts with bash (suggested by @ReillyBrogan and appears to work well)