Ray: format.sh script returns illegal option -o pipefail

Created on 2 Jul 2019  路  3Comments  路  Source: ray-project/ray

System information

  • Ubuntu 19.04
  • Ray installed from (source or binary): Source
  • Ray version: Master branch
  • Python version: 3.7.3
  • Exact command to reproduce: sh scripts/format.sh

Describe the problem

When trying to run sh scripts/format.sh receive an error:

Received an error trying to run it: 6: set: Illegal option -o pipefail

I could not diagnose the problem as shell is not my forte, but recommend you look into it as other contributors may suffer from the same problem. Removing the option led to a builtin not found complaint.

Most helpful comment

Sorry I should be more clear. Ubuntu sh is linked to dash not bash. pipefail is a bash utility.

ubuntu@ip-172-31-23-126:~$ cat /etc/os-release | grep VERSION
VERSION="19.04 (Disco Dingo)"
VERSION_ID="19.04"
VERSION_CODENAME=disco
ubuntu@ip-172-31-23-126:~$ cat test.sh
set -eo pipefail
echo "done"
ubuntu@ip-172-31-23-126:~$ bash test.sh
done
ubuntu@ip-172-31-23-126:~$ sh test.sh
test.sh: 1: set: Illegal option -o pipefail

All 3 comments

bash scripts/format.sh should work.

Sorry I should be more clear. Ubuntu sh is linked to dash not bash. pipefail is a bash utility.

ubuntu@ip-172-31-23-126:~$ cat /etc/os-release | grep VERSION
VERSION="19.04 (Disco Dingo)"
VERSION_ID="19.04"
VERSION_CODENAME=disco
ubuntu@ip-172-31-23-126:~$ cat test.sh
set -eo pipefail
echo "done"
ubuntu@ip-172-31-23-126:~$ bash test.sh
done
ubuntu@ip-172-31-23-126:~$ sh test.sh
test.sh: 1: set: Illegal option -o pipefail

Worked, closing. Perhaps the default "I have run scripts/format.sh" on PR should be updated to say "use bash not sh".

Was this page helpful?
0 / 5 - 0 ratings