Skip to content

Commit b3ee440

Browse files
committed
Add support for s390x and ppc64le where possible
Turns out this approach works well for consuming the RedHat-host-built binaries published for these other architectures too!
1 parent d54416e commit b3ee440

File tree

7 files changed

+37
-7
lines changed

7 files changed

+37
-7
lines changed

3.5/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ RUN set -ex; \
2727
amd64) pypyArch='linux64'; sha256='729e3c54325969c98bd3658c6342b9f5987b96bad1d6def04250a08401b54c4b' ;; \
2828
# i386
2929
i386) pypyArch='linux32'; sha256='b8db8fbca9621de8ea8cd7184b322f2dddb2f385e8e5a63dfb75bb3fea4b2e3f' ;; \
30+
# ppc64le
31+
ppc64el) pypyArch='ppc64le'; sha256='2912884da05abc2cdf71dd337c3f280095351312c1a1732a52b6878174a0fd02' ;; \
32+
# s390x
33+
s390x) pypyArch='s390x'; sha256='d588b045cc0d3a75c31fce54c1d181b1206ad9a5dd272fe79160a6268401605f' ;; \
3034
*) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding PyPy $PYPY_VERSION binary release"; exit 1 ;; \
3135
esac; \
3236
\

3.5/slim/Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ RUN set -ex; \
2929
amd64) pypyArch='linux64'; sha256='729e3c54325969c98bd3658c6342b9f5987b96bad1d6def04250a08401b54c4b' ;; \
3030
# i386
3131
i386) pypyArch='linux32'; sha256='b8db8fbca9621de8ea8cd7184b322f2dddb2f385e8e5a63dfb75bb3fea4b2e3f' ;; \
32+
# ppc64le
33+
ppc64el) pypyArch='ppc64le'; sha256='2912884da05abc2cdf71dd337c3f280095351312c1a1732a52b6878174a0fd02' ;; \
34+
# s390x
35+
s390x) pypyArch='s390x'; sha256='d588b045cc0d3a75c31fce54c1d181b1206ad9a5dd272fe79160a6268401605f' ;; \
3236
*) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding PyPy $PYPY_VERSION binary release"; exit 1 ;; \
3337
esac; \
3438
\
@@ -45,6 +49,8 @@ RUN set -ex; \
4549
find /usr/local/lib-python -depth -type d -a \( -name test -o -name tests \) -exec rm -rf '{}' +; \
4650
rm pypy.tar.bz2; \
4751
\
52+
# ppc64le and s390x link against libncurses.so.5 (https://bitbucket.org/pypy/pypy/issues/2646)
53+
if ldd /usr/local/bin/pypy3 2>&1 | grep -q 'libncurses.so.5 => not found'; then apt-get install -y --no-install-recommends libncurses5; savedAptMark="$savedAptMark libncurses5"; fi; \
4854
# smoke test
4955
pypy3 --version; \
5056
\

3.6/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ RUN set -ex; \
2727
amd64) pypyArch='linux64'; sha256='270dd06633cf03337e6f815d7235e790e90dabba6f4b6345c9745121006925fc' ;; \
2828
# i386
2929
i386) pypyArch='linux32'; sha256='031bfac61210a6e161bace0691b854dc15d01b0e624dc0588c544ee5e1621a83' ;; \
30+
# s390x
31+
s390x) pypyArch='s390x'; sha256='243cd0cc188a94c1f064f402ae72b8ba4303eb3137eac53c53826472b8005098' ;; \
3032
*) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding PyPy $PYPY_VERSION binary release"; exit 1 ;; \
3133
esac; \
3234
\

3.6/slim/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ RUN set -ex; \
2929
amd64) pypyArch='linux64'; sha256='270dd06633cf03337e6f815d7235e790e90dabba6f4b6345c9745121006925fc' ;; \
3030
# i386
3131
i386) pypyArch='linux32'; sha256='031bfac61210a6e161bace0691b854dc15d01b0e624dc0588c544ee5e1621a83' ;; \
32+
# s390x
33+
s390x) pypyArch='s390x'; sha256='243cd0cc188a94c1f064f402ae72b8ba4303eb3137eac53c53826472b8005098' ;; \
3234
*) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding PyPy $PYPY_VERSION binary release"; exit 1 ;; \
3335
esac; \
3436
\
@@ -45,6 +47,8 @@ RUN set -ex; \
4547
find /usr/local/lib-python -depth -type d -a \( -name test -o -name tests \) -exec rm -rf '{}' +; \
4648
rm pypy.tar.bz2; \
4749
\
50+
# ppc64le and s390x link against libncurses.so.5 (https://bitbucket.org/pypy/pypy/issues/2646)
51+
if ldd /usr/local/bin/pypy3 2>&1 | grep -q 'libncurses.so.5 => not found'; then apt-get install -y --no-install-recommends libncurses5; savedAptMark="$savedAptMark libncurses5"; fi; \
4852
# smoke test
4953
pypy3 --version; \
5054
\

