New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix: Replace bashisms with standard sh to fix build on non-BASH systems #5038
Conversation
ACK in principle. As you said on IRC, I'd like to have travis testing for this. Shouldn't be too hard to spawn in a new shell and export a few things as needed. One request though.. please split into 3 commits: build/tests/gitian, that way we can backport more easily if needed. |
Split |
In case it's non-obvious to anyone reading after-the-fact: This PR adds fixes for shell-scripts that needlessly used bashisms. There was previously no test for these. #5040 introduced a test, and the build failed as expected. This PR fixes the scripts and adds the test from #5040. The fact that it's green means that they're confirmed fixed. ACK. |
utACK. |
Not meaning to depreciate this pull, but is there really no modern non-bash alternative to uglyness like
I remember, from maybe 20 years ago, that constructions like that were used for compatibility with some shell from the 80's. Hasn't really anything changed on that front? |
@laanwj I'm pretty sure if test "$use_pkgconfig" = ""; then is fine in most shells, but when the entire purpose of a configure script is portability, it makes sense to use the most portable code. |
It's just so stupid to have to add a dummy string to do a string comparison, as if it's some amazing new thing. In other places we also have limits on how far we go back with regard to compatibility. Anyhow, I was just asking. For anything worthwhile (that is actually meant to be reviewed) we should be using Python, not shellscript. utACK. |
0b17964 Bugfix: Replace bashisms with standard sh in tests/tools (Luke Dashjr) ab72068 Bugfix: Replace bashisms with standard sh in gitian descriptors (Luke Dashjr) b77b4ed Bugfix: Replace bashisms with standard sh to fix build on non-BASH systems (Luke Dashjr) d6b0539 travis: add non-default shell testing to travis. (Cory Fields)
Um, why did we make the changes within the gitian build scripts? Those, by definition, run on Ubuntu 12.04, and with bash, unless I'm missing something. I just checked gitian's source, and the build script has a hard-coded |
Better to use standards? |
It just seems weird to me to make it ugly in the name of compatibility/reducing bashisms, in a script that will only ever be run by bash. |
@Michagogo Agreed. Wouldn't have been needed for the gitian descriptors as it forces bash. It's just the basic build system that needs to be compatible between shells. @theuni We could revert this with #4727, which completely overhauls the gitian descriptors anyway. |
Yea, all of the above is fine by me. I didn't argue it because they should be obsoleted soon anyway, as you said. |
Note: I have not actually tested this on a non-BASH system yet.
Downstream Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=524332