[Rcpp-devel] Rcpp Armadillo's configure script's hashbang

Zé Loff zeloff+rcpp at zeloff.org
Sat Feb 28 22:11:02 CET 2015

On Sat, Feb 28, 2015 at 01:55:43PM -0600, Dirk Eddelbuettel wrote:
> On 28 February 2015 at 19:34, Ze Loff wrote:
> | 
> | Hi
> | 
> | Can #!/bin/bash be replaced by something more portable (e.g. #!/bin/sh)
> | on the configure script? Since I don't think that there are any
> | bash-isms on the configure script, and that most UNIX-like OS have
> | either some version of the Bourne Shell or link /bin/sh to a compatible
> | shell (e.g. OS X hardlinks /bin/sh to /bin/bash), I believe switching to
> | #!/bin/sh would improve portability.
> | 
> | (In my case, installation of RcppArmadillo failed on OpenBSD since I
> | don't have bash installed, but it installed fine from source after
> | changing to #!/bin/sh)
> That is rather unlikely as I explained here 
>    https://github.com/RcppCore/RcppArmadillo/pull/35
> when rejecting that PR. Which came unannounced and undiscussed, which
> is generally a bad idea; always preferable to file an issue ticket
> fist, or discuss here as you did.

Sorry for not noticing this first and (thus) for asking a (somewhat)
already answered question.
> Changing this creates extra work for me as I need to clean the shell
> script of things bash has for free.  I happen to like bash as a basic
> shell.

If I save you the trouble of cleaning the script, would you consider it?

> If your system is large enough to have room for R and extra packages,
> I'd argue that it should have room for bash too: per the respective
> Debian/Ubuntu packages size, bash is actually smaller than
> RcppArmadillo.  And if you really can't then you can always locally
> patch the tarball.

It's not a matter of space, its first of all a matter of principle
(installing a new shell interpreter because of a 19 lines long configure
script on an R package, really?), second a matter of improving
portability (and I have seen by now I am hardly the first to come up
with this problem) and third (although hardly) a matter of security (I
could live without having to worry about the security holes in another
shell interpreter).

Also, on github's issue #15 you mention "side-effects with other CRAN
installations". Does this mean that there is something about CRAN that
mandates using bash?

In a nutshell, if using bash its just a matter of convenience or it not
being worth the trouble of rewriting the script -- and please don't take
this the wrong way, I deeply respect your right to prefer bash and
having more useful things do to with your time than fixing this -- I'll
be glad to take that work off your hands. If there are unavoidable
'technical' issues with other shell interpreters that make bash a strict
requirement, I'll glady drop the issue and go back to patching.

All the best

> At some point this test will go away and we'll just assume a good
> enough LAPACK.
> Dirk
> -- 
> http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org

More information about the Rcpp-devel mailing list