Error in the scons package due to a problem in the script shebang.
The scons
package is broken because the scons script did not find the python executable.
I tried installing using Alpine 3.11.6 on podman.
Log:
podman run --rm -it alpine:latest
/ # cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.11.6
PRETTY_NAME="Alpine Linux v3.11"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"
/ # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
v3.11.6-91-gd05b39805b [http://dl-cdn.alpinelinux.org/alpine/v3.11/main]
v3.11.6-90-g318b6c3504 [http://dl-cdn.alpinelinux.org/alpine/v3.11/community]
OK: 11271 distinct packages available
/ # apk upgrade
(1/1) Upgrading ca-certificates-cacert (20191127-r1 -> 20191127-r2)
OK: 6 MiB in 14 packages
/ # apk add scons
(1/11) Installing libbz2 (1.0.8-r1)
(2/11) Installing expat (2.2.9-r1)
(3/11) Installing libffi (3.2.1-r6)
(4/11) Installing gdbm (1.13-r1)
(5/11) Installing xz-libs (5.2.4-r0)
(6/11) Installing ncurses-terminfo-base (6.1_p20200118-r4)
(7/11) Installing ncurses-libs (6.1_p20200118-r4)
(8/11) Installing readline (8.0.1-r0)
(9/11) Installing sqlite-libs (3.30.1-r2)
(10/11) Installing python3 (3.8.2-r0)
(11/11) Installing scons (3.1.1-r0)
Executing busybox-1.31.1-r9.trigger
OK: 69 MiB in 25 packages
/ # scons
env: can't execute 'python': No such file or directory
The problem is in the scons script shebang, it refers to /usr/bin/env python
, but the default python on Alpine is python 2.
Solutions:
- Patch the file
$builddir/script/scons
to usepython3
instead ofpython
in the shebang.- Eg:
sed 's/env python/env python3/' script/scons > script/scons
- Eg:
Workarounds:
- Run scons using python3 directly:
python3 $(which scons)