Skip to content

Commit

Permalink
build: install pypy3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangt2333 committed Mar 30, 2024
1 parent 9964a9b commit 5355676
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ RUN for PYTHON_VERSION in 3.6 3.11; do \
&& /opt/python/${PYTHON_VERSION}/bin/python -m pip install --upgrade pip \
; done

COPY docker/install-pypy.sh install-pypy.sh
RUN bash install-pypy.sh \
&& rm -rf /opt/conda \
&& ls -l /opt

# ---------------------------------------------
FROM basic

Expand All @@ -49,10 +54,12 @@ COPY docker/checkers/ /checkers/
COPY --from=sduoj/docker-compose-wait:latest /wait /wait

# install Python(s)
COPY --from=py-builder /opt/python/ /opt/python/
COPY --from=py-builder /opt/ /opt/
RUN ln -s /opt/python/3.11/bin/python /usr/bin/python3 \
&& ln -s /opt/python/3.11/bin/python /usr/bin/python3.11 \
&& ln -s /opt/python/3.6/bin/python /usr/bin/python3.6
&& ln -s /opt/python/3.6/bin/python /usr/bin/python3.6 \
&& ln -s /opt/pypy/3.10/bin/pypy /usr/bin/pypy3 \
&& ln -s /opt/pypy/3.10/bin/pypy /usr/bin/pypy3.10

# install JDK(s)
ENV JAVA_HOME=/opt/java/openjdk
Expand Down
33 changes: 33 additions & 0 deletions docker/install-pypy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

set -eux

dpkgArch="$(dpkg --print-architecture)"

# install pypy3.10-v7.3.15
case "${dpkgArch##*-}" in
'amd64')
url='https://downloads.python.org/pypy/pypy3.10-v7.3.15-linux64.tar.bz2'
sha256='33c584e9a70a71afd0cb7dd8ba9996720b911b3b8ed0156aea298d4487ad22c3'
;;
'arm64')
url='https://downloads.python.org/pypy/pypy3.10-v7.3.15-aarch64.tar.bz2'
sha256='52146fccaf64e87e71d178dda8de63c01577ec3923073dc69e1519622bcacb74'
;;
'i386')
url='https://downloads.python.org/pypy/pypy3.10-v7.3.15-linux32.tar.bz2'
sha256='75dd58c9abd8b9d78220373148355bc3119febcf27a2c781d64ad85e7232c4aa'
;;
's390x')
url='https://downloads.python.org/pypy/pypy3.10-v7.3.15-s390x.tar.bz2'
sha256='209e57596381e13c9914d1332f359dc4b78de06576739747eb797bdbf85062b8'
;;
*)
echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding PyPy $PYPY_VERSION binary release"
exit 1
;;
esac
wget -O pypy.tar.bz2 "$url" --progress=dot:giga
echo "$sha256 *pypy.tar.bz2" | sha256sum --check --strict -
mkdir -p /opt/pypy/3.10
tar -xjC /opt/pypy/3.10 --strip-components=1 -f pypy.tar.bz2

0 comments on commit 5355676

Please sign in to comment.