Dockerfile-slim.template

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ RUN set -ex; \
3838
find /usr/local/lib-python -depth -type d -a \( -name test -o -name tests \) -exec rm -rf '{}' +; \
3939
rm pypy.tar.bz2; \
4040
\
41+
# ppc64le and s390x link against libncurses.so.5 (https://bitbucket.org/pypy/pypy/issues/2646)
42+
if ldd /usr/local/bin/%%CMD%% 2>&1 | grep -q 'libncurses.so.5 => not found'; then apt-get install -y --no-install-recommends libncurses5; savedAptMark="$savedAptMark libncurses5"; fi; \
4143
# smoke test
4244
%%CMD%% --version; \
4345
\

release-architectures

+3-5
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ arm32v5 armel linux-armel
77
arm32v7 armhf linux-armhf-raring
88
i386 i386 linux32
99

10-
# pypy: error while loading shared libraries: libssl.so.10: cannot open shared object file: No such file or directory
11-
#ppc64le ppc64el ppc64le
12-
# pypy: error while loading shared libraries: libssl.so.10: cannot open shared object file: No such file or directory
13-
#s390x s390x s390x
14-
# https://bitbucket.org/pypy/pypy/issues/2646/s390x-and-ppc64le-releases-link-to
10+
# see https://bitbucket.org/pypy/pypy/issues/2646 for some s390x/ppc64le caveats (mitigated in 3.x via https://github.com/docker-library/pypy/issues/24#issuecomment-476873691)
11+
ppc64le ppc64el ppc64le
12+
s390x s390x s390x

update.sh

+16-2
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,23 @@ for version in "${versions[@]}"; do
7474

7575
linuxArchCase='dpkgArch="$(dpkg --print-architecture)"; '$'\\\n'
7676
linuxArchCase+=$'\t''case "${dpkgArch##*-}" in '$'\\\n'
77+
haveIBM=
7778
for dpkgArch in $(dpkgArches); do
79+
bashbrewArch="$(dpkgToBashbrewArch "$dpkgArch")"
80+
case "$base/$bashbrewArch" in
81+
jessie/s390x | jessie/ppc64le)
82+
echo >&2 "warning: skipping $pypy on $bashbrewArch; https://bitbucket.org/pypy/pypy/issues/2646"
83+
continue
84+
;;
85+
86+
*/s390x | */ppc64le) haveIBM=1 ;;
87+
esac
7888
pypyArch="$(dpkgToPyPyArch "$dpkgArch")"
7989
sha256="$(scrapeSha256 "$pypy" "$fullVersion" "$pypyArch")" || :
8090
if [ -z "$sha256" ]; then
81-
echo >&2 "warning: cannot find sha256 for $pypy-$fullVersion on arch $pypyArch ($dpkgArch); skipping it"
91+
echo >&2 "warning: cannot find sha256 for $pypy-$fullVersion on arch $pypyArch ($bashbrewArch); skipping it"
8292
continue
8393
fi
84-
bashbrewArch="$(dpkgToBashbrewArch "$dpkgArch")"
8594
linuxArchCase+="# $bashbrewArch"$'\n'
8695
linuxArchCase+=$'\t\t'"$dpkgArch) pypyArch='$pypyArch'; sha256='$sha256' ;; "$'\\\n'
8796
done
@@ -99,6 +108,11 @@ for version in "${versions[@]}"; do
99108
"Dockerfile${variant:+-$variant}.template" > "$version/$variant/Dockerfile"
100109
travisEnv='\n - VERSION='"$version VARIANT=$variant$travisEnv"
101110
done
111+
112+
if [ -z "$haveIBM" ]; then
113+
# no need for s390x/ppc64le libncurses hax
114+
sed -i '/libncurses/d' "$version/slim/Dockerfile"
115+
fi
102116
done
103117

104118
travis="$(awk -v 'RS=\n\n' '$1 == "env:" { $0 = "env:'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)"

0 commit comments

Comments
 (0)