Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pypy #9654

Merged
merged 1 commit into from
Feb 18, 2021
Merged

Update pypy #9654

merged 1 commit into from
Feb 18, 2021

Conversation

tianon
Copy link
Member

@tianon tianon commented Feb 18, 2021

Changes:

Changes:

- docker-library/pypy@d660df9: Merge pull request docker-library/pypy#55 from infosiftr/thread-patch
- docker-library/pypy@42286a6: Apply thread-related crypt patches in 3.x versions
- docker-library/pypy@8b9d85c: Merge pull request docker-library/pypy#53 from infosiftr/jq-template
- docker-library/pypy@76a4649: Add initial jq-based templating engine
@github-actions
Copy link

Diff for f7fc1ed:
diff --git a/_bashbrew-cat b/_bashbrew-cat
index 8d320ac..30378f5 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -3,30 +3,30 @@ GitRepo: https://github.com/docker-library/pypy.git
 
 Tags: 2.7-7.3.3, 2.7-7.3, 2.7-7, 2.7, 2-7.3.3, 2-7.3, 2-7, 2, 2.7-7.3.3-buster, 2.7-7.3-buster, 2.7-7-buster, 2.7-buster, 2-7.3.3-buster, 2-7.3-buster, 2-7-buster, 2-buster
 Architectures: amd64, arm64v8, i386
-GitCommit: 9625e09996380a78c53a9610915d839035245b57
-Directory: 2.7
+GitCommit: 76a4649761506eab69ad383e70a627a743f24610
+Directory: 2.7/buster
 
 Tags: 2.7-7.3.3-slim, 2.7-7.3-slim, 2.7-7-slim, 2.7-slim, 2-7.3.3-slim, 2-7.3-slim, 2-7-slim, 2-slim, 2.7-7.3.3-slim-buster, 2.7-7.3-slim-buster, 2.7-7-slim-buster, 2.7-slim-buster, 2-7.3.3-slim-buster, 2-7.3-slim-buster, 2-7-slim-buster, 2-slim-buster
 Architectures: amd64, arm64v8, i386
-GitCommit: 9625e09996380a78c53a9610915d839035245b57
-Directory: 2.7/slim
+GitCommit: 42286a6d407e44b56d8aca968f91a2e9214a35b2
+Directory: 2.7/slim-buster
 
 Tags: 3.6-7.3.3, 3.6-7.3, 3.6-7, 3.6, 3-7.3.3, 3-7.3, 3-7, 3, latest, 3.6-7.3.3-buster, 3.6-7.3-buster, 3.6-7-buster, 3.6-buster, 3-7.3.3-buster, 3-7.3-buster, 3-7-buster, 3-buster, buster
 Architectures: amd64, arm64v8, i386, s390x
-GitCommit: 9625e09996380a78c53a9610915d839035245b57
-Directory: 3.6
+GitCommit: 42286a6d407e44b56d8aca968f91a2e9214a35b2
+Directory: 3.6/buster
 
 Tags: 3.6-7.3.3-slim, 3.6-7.3-slim, 3.6-7-slim, 3.6-slim, 3-7.3.3-slim, 3-7.3-slim, 3-7-slim, 3-slim, slim, 3.6-7.3.3-slim-buster, 3.6-7.3-slim-buster, 3.6-7-slim-buster, 3.6-slim-buster, 3-7.3.3-slim-buster, 3-7.3-slim-buster, 3-7-slim-buster, 3-slim-buster, slim-buster
 Architectures: amd64, arm64v8, i386, s390x
-GitCommit: 9625e09996380a78c53a9610915d839035245b57
-Directory: 3.6/slim
+GitCommit: 42286a6d407e44b56d8aca968f91a2e9214a35b2
+Directory: 3.6/slim-buster
 
 Tags: 3.7-7.3.3, 3.7-7.3, 3.7-7, 3.7, 3.7-7.3.3-buster, 3.7-7.3-buster, 3.7-7-buster, 3.7-buster
 Architectures: amd64, arm64v8, i386, s390x
-GitCommit: 9625e09996380a78c53a9610915d839035245b57
-Directory: 3.7
+GitCommit: 42286a6d407e44b56d8aca968f91a2e9214a35b2
+Directory: 3.7/buster
 
 Tags: 3.7-7.3.3-slim, 3.7-7.3-slim, 3.7-7-slim, 3.7-slim, 3.7-7.3.3-slim-buster, 3.7-7.3-slim-buster, 3.7-7-slim-buster, 3.7-slim-buster
 Architectures: amd64, arm64v8, i386, s390x
-GitCommit: 9625e09996380a78c53a9610915d839035245b57
-Directory: 3.7/slim
+GitCommit: 42286a6d407e44b56d8aca968f91a2e9214a35b2
+Directory: 3.7/slim-buster
diff --git a/pypy_2-buster/Dockerfile b/pypy_2-buster/Dockerfile
index 25a7b17..fbfe279 100644
--- a/pypy_2-buster/Dockerfile
+++ b/pypy_2-buster/Dockerfile
@@ -1,8 +1,10 @@
-FROM buildpack-deps:buster
+#
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
+#
+# PLEASE DO NOT EDIT IT DIRECTLY.
+#
 
