Raku / rakubrew.org

rakubrew.org website
https://rakubrew.org/
Artistic License 2.0
8 stars 5 forks source link

Installation Instructions: `bash` vs `sh` #6

Closed adamsmd closed 4 years ago

adamsmd commented 4 years ago

I am not sure whether this issue should be filed against Raku/rakudobrew.org or Raku/App-Rakubrew so let me know if this is the wrong place.

Problem

The current installation instructions say to run the following command:

curl https://rakubrew.org/install-on-perl.sh | sh

However, this results in the following error:

sh: 4: set: Illegal option -o pipefail

Cause

While on many systems sh is bash, on Ubuntu, by default, sh is dash not bash. Since install-on-perl.sh uses set -o pipefail, which is a bash-ism, this fails when run under dash.

Possible solutions

Either (1) remove all bash-isms from install-on-perl.sh or (2) update the installation instructions to say to use bash instead of sh.

I recommend option (2) in case there are other bash-isms or bash-isms creap into install-on-perl.sh.

patrickbkr commented 4 years ago

@adamsmd Thanks for the report! I decided to try getting the script sh-sane. I want to keep the dependencies for rakubrew as low as possibe (I'd like to keep rakubrew working in a restricted busybox environment with only perl installed).

I'll see if I can get CodeFactor to run shellcheck on those scripts. That should help at least a little with respect to bash-ism creap.

patrickbkr commented 4 years ago

CodeFactor is deployed and configured to check for hidden bash-isms in the scripts. The checker is not perfect, but a good help nonetheless.

rbt commented 4 years ago

I got this too following directions on https://rakubrew.org/:

$ curl https://rakubrew.org/install-on-perl.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1396  100  1396    0     0  15511      0 --:--:-- --:--:-- --:--:-- 15511
sh: 4: set: Illegal option -o pipefail
patrickbkr commented 4 years ago

@rbt This was fixed back in may but isn't deployed yet because the deployment routine is suboptimal. I'm in the process of working out a a way to deploy that doesn't cause delays measured in weeks.