Skip to content

Commit b659b85

Browse files
authored
Merge pull request #32 from infosiftr/stretch
Update PyPy 3.x to Debian Stretch
2 parents 6ec9262 + abb5b51 commit b659b85

File tree

10 files changed

+148
-31
lines changed

10 files changed

+148
-31
lines changed

2.7/Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,21 @@ RUN set -ex; \
3030
*) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding PyPy $PYPY_VERSION binary release"; exit 1 ;; \
3131
esac; \
3232
\
33-
wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/pypy2.7-v${PYPY_VERSION}-${pypyArch}.tar.bz2"; \
33+
wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/pypy2.7-v${PYPY_VERSION}-${pypyArch}.tar.bz2" --progress=dot:giga; \
3434
echo "$sha256 *pypy.tar.bz2" | sha256sum -c; \
3535
tar -xjC /usr/local --strip-components=1 -f pypy.tar.bz2; \
3636
find /usr/local/lib-python -depth -type d -a \( -name test -o -name tests \) -exec rm -rf '{}' +; \
3737
rm pypy.tar.bz2; \
3838
\
3939
# smoke test
40-
pypy --version
40+
pypy --version; \
41+
\
42+
if [ -f /usr/local/lib_pypy/_ssl_build.py ]; then \
43+
# on pypy3, rebuild ffi bits for compatibility with Debian Stretch+ (https://github.com/docker-library/pypy/issues/24#issuecomment-409408657)
44+
cd /usr/local/lib_pypy; \
45+
pypy _ssl_build.py; \
46+
# TODO rebuild other cffi modules here too? (other _*_build.py files)
47+
fi
4148

4249
RUN set -ex; \
4350
\

2.7/slim/Dockerfile

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ RUN set -ex; \
3737
apt-get install -y --no-install-recommends \
3838
bzip2 \
3939
wget \
40+
# sometimes "pypy" itself is linked against libncurses5, sometimes it's a ".so" file in "/usr/local/lib_pypy"
41+
libncurses5 \
4042
; \
41-
rm -rf /var/lib/apt/lists/*; \
4243
\
43-
wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/pypy2.7-v${PYPY_VERSION}-${pypyArch}.tar.bz2"; \
44+
wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/pypy2.7-v${PYPY_VERSION}-${pypyArch}.tar.bz2" --progress=dot:giga; \
4445
echo "$sha256 *pypy.tar.bz2" | sha256sum -c; \
4546
tar -xjC /usr/local --strip-components=1 -f pypy.tar.bz2; \
4647
find /usr/local/lib-python -depth -type d -a \( -name test -o -name tests \) -exec rm -rf '{}' +; \
@@ -49,6 +50,14 @@ RUN set -ex; \
4950
# smoke test
5051
pypy --version; \
5152
\
53+
if [ -f /usr/local/lib_pypy/_ssl_build.py ]; then \
54+
# on pypy3, rebuild ffi bits for compatibility with Debian Stretch+ (https://github.com/docker-library/pypy/issues/24#issuecomment-409408657)
55+
apt-get install -y --no-install-recommends gcc libc6-dev libssl-dev; \
56+
cd /usr/local/lib_pypy; \
57+
pypy _ssl_build.py; \
58+
# TODO rebuild other cffi modules here too? (other _*_build.py files)
59+
fi; \
60+
\
5261
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
5362
\
5463
pypy get-pip.py \
@@ -63,8 +72,17 @@ RUN set -ex; \
6372
\
6473
apt-mark auto '.*' > /dev/null; \
6574
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \
75+
find /usr/local -type f -executable -exec ldd '{}' ';' \
76+
| awk '/=>/ { print $(NF-1) }' \
77+
| sort -u \
78+
| xargs -r dpkg-query --search \
79+
| cut -d: -f1 \
80+
| sort -u \
81+
| xargs -r apt-mark manual \
82+
; \
6683
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
6784
# smoke test again, to be sure
85+
rm -rf /var/lib/apt/lists/*; \
6886
pypy --version; \
6987
pip --version
7088

3.5/Dockerfile

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM buildpack-deps:jessie
1+
FROM buildpack-deps:stretch
22

33
# ensure local pypy is preferred over distribution pypy
44
ENV PATH /usr/local/bin:$PATH
@@ -27,17 +27,28 @@ 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
\
33-
wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/pypy3.5-v${PYPY_VERSION}-${pypyArch}.tar.bz2"; \
37+
wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/pypy3.5-v${PYPY_VERSION}-${pypyArch}.tar.bz2" --progress=dot:giga; \
3438
echo "$sha256 *pypy.tar.bz2" | sha256sum -c; \
3539
tar -xjC /usr/local --strip-components=1 -f pypy.tar.bz2; \
3640
find /usr/local/lib-python -depth -type d -a \( -name test -o -name tests \) -exec rm -rf '{}' +; \
3741
rm pypy.tar.bz2; \
3842
\
3943
# smoke test
40-
pypy3 --version
44+
pypy3 --version; \
45+
\
46+
if [ -f /usr/local/lib_pypy/_ssl_build.py ]; then \
47+
# on pypy3, rebuild ffi bits for compatibility with Debian Stretch+ (https://github.com/docker-library/pypy/issues/24#issuecomment-409408657)
48+
cd /usr/local/lib_pypy; \
49+
pypy3 _ssl_build.py; \
50+
# TODO rebuild other cffi modules here too? (other _*_build.py files)
51+
fi
4152

4253
RUN set -ex; \
4354
\

3.5/slim/Dockerfile

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:jessie-slim
1+
FROM debian:stretch-slim
22

33
# ensure local pypy is preferred over distribution pypy
44
ENV PATH /usr/local/bin:$PATH
@@ -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
\
@@ -37,10 +41,11 @@ RUN set -ex; \
3741
apt-get install -y --no-install-recommends \
3842
bzip2 \
3943
wget \
44+
# sometimes "pypy3" itself is linked against libncurses5, sometimes it's a ".so" file in "/usr/local/lib_pypy"
45+
libncurses5 \
4046
; \
41-
rm -rf /var/lib/apt/lists/*; \
4247
\
43-
wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/pypy3.5-v${PYPY_VERSION}-${pypyArch}.tar.bz2"; \
48+
wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/pypy3.5-v${PYPY_VERSION}-${pypyArch}.tar.bz2" --progress=dot:giga; \
4449
echo "$sha256 *pypy.tar.bz2" | sha256sum -c; \
4550
tar -xjC /usr/local --strip-components=1 -f pypy.tar.bz2; \
4651
find /usr/local/lib-python -depth -type d -a \( -name test -o -name tests \) -exec rm -rf '{}' +; \
@@ -49,6 +54,14 @@ RUN set -ex; \
4954
# smoke test
5055
pypy3 --version; \
5156
\
57+
if [ -f /usr/local/lib_pypy/_ssl_build.py ]; then \
58+
# on pypy3, rebuild ffi bits for compatibility with Debian Stretch+ (https://github.com/docker-library/pypy/issues/24#issuecomment-409408657)
59+
apt-get install -y --no-install-recommends gcc libc6-dev libssl-dev; \
60+
cd /usr/local/lib_pypy; \
61+
pypy3 _ssl_build.py; \
62+
# TODO rebuild other cffi modules here too? (other _*_build.py files)
63+
fi; \
64+
\
5265
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
5366
\
5467
pypy3 get-pip.py \
@@ -63,8 +76,17 @@ RUN set -ex; \
6376
\
6477
apt-mark auto '.*' > /dev/null; \
6578
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \
79+
find /usr/local -type f -executable -exec ldd '{}' ';' \
80+
| awk '/=>/ { print $(NF-1) }' \
81+
| sort -u \
82+
| xargs -r dpkg-query --search \
83+
| cut -d: -f1 \
84+
| sort -u \
85+
| xargs -r apt-mark manual \
86+
; \
6687
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
6788
# smoke test again, to be sure
89+
rm -rf /var/lib/apt/lists/*; \
6890
pypy3 --version; \
6991
pip --version
7092

3.6/Dockerfile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM buildpack-deps:jessie
1+
FROM buildpack-deps:stretch
22

33
# ensure local pypy is preferred over distribution pypy
44
ENV PATH /usr/local/bin:$PATH
@@ -27,17 +27,26 @@ 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
\
33-
wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/pypy3.6-v${PYPY_VERSION}-${pypyArch}.tar.bz2"; \
35+
wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/pypy3.6-v${PYPY_VERSION}-${pypyArch}.tar.bz2" --progress=dot:giga; \
3436
echo "$sha256 *pypy.tar.bz2" | sha256sum -c; \
3537
tar -xjC /usr/local --strip-components=1 -f pypy.tar.bz2; \
3638
find /usr/local/lib-python -depth -type d -a \( -name test -o -name tests \) -exec rm -rf '{}' +; \
3739
rm pypy.tar.bz2; \
3840
\
3941
# smoke test
40-
pypy3 --version
42+
pypy3 --version; \
43+
\
44+
if [ -f /usr/local/lib_pypy/_ssl_build.py ]; then \
45+
# on pypy3, rebuild ffi bits for compatibility with Debian Stretch+ (https://github.com/docker-library/pypy/issues/24#issuecomment-409408657)
46+
cd /usr/local/lib_pypy; \
47+
pypy3 _ssl_build.py; \
48+
# TODO rebuild other cffi modules here too? (other _*_build.py files)
49+
fi
4150

4251
RUN set -ex; \
4352
\

3.6/slim/Dockerfile

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:jessie-slim
1+
FROM debian:stretch-slim
22

33
# ensure local pypy is preferred over distribution pypy
44
ENV PATH /usr/local/bin:$PATH
@@ -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
\
@@ -37,10 +39,11 @@ RUN set -ex; \
3739
apt-get install -y --no-install-recommends \
3840
bzip2 \
3941
wget \
42+
# sometimes "pypy3" itself is linked against libncurses5, sometimes it's a ".so" file in "/usr/local/lib_pypy"
43+
libncurses5 \
4044
; \
41-
rm -rf /var/lib/apt/lists/*; \
4245
\
43-
wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/pypy3.6-v${PYPY_VERSION}-${pypyArch}.tar.bz2"; \
46+
wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/pypy3.6-v${PYPY_VERSION}-${pypyArch}.tar.bz2" --progress=dot:giga; \
4447
echo "$sha256 *pypy.tar.bz2" | sha256sum -c; \
4548
tar -xjC /usr/local --strip-components=1 -f pypy.tar.bz2; \
4649
find /usr/local/lib-python -depth -type d -a \( -name test -o -name tests \) -exec rm -rf '{}' +; \
@@ -49,6 +52,14 @@ RUN set -ex; \
4952
# smoke test
5053
pypy3 --version; \
5154
\
55+
if [ -f /usr/local/lib_pypy/_ssl_build.py ]; then \
56+
# on pypy3, rebuild ffi bits for compatibility with Debian Stretch+ (https://github.com/docker-library/pypy/issues/24#issuecomment-409408657)
57+
apt-get install -y --no-install-recommends gcc libc6-dev libssl-dev; \
58+
cd /usr/local/lib_pypy; \
59+
pypy3 _ssl_build.py; \
60+
# TODO rebuild other cffi modules here too? (other _*_build.py files)
61+
fi; \
62+
\
5263
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
5364
\
5465
pypy3 get-pip.py \
@@ -63,8 +74,17 @@ RUN set -ex; \
6374
\
6475
apt-mark auto '.*' > /dev/null; \
6576
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \
77+
find /usr/local -type f -executable -exec ldd '{}' ';' \
78+
| awk '/=>/ { print $(NF-1) }' \
79+
| sort -u \
80+
| xargs -r dpkg-query --search \
81+
| cut -d: -f1 \
82+
| sort -u \
83+
| xargs -r apt-mark manual \
84+
; \
6685
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
6786
# smoke test again, to be sure
87+
rm -rf /var/lib/apt/lists/*; \
6888
pypy3 --version; \
6989
pip --version
7090

Dockerfile-slim.template

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:jessie-slim
1+
FROM debian:%%BASE%%-slim
22

33
# ensure local pypy is preferred over distribution pypy
44
ENV PATH /usr/local/bin:$PATH
@@ -30,10 +30,11 @@ RUN set -ex; \
3030
apt-get install -y --no-install-recommends \
3131
bzip2 \
3232
wget \
33+
# sometimes "%%CMD%%" itself is linked against libncurses5, sometimes it's a ".so" file in "/usr/local/lib_pypy"
34+
libncurses5 \
3335
; \
34-
rm -rf /var/lib/apt/lists/*; \
3536
\
36-
wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/%%TAR%%-v${PYPY_VERSION}-${pypyArch}.tar.bz2"; \
37+
wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/%%TAR%%-v${PYPY_VERSION}-${pypyArch}.tar.bz2" --progress=dot:giga; \
3738
echo "$sha256 *pypy.tar.bz2" | sha256sum -c; \
3839
tar -xjC /usr/local --strip-components=1 -f pypy.tar.bz2; \
3940
find /usr/local/lib-python -depth -type d -a \( -name test -o -name tests \) -exec rm -rf '{}' +; \
@@ -42,6 +43,14 @@ RUN set -ex; \
4243
# smoke test
4344
%%CMD%% --version; \
4445
\
46+
if [ -f /usr/local/lib_pypy/_ssl_build.py ]; then \
47+
# on pypy3, rebuild ffi bits for compatibility with Debian Stretch+ (https://github.com/docker-library/pypy/issues/24#issuecomment-409408657)
48+
apt-get install -y --no-install-recommends gcc libc6-dev libssl-dev; \
49+
cd /usr/local/lib_pypy; \
50+
%%CMD%% _ssl_build.py; \
51+
# TODO rebuild other cffi modules here too? (other _*_build.py files)
52+
fi; \
53+
\
4554
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
4655
\
4756
%%CMD%% get-pip.py \
@@ -56,8 +65,17 @@ RUN set -ex; \
5665
\
5766
apt-mark auto '.*' > /dev/null; \
5867
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \
68+
find /usr/local -type f -executable -exec ldd '{}' ';' \
69+
| awk '/=>/ { print $(NF-1) }' \
70+
| sort -u \
71+
| xargs -r dpkg-query --search \
72+
| cut -d: -f1 \
73+
| sort -u \
74+
| xargs -r apt-mark manual \
75+
; \
5976
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
6077
# smoke test again, to be sure
78+
rm -rf /var/lib/apt/lists/*; \
6179
%%CMD%% --version; \
6280
pip --version
6381

Dockerfile.template

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM buildpack-deps:jessie
1+
FROM buildpack-deps:%%BASE%%
22

33
# ensure local pypy is preferred over distribution pypy
44
ENV PATH /usr/local/bin:$PATH
@@ -23,14 +23,21 @@ RUN set -ex; \
2323
# this "case" statement is generated via "update.sh"
2424
%%ARCH-CASE%%; \
2525
\
26-
wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/%%TAR%%-v${PYPY_VERSION}-${pypyArch}.tar.bz2"; \
26+
wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/%%TAR%%-v${PYPY_VERSION}-${pypyArch}.tar.bz2" --progress=dot:giga; \
2727
echo "$sha256 *pypy.tar.bz2" | sha256sum -c; \
2828
tar -xjC /usr/local --strip-components=1 -f pypy.tar.bz2; \
2929
find /usr/local/lib-python -depth -type d -a \( -name test -o -name tests \) -exec rm -rf '{}' +; \
3030
rm pypy.tar.bz2; \
3131
\
3232
# smoke test
33-
%%CMD%% --version
33+
%%CMD%% --version; \
34+
\
35+
if [ -f /usr/local/lib_pypy/_ssl_build.py ]; then \
36+
# on pypy3, rebuild ffi bits for compatibility with Debian Stretch+ (https://github.com/docker-library/pypy/issues/24#issuecomment-409408657)
37+
cd /usr/local/lib_pypy; \
38+
%%CMD%% _ssl_build.py; \
39+
# TODO rebuild other cffi modules here too? (other _*_build.py files)
40+
fi
3441

3542
RUN set -ex; \
3643
\

release-architectures

Lines changed: 3 additions & 5 deletions
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

0 commit comments

Comments
 (0)