-# http://bugs.python.org/issue19846
-# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
-ENV LANG C.UTF-8
+FROM buildpack-deps:buster
 
 # runtime dependencies
 RUN set -eux; \
@@ -13,22 +15,31 @@ RUN set -eux; \
 	; \
 	rm -rf /var/lib/apt/lists/*
 
+# http://bugs.python.org/issue19846
+# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
+ENV LANG C.UTF-8
+
 # ensure local pypy is preferred over distribution pypy
 ENV PATH /opt/pypy/bin:$PATH
 
 ENV PYPY_VERSION 7.3.3
 
-RUN set -ex; \
+RUN set -eux; \
 	\
-# this "case" statement is generated via "update.sh"
 	dpkgArch="$(dpkg --print-architecture)"; \
 	case "${dpkgArch##*-}" in \
-# amd64
-		amd64) pypyArch='linux64'; sha256='f412b602ccd6912ddee0e7523e0e38f4b2c7a144449c2cad078cffbdb66fd7b1' ;; \
-# arm64v8
-		arm64) pypyArch='aarch64'; sha256='23b145b7cfbaeefb6ee76fc8216c83b652ab1daffac490558718edbbd60082d8' ;; \
-# i386
-		i386) pypyArch='linux32'; sha256='bfbc81874b137837a8ba8c517b97de29f5a336f7ec500c52f2bfdbd3580d1703' ;; \
+		'amd64') \
+			url='https://downloads.python.org/pypy/pypy2.7-v7.3.3-linux64.tar.bz2'; \
+			sha256='f412b602ccd6912ddee0e7523e0e38f4b2c7a144449c2cad078cffbdb66fd7b1'; \
+			;; \
+		'arm64') \
+			url='https://downloads.python.org/pypy/pypy2.7-v7.3.3-aarch64.tar.bz2'; \
+			sha256='23b145b7cfbaeefb6ee76fc8216c83b652ab1daffac490558718edbbd60082d8'; \
+			;; \
+		'i386') \
+			url='https://downloads.python.org/pypy/pypy2.7-v7.3.3-linux32.tar.bz2'; \
+			sha256='bfbc81874b137837a8ba8c517b97de29f5a336f7ec500c52f2bfdbd3580d1703'; \
+			;; \
 		*) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding PyPy $PYPY_VERSION binary release"; exit 1 ;; \
 	esac; \
 	\
@@ -41,30 +52,18 @@ RUN set -ex; \
 # (so we'll add them temporarily, then use "ldd" later to determine which to keep based on usage per architecture)
 	; \
 	\
-	wget -O pypy.tar.bz2 "https://downloads.python.org/pypy/pypy2.7-v${PYPY_VERSION}-${pypyArch}.tar.bz2" --progress=dot:giga; \
-	echo "$sha256 *pypy.tar.bz2" | sha256sum -c; \
+	wget -O pypy.tar.bz2 "$url" --progress=dot:giga; \
+	echo "$sha256 *pypy.tar.bz2" | sha256sum --check --strict -; \
 	mkdir /opt/pypy; \
 	tar -xjC /opt/pypy --strip-components=1 -f pypy.tar.bz2; \
 	find /opt/pypy/lib-python -depth -type d -a \( -name test -o -name tests \) -exec rm -rf '{}' +; \
 	rm pypy.tar.bz2; \
 	\
-	ln -svT '/opt/pypy/bin/pypy' '/usr/local/bin/pypy'; \
+	ln -sv '/opt/pypy/bin/pypy' /usr/local/bin/; \
 	\
 # smoke test
 	pypy --version; \
 	\
-# on pypy3, rebuild ffi bits for compatibility with Debian Stretch+
-	cd /opt/pypy/lib_pypy; \
-# https://github.com/docker-library/pypy/issues/24#issuecomment-409408657
-	if [ -f _ssl_build.py ]; then \
-		pypy _ssl_build.py; \
-	fi; \
-# https://github.com/docker-library/pypy/issues/42
-	if [ -f _lzma_build.py ]; then \
-		pypy _lzma_build.py; \
-	fi; \
-# TODO rebuild other cffi modules here too? (other _*_build.py files)
-	\
 	apt-mark auto '.*' > /dev/null; \
 	[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \
 	find /opt/pypy -type f -executable -exec ldd '{}' ';' \
@@ -101,7 +100,7 @@ RUN set -ex; \
 	pypy get-pip.py \
 		--disable-pip-version-check \
 		--no-cache-dir \
-		"pip==$PYTHON_PIP_VERSION" \
+		"pip == $PYTHON_PIP_VERSION" \
 	; \
 # smoke test
 	pip --version; \
diff --git a/pypy_2-slim-buster/Dockerfile b/pypy_2-slim-buster/Dockerfile
index 0a606e1..a893b96 100644
--- a/pypy_2-slim-buster/Dockerfile
+++ b/pypy_2-slim-buster/Dockerfile
@@ -1,30 +1,41 @@
-FROM debian:buster-slim
+#
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
+#
+# PLEASE DO NOT EDIT IT DIRECTLY.
+#
 
-# http://bugs.python.org/issue19846
-# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
-ENV LANG C.UTF-8
+FROM debian:buster-slim
 
 RUN set -eux; \
 	apt-get update; \
 	apt-get install -y --no-install-recommends ca-certificates; \
 	rm -rf /var/lib/apt/lists/*
 
+# http://bugs.python.org/issue19846
+# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
+ENV LANG C.UTF-8
+
 # ensure local pypy is preferred over distribution pypy
 ENV PATH /opt/pypy/bin:$PATH
 
 ENV PYPY_VERSION 7.3.3
 
-RUN set -ex; \
+RUN set -eux; \
 	\
-# this "case" statement is generated via "update.sh"
 	dpkgArch="$(dpkg --print-architecture)"; \
 	case "${dpkgArch##*-}" in \
-# amd64
-		amd64) pypyArch='linux64'; sha256='f412b602ccd6912ddee0e7523e0e38f4b2c7a144449c2cad078cffbdb66fd7b1' ;; \
-# arm64v8
-		arm64) pypyArch='aarch64'; sha256='23b145b7cfbaeefb6ee76fc8216c83b652ab1daffac490558718edbbd60082d8' ;; \
-# i386
-		i386) pypyArch='linux32'; sha256='bfbc81874b137837a8ba8c517b97de29f5a336f7ec500c52f2bfdbd3580d1703' ;; \
+		'amd64') \
+			url='https://downloads.python.org/pypy/pypy2.7-v7.3.3-linux64.tar.bz2'; \
+			sha256='f412b602ccd6912ddee0e7523e0e38f4b2c7a144449c2cad078cffbdb66fd7b1'; \
+			;; \
+		'arm64') \
+			url='https://downloads.python.org/pypy/pypy2.7-v7.3.3-aarch64.tar.bz2'; \
+			sha256='23b145b7cfbaeefb6ee76fc8216c83b652ab1daffac490558718edbbd60082d8'; \
+			;; \
+		'i386') \
+			url='https://downloads.python.org/pypy/pypy2.7-v7.3.3-linux32.tar.bz2'; \
+			sha256='bfbc81874b137837a8ba8c517b97de29f5a336f7ec500c52f2bfdbd3580d1703'; \
+			;; \
 		*) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding PyPy $PYPY_VERSION binary release"; exit 1 ;; \
 	esac; \
 	\
@@ -32,6 +43,7 @@ RUN set -ex; \
 	apt-get update; \
 	apt-get install -y --no-install-recommends \
 		bzip2 \
+		patch \
 		wget \
 # sometimes "pypy" itself is linked against libexpat1 / libncurses5, sometimes they're ".so" files in "/opt/pypy/lib_pypy"
 		libexpat1 \
@@ -39,32 +51,18 @@ RUN set -ex; \
 # (so we'll add them temporarily, then use "ldd" later to determine which to keep based on usage per architecture)
 	; \
 	\
-	wget -O pypy.tar.bz2 "https://downloads.python.org/pypy/pypy2.7-v${PYPY_VERSION}-${pypyArch}.tar.bz2" --progress=dot:giga; \
-	echo "$sha256 *pypy.tar.bz2" | sha256sum -c; \
+	wget -O pypy.tar.bz2 "$url" --progress=dot:giga; \
+	echo "$sha256 *pypy.tar.bz2" | sha256sum --check --strict -; \
 	mkdir /opt/pypy; \
 	tar -xjC /opt/pypy --strip-components=1 -f pypy.tar.bz2; \
 	find /opt/pypy/lib-python -depth -type d -a \( -name test -o -name tests \) -exec rm -rf '{}' +; \
 	rm pypy.tar.bz2; \
 	\
-	ln -svT '/opt/pypy/bin/pypy' '/usr/local/bin/pypy'; \
+	ln -sv '/opt/pypy/bin/pypy' /usr/local/bin/; \
 	\
 # smoke test
 	pypy --version; \
 	\
-# on pypy3, rebuild ffi bits for compatibility with Debian Stretch+
-	cd /opt/pypy/lib_pypy; \
-# https://github.com/docker-library/pypy/issues/24#issuecomment-409408657
-	if [ -f _ssl_build.py ]; then \
-		apt-get install -y --no-install-recommends gcc libc6-dev libssl-dev; \
-		pypy _ssl_build.py; \
-	fi; \
-# https://github.com/docker-library/pypy/issues/42
-	if [ -f _lzma_build.py ]; then \
-		apt-get install -y --no-install-recommends gcc libc6-dev liblzma-dev; \
-		pypy _lzma_build.py; \
-	fi; \
-# TODO rebuild other cffi modules here too? (other _*_build.py files)
-	\
 	apt-mark auto '.*' > /dev/null; \
 	[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \
 	find /opt/pypy -type f -executable -exec ldd '{}' ';' \
@@ -95,9 +93,7 @@ ENV PYTHON_GET_PIP_SHA256 95c5ee602b2f3cc50ae053d716c3c89bea62c58568f64d7d25924d
 
 RUN set -ex; \
 	apt-get update; \
-	apt-get install -y --no-install-recommends \
-		wget \
-	; \
+	apt-get install -y --no-install-recommends wget; \
 	rm -rf /var/lib/apt/lists/*; \
 	\
 	wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \
@@ -106,7 +102,7 @@ RUN set -ex; \
 	pypy get-pip.py \
 		--disable-pip-version-check \
 		--no-cache-dir \
-		"pip==$PYTHON_PIP_VERSION" \
+		"pip == $PYTHON_PIP_VERSION" \
 	; \
 	apt-get purge -y --auto-remove wget; \
 # smoke test
diff --git a/pypy_3.7-buster/Dockerfile b/pypy_3.7-buster/Dockerfile
index f0173b4..6d5452e 100644
--- a/pypy_3.7-buster/Dockerfile
+++ b/pypy_3.7-buster/Dockerfile
@@ -1,8 +1,10 @@
-FROM buildpack-deps:buster
+#
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
+#
+# PLEASE DO NOT EDIT IT DIRECTLY.
+#
 
-# http://bugs.python.org/issue19846
-# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
-ENV LANG C.UTF-8
+FROM buildpack-deps:buster
 
 # runtime dependencies
 RUN set -eux; \
@@ -13,24 +15,35 @@ RUN set -eux; \
 	; \
 	rm -rf /var/lib/apt/lists/*
 
-# ensure local pypy is preferred over distribution pypy
+# http://bugs.python.org/issue19846
+# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
+ENV LANG C.UTF-8
+
+# ensure local pypy3 is preferred over distribution pypy3
 ENV PATH /opt/pypy/bin:$PATH
 
 ENV PYPY_VERSION 7.3.3
 
-RUN set -ex; \
+RUN set -eux; \
 	\
-# this "case" statement is generated via "update.sh"
 	dpkgArch="$(dpkg --print-architecture)"; \
 	case "${dpkgArch##*-}" in \
-# amd64
-		amd64) pypyArch='linux64'; sha256='37e2804c4661c86c857d709d28c7de716b000d31e89766599fdf5a98928b7096' ;; \
-# arm64v8
-		arm64) pypyArch='aarch64'; sha256='ee4aa041558b58de6063dd6df93b3def221c4ca4c900d6a9db5b1b52135703a8' ;; \
-# i386
-		i386) pypyArch='linux32'; sha256='7d81b8e9fcd07c067cfe2f519ab770ec62928ee8787f952cadf2d2786246efc8' ;; \
-# s390x
-		s390x) pypyArch='s390x'; sha256='92000d90b9a37f2e9cb7885f2a872adfa9e48e74bf7f84a8b8185c8181f0502d' ;; \
+		'amd64') \
+			url='https://downloads.python.org/pypy/pypy3.7-v7.3.3-linux64.tar.bz2'; \
+			sha256='37e2804c4661c86c857d709d28c7de716b000d31e89766599fdf5a98928b7096'; \
+			;; \
+		'arm64') \
+			url='https://downloads.python.org/pypy/pypy3.7-v7.3.3-aarch64.tar.bz2'; \
+			sha256='ee4aa041558b58de6063dd6df93b3def221c4ca4c900d6a9db5b1b52135703a8'; \
+			;; \
+		'i386') \
+			url='https://downloads.python.org/pypy/pypy3.7-v7.3.3-linux32.tar.bz2'; \
+			sha256='7d81b8e9fcd07c067cfe2f519ab770ec62928ee8787f952cadf2d2786246efc8'; \
+			;; \
+		's390x') \
+			url='https://downloads.python.org/pypy/pypy3.7-v7.3.3-s390x.tar.bz2'; \
+			sha256='92000d90b9a37f2e9cb7885f2a872adfa9e48e74bf7f84a8b8185c8181f0502d'; \
+			;; \
 		*) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding PyPy $PYPY_VERSION binary release"; exit 1 ;; \
 	esac; \
 	\
@@ -43,14 +56,23 @@ RUN set -ex; \
 # (so we'll add them temporarily, then use "ldd" later to determine which to keep based on usage per architecture)
 	; \
 	\
-	wget -O pypy.tar.bz2 "https://downloads.python.org/pypy/pypy3.7-v${PYPY_VERSION}-${pypyArch}.tar.bz2" --progress=dot:giga; \
-	echo "$sha256 *pypy.tar.bz2" | sha256sum -c; \
+	wget -O pypy.tar.bz2 "$url" --progress=dot:giga; \
+	echo "$sha256 *pypy.tar.bz2" | sha256sum --check --strict -; \
 	mkdir /opt/pypy; \
 	tar -xjC /opt/pypy --strip-components=1 -f pypy.tar.bz2; \
 	find /opt/pypy/lib-python -depth -type d -a \( -name test -o -name tests \) -exec rm -rf '{}' +; \
 	rm pypy.tar.bz2; \
 	\
-	ln -svT '/opt/pypy/bin/pypy3' '/usr/local/bin/pypy3'; \
+# https://github.com/docker-library/pypy/issues/49
+	wget -O import.patch 'https://foss.heptapod.net/pypy/pypy/-/commit/16faa2be85839e6ab4fb8ee09298a4d934aab81f.patch'; \
+	echo '2d4bcc434077685a4ff26c1c1f28109ff67ef7e68f1f831ce0f2d9ddd6a194d0 *import.patch' | sha256sum --check --strict -; \
+	wget -O crypt-utf8.patch 'https://foss.heptapod.net/pypy/pypy/-/commit/c63da169246ed972fe90e1c289fc2378236fa852.patch'; \
+	echo 'ab1529948c49fd29fb76b3c20ec7d3d9c50603aa0c549a8a31339eb940e0f4d3 *crypt-utf8.patch' | sha256sum --check --strict -; \
+	patch --input="$PWD/import.patch" --directory=/opt/pypy --strip=1; \
+	patch --input="$PWD/crypt-utf8.patch" --directory=/opt/pypy --strip=1; \
+	rm import.patch crypt-utf8.patch; \
+	\
+	ln -sv '/opt/pypy/bin/pypy3' /usr/local/bin/; \
 	\
 # smoke test
 	pypy3 --version; \
@@ -103,7 +125,7 @@ RUN set -ex; \
 	pypy3 get-pip.py \
 		--disable-pip-version-check \
 		--no-cache-dir \
-		"pip==$PYTHON_PIP_VERSION" \
+		"pip == $PYTHON_PIP_VERSION" \
 	; \
 # smoke test
 	pip --version; \
diff --git a/pypy_3.7-slim-buster/Dockerfile b/pypy_3.7-slim-buster/Dockerfile
index 7ea07a8..a355bea 100644
--- a/pypy_3.7-slim-buster/Dockerfile
+++ b/pypy_3.7-slim-buster/Dockerfile
@@ -1,32 +1,45 @@
-FROM debian:buster-slim
+#
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
+#
+# PLEASE DO NOT EDIT IT DIRECTLY.
+#
 
-# http://bugs.python.org/issue19846
-# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
-ENV LANG C.UTF-8
+FROM debian:buster-slim
 
 RUN set -eux; \
 	apt-get update; \
 	apt-get install -y --no-install-recommends ca-certificates; \
 	rm -rf /var/lib/apt/lists/*
 
-# ensure local pypy is preferred over distribution pypy
+# http://bugs.python.org/issue19846
+# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
+ENV LANG C.UTF-8
+
+# ensure local pypy3 is preferred over distribution pypy3
 ENV PATH /opt/pypy/bin:$PATH
 
 ENV PYPY_VERSION 7.3.3
 
-RUN set -ex; \
+RUN set -eux; \
 	\
-# this "case" statement is generated via "update.sh"
 	dpkgArch="$(dpkg --print-architecture)"; \
 	case "${dpkgArch##*-}" in \
-# amd64
-		amd64) pypyArch='linux64'; sha256='37e2804c4661c86c857d709d28c7de716b000d31e89766599fdf5a98928b7096' ;; \
-# arm64v8
-		arm64) pypyArch='aarch64'; sha256='ee4aa041558b58de6063dd6df93b3def221c4ca4c900d6a9db5b1b52135703a8' ;; \
-# i386
-		i386) pypyArch='linux32'; sha256='7d81b8e9fcd07c067cfe2f519ab770ec62928ee8787f952cadf2d2786246efc8' ;; \
-# s390x
-		s390x) pypyArch='s390x'; sha256='92000d90b9a37f2e9cb7885f2a872adfa9e48e74bf7f84a8b8185c8181f0502d' ;; \
+		'amd64') \
+			url='https://downloads.python.org/pypy/pypy3.7-v7.3.3-linux64.tar.bz2'; \
+			sha256='37e2804c4661c86c857d709d28c7de716b000d31e89766599fdf5a98928b7096'; \
+			;; \
+		'arm64') \
+			url='https://downloads.python.org/pypy/pypy3.7-v7.3.3-aarch64.tar.bz2'; \
+			sha256='ee4aa041558b58de6063dd6df93b3def221c4ca4c900d6a9db5b1b52135703a8'; \
+			;; \
+		'i386') \
+			url='https://downloads.python.org/pypy/pypy3.7-v7.3.3-linux32.tar.bz2'; \
+			sha256='7d81b8e9fcd07c067cfe2f519ab770ec62928ee8787f952cadf2d2786246efc8'; \
+			;; \
+		's390x') \
+			url='https://downloads.python.org/pypy/pypy3.7-v7.3.3-s390x.tar.bz2'; \
+			sha256='92000d90b9a37f2e9cb7885f2a872adfa9e48e74bf7f84a8b8185c8181f0502d'; \
+			;; \
 		*) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding PyPy $PYPY_VERSION binary release"; exit 1 ;; \
 	esac; \
 	\
@@ -34,6 +47,7 @@ RUN set -ex; \
 	apt-get update; \
 	apt-get install -y --no-install-recommends \
 		bzip2 \
+		patch \
 		wget \
 # sometimes "pypy3" itself is linked against libexpat1 / libncurses5, sometimes they're ".so" files in "/opt/pypy/lib_pypy"
 		libexpat1 \
@@ -41,14 +55,23 @@ RUN set -ex; \
 # (so we'll add them temporarily, then use "ldd" later to determine which to keep based on usage per architecture)
 	; \
 	\
-	wget -O pypy.tar.bz2 "https://downloads.python.org/pypy/pypy3.7-v${PYPY_VERSION}-${pypyArch}.tar.bz2" --progress=dot:giga; \
-	echo "$sha256 *pypy.tar.bz2" | sha256sum -c; \
+	wget -O pypy.tar.bz2 "$url" --progress=dot:giga; \
+	echo "$sha256 *pypy.tar.bz2" | sha256sum --check --strict -; \
 	mkdir /opt/pypy; \
 	tar -xjC /opt/pypy --strip-components=1 -f pypy.tar.bz2; \
 	find /opt/pypy/lib-python -depth -type d -a \( -name test -o -name tests \) -exec rm -rf '{}' +; \
 	rm pypy.tar.bz2; \
 	\
-	ln -svT '/opt/pypy/bin/pypy3' '/usr/local/bin/pypy3'; \
+# https://github.com/docker-library/pypy/issues/49
+	wget -O import.patch 'https://foss.heptapod.net/pypy/pypy/-/commit/16faa2be85839e6ab4fb8ee09298a4d934aab81f.patch'; \
+	echo '2d4bcc434077685a4ff26c1c1f28109ff67ef7e68f1f831ce0f2d9ddd6a194d0 *import.patch' | sha256sum --check --strict -; \
+	wget -O crypt-utf8.patch 'https://foss.heptapod.net/pypy/pypy/-/commit/c63da169246ed972fe90e1c289fc2378236fa852.patch'; \
+	echo 'ab1529948c49fd29fb76b3c20ec7d3d9c50603aa0c549a8a31339eb940e0f4d3 *crypt-utf8.patch' | sha256sum --check --strict -; \
+	patch --input="$PWD/import.patch" --directory=/opt/pypy --strip=1; \
+	patch --input="$PWD/crypt-utf8.patch" --directory=/opt/pypy --strip=1; \
+	rm import.patch crypt-utf8.patch; \
+	\
+	ln -sv '/opt/pypy/bin/pypy3' /usr/local/bin/; \
 	\
 # smoke test
 	pypy3 --version; \
@@ -97,9 +120,7 @@ ENV PYTHON_GET_PIP_SHA256 95c5ee602b2f3cc50ae053d716c3c89bea62c58568f64d7d25924d
 
 RUN set -ex; \
 	apt-get update; \
-	apt-get install -y --no-install-recommends \
-		wget \
-	; \
+	apt-get install -y --no-install-recommends wget; \
 	rm -rf /var/lib/apt/lists/*; \
 	\
 	wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \
@@ -108,7 +129,7 @@ RUN set -ex; \
 	pypy3 get-pip.py \
 		--disable-pip-version-check \
 		--no-cache-dir \
-		"pip==$PYTHON_PIP_VERSION" \
+		"pip == $PYTHON_PIP_VERSION" \
 	; \
 	apt-get purge -y --auto-remove wget; \
 # smoke test
diff --git a/pypy_buster/Dockerfile b/pypy_buster/Dockerfile
index a27a912..9753baf 100644
--- a/pypy_buster/Dockerfile
+++ b/pypy_buster/Dockerfile
@@ -1,8 +1,10 @@
-FROM buildpack-deps:buster
+#
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
+#
+# PLEASE DO NOT EDIT IT DIRECTLY.
+#
 
-# http://bugs.python.org/issue19846
-# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
-ENV LANG C.UTF-8
+FROM buildpack-deps:buster
 
 # runtime dependencies
 RUN set -eux; \
@@ -13,24 +15,35 @@ RUN set -eux; \
 	; \
 	rm -rf /var/lib/apt/lists/*
 
-# ensure local pypy is preferred over distribution pypy
+# http://bugs.python.org/issue19846
+# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
+ENV LANG C.UTF-8
+
+# ensure local pypy3 is preferred over distribution pypy3
 ENV PATH /opt/pypy/bin:$PATH
 
 ENV PYPY_VERSION 7.3.3
 
-RUN set -ex; \
+RUN set -eux; \
 	\
-# this "case" statement is generated via "update.sh"
 	dpkgArch="$(dpkg --print-architecture)"; \
 	case "${dpkgArch##*-}" in \
-# amd64
-		amd64) pypyArch='linux64'; sha256='4fb85fdd516482cab727bb9473b066ff8fb672940dedf7ccc32bf92957d29e0a' ;; \
-# arm64v8
-		arm64) pypyArch='aarch64'; sha256='bc82cf7f0182b942a2cfad4a0d167f364bfbf18f434e100a2fe62bc88547ac9b' ;; \
-# i386
-		i386) pypyArch='linux32'; sha256='f183c61e66fd2c536a65695bd7ff770748c2884c235a589b9c6ac63690770c69' ;; \
-# s390x
-		s390x) pypyArch='s390x'; sha256='0de9c33ff3500c6e7fd273d0a6d341bc839b0298f697c4d6fe141f2b54c5c3e2' ;; \
+		'amd64') \
+			url='https://downloads.python.org/pypy/pypy3.6-v7.3.3-linux64.tar.bz2'; \
+			sha256='4fb85fdd516482cab727bb9473b066ff8fb672940dedf7ccc32bf92957d29e0a'; \
+			;; \
+		'arm64') \
+			url='https://downloads.python.org/pypy/pypy3.6-v7.3.3-aarch64.tar.bz2'; \
+			sha256='bc82cf7f0182b942a2cfad4a0d167f364bfbf18f434e100a2fe62bc88547ac9b'; \
+			;; \
+		'i386') \
+			url='https://downloads.python.org/pypy/pypy3.6-v7.3.3-linux32.tar.bz2'; \
+			sha256='f183c61e66fd2c536a65695bd7ff770748c2884c235a589b9c6ac63690770c69'; \
+			;; \
+		's390x') \
+			url='https://downloads.python.org/pypy/pypy3.6-v7.3.3-s390x.tar.bz2'; \
+			sha256='0de9c33ff3500c6e7fd273d0a6d341bc839b0298f697c4d6fe141f2b54c5c3e2'; \
+			;; \
 		*) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding PyPy $PYPY_VERSION binary release"; exit 1 ;; \
 	esac; \
 	\
@@ -43,14 +56,23 @@ RUN set -ex; \
 # (so we'll add them temporarily, then use "ldd" later to determine which to keep based on usage per architecture)
 	; \
 	\
-	wget -O pypy.tar.bz2 "https://downloads.python.org/pypy/pypy3.6-v${PYPY_VERSION}-${pypyArch}.tar.bz2" --progress=dot:giga; \
-	echo "$sha256 *pypy.tar.bz2" | sha256sum -c; \
+	wget -O pypy.tar.bz2 "$url" --progress=dot:giga; \
+	echo "$sha256 *pypy.tar.bz2" | sha256sum --check --strict -; \
 	mkdir /opt/pypy; \
 	tar -xjC /opt/pypy --strip-components=1 -f pypy.tar.bz2; \
 	find /opt/pypy/lib-python -depth -type d -a \( -name test -o -name tests \) -exec rm -rf '{}' +; \
 	rm pypy.tar.bz2; \
 	\
-	ln -svT '/opt/pypy/bin/pypy3' '/usr/local/bin/pypy3'; \
+# https://github.com/docker-library/pypy/issues/49
+	wget -O import.patch 'https://foss.heptapod.net/pypy/pypy/-/commit/16faa2be85839e6ab4fb8ee09298a4d934aab81f.patch'; \
+	echo '2d4bcc434077685a4ff26c1c1f28109ff67ef7e68f1f831ce0f2d9ddd6a194d0 *import.patch' | sha256sum --check --strict -; \
+	wget -O crypt-utf8.patch 'https://foss.heptapod.net/pypy/pypy/-/commit/c63da169246ed972fe90e1c289fc2378236fa852.patch'; \
+	echo 'ab1529948c49fd29fb76b3c20ec7d3d9c50603aa0c549a8a31339eb940e0f4d3 *crypt-utf8.patch' | sha256sum --check --strict -; \
+	patch --input="$PWD/import.patch" --directory=/opt/pypy --strip=1; \
+	patch --input="$PWD/crypt-utf8.patch" --directory=/opt/pypy --strip=1; \
+	rm import.patch crypt-utf8.patch; \
+	\
+	ln -sv '/opt/pypy/bin/pypy3' /usr/local/bin/; \
 	\
 # smoke test
 	pypy3 --version; \
@@ -103,7 +125,7 @@ RUN set -ex; \
 	pypy3 get-pip.py \
 		--disable-pip-version-check \
 		--no-cache-dir \
-		"pip==$PYTHON_PIP_VERSION" \
+		"pip == $PYTHON_PIP_VERSION" \
 	; \
 # smoke test
 	pip --version; \
diff --git a/pypy_slim-buster/Dockerfile b/pypy_slim-buster/Dockerfile
index c1a08fc..f60298b 100644
--- a/pypy_slim-buster/Dockerfile
+++ b/pypy_slim-buster/Dockerfile
@@ -1,32 +1,45 @@
-FROM debian:buster-slim
+#
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
+#
+# PLEASE DO NOT EDIT IT DIRECTLY.
+#
 
-# http://bugs.python.org/issue19846
-# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
-ENV LANG C.UTF-8
+FROM debian:buster-slim
 
 RUN set -eux; \
 	apt-get update; \
 	apt-get install -y --no-install-recommends ca-certificates; \
 	rm -rf /var/lib/apt/lists/*
 
-# ensure local pypy is preferred over distribution pypy
+# http://bugs.python.org/issue19846
+# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
+ENV LANG C.UTF-8
+
+# ensure local pypy3 is preferred over distribution pypy3
 ENV PATH /opt/pypy/bin:$PATH
 
 ENV PYPY_VERSION 7.3.3
 
-RUN set -ex; \
+RUN set -eux; \
 	\
-# this "case" statement is generated via "update.sh"
 	dpkgArch="$(dpkg --print-architecture)"; \
 	case "${dpkgArch##*-}" in \
-# amd64
-		amd64) pypyArch='linux64'; sha256='4fb85fdd516482cab727bb9473b066ff8fb672940dedf7ccc32bf92957d29e0a' ;; \
-# arm64v8
-		arm64) pypyArch='aarch64'; sha256='bc82cf7f0182b942a2cfad4a0d167f364bfbf18f434e100a2fe62bc88547ac9b' ;; \
-# i386
-		i386) pypyArch='linux32'; sha256='f183c61e66fd2c536a65695bd7ff770748c2884c235a589b9c6ac63690770c69' ;; \
-# s390x
-		s390x) pypyArch='s390x'; sha256='0de9c33ff3500c6e7fd273d0a6d341bc839b0298f697c4d6fe141f2b54c5c3e2' ;; \
+		'amd64') \
+			url='https://downloads.python.org/pypy/pypy3.6-v7.3.3-linux64.tar.bz2'; \
+			sha256='4fb85fdd516482cab727bb9473b066ff8fb672940dedf7ccc32bf92957d29e0a'; \
+			;; \
+		'arm64') \
+			url='https://downloads.python.org/pypy/pypy3.6-v7.3.3-aarch64.tar.bz2'; \
+			sha256='bc82cf7f0182b942a2cfad4a0d167f364bfbf18f434e100a2fe62bc88547ac9b'; \
+			;; \
+		'i386') \
+			url='https://downloads.python.org/pypy/pypy3.6-v7.3.3-linux32.tar.bz2'; \
+			sha256='f183c61e66fd2c536a65695bd7ff770748c2884c235a589b9c6ac63690770c69'; \
+			;; \
+		's390x') \
+			url='https://downloads.python.org/pypy/pypy3.6-v7.3.3-s390x.tar.bz2'; \
+			sha256='0de9c33ff3500c6e7fd273d0a6d341bc839b0298f697c4d6fe141f2b54c5c3e2'; \
+			;; \
 		*) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding PyPy $PYPY_VERSION binary release"; exit 1 ;; \
 	esac; \
 	\
@@ -34,6 +47,7 @@ RUN set -ex; \
 	apt-get update; \
 	apt-get install -y --no-install-recommends \
 		bzip2 \
+		patch \
 		wget \
 # sometimes "pypy3" itself is linked against libexpat1 / libncurses5, sometimes they're ".so" files in "/opt/pypy/lib_pypy"
 		libexpat1 \
@@ -41,14 +55,23 @@ RUN set -ex; \
 # (so we'll add them temporarily, then use "ldd" later to determine which to keep based on usage per architecture)
 	; \
 	\
-	wget -O pypy.tar.bz2 "https://downloads.python.org/pypy/pypy3.6-v${PYPY_VERSION}-${pypyArch}.tar.bz2" --progress=dot:giga; \
-	echo "$sha256 *pypy.tar.bz2" | sha256sum -c; \
+	wget -O pypy.tar.bz2 "$url" --progress=dot:giga; \
+	echo "$sha256 *pypy.tar.bz2" | sha256sum --check --strict -; \
 	mkdir /opt/pypy; \
 	tar -xjC /opt/pypy --strip-components=1 -f pypy.tar.bz2; \
 	find /opt/pypy/lib-python -depth -type d -a \( -name test -o -name tests \) -exec rm -rf '{}' +; \
 	rm pypy.tar.bz2; \
 	\
-	ln -svT '/opt/pypy/bin/pypy3' '/usr/local/bin/pypy3'; \
+# https://github.com/docker-library/pypy/issues/49
+	wget -O import.patch 'https://foss.heptapod.net/pypy/pypy/-/commit/16faa2be85839e6ab4fb8ee09298a4d934aab81f.patch'; \
+	echo '2d4bcc434077685a4ff26c1c1f28109ff67ef7e68f1f831ce0f2d9ddd6a194d0 *import.patch' | sha256sum --check --strict -; \
+	wget -O crypt-utf8.patch 'https://foss.heptapod.net/pypy/pypy/-/commit/c63da169246ed972fe90e1c289fc2378236fa852.patch'; \
+	echo 'ab1529948c49fd29fb76b3c20ec7d3d9c50603aa0c549a8a31339eb940e0f4d3 *crypt-utf8.patch' | sha256sum --check --strict -; \
+	patch --input="$PWD/import.patch" --directory=/opt/pypy --strip=1; \
+	patch --input="$PWD/crypt-utf8.patch" --directory=/opt/pypy --strip=1; \
+	rm import.patch crypt-utf8.patch; \
+	\
+	ln -sv '/opt/pypy/bin/pypy3' /usr/local/bin/; \
 	\
 # smoke test
 	pypy3 --version; \
@@ -97,9 +120,7 @@ ENV PYTHON_GET_PIP_SHA256 95c5ee602b2f3cc50ae053d716c3c89bea62c58568f64d7d25924d
 
 RUN set -ex; \
 	apt-get update; \
-	apt-get install -y --no-install-recommends \
-		wget \
-	; \
+	apt-get install -y --no-install-recommends wget; \
 	rm -rf /var/lib/apt/lists/*; \
 	\
 	wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \
@@ -108,7 +129,7 @@ RUN set -ex; \
 	pypy3 get-pip.py \
 		--disable-pip-version-check \
 		--no-cache-dir \
-		"pip==$PYTHON_PIP_VERSION" \
+		"pip == $PYTHON_PIP_VERSION" \
 	; \
 	apt-get purge -y --auto-remove wget; \
 # smoke test

@yosifkit yosifkit merged commit bb59b91 into docker-library:master Feb 18, 2021
@yosifkit yosifkit deleted the pypy branch February 18, 2021 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants