Skip to content

Commit 75f4f14

Browse files
committed
tiericpc: build pypy3 from source
1 parent d5155f8 commit 75f4f14

File tree

2 files changed

+27
-10
lines changed

2 files changed

+27
-10
lines changed

.github/workflows/docker.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ jobs:
3333
docker push vnoj/runtimes-tier2:amd64-latest
3434
docker push vnoj/runtimes-tier3:amd64-latest
3535
docker push vnoj/runtimes-tiericpc:amd64-latest
36+
docker run -v "$(pwd)":/code mplatform/manifest-tool \
37+
--username="$DOCKER_USERNAME" --password="$DOCKER_PASSWORD" \
38+
push from-spec /code/tiericpc/manifest.yml
3639
docker run -v "$(pwd)":/code mplatform/manifest-tool \
3740
--username="$DOCKER_USERNAME" --password="$DOCKER_PASSWORD" \
3841
push from-spec /code/tier1/manifest.yml
@@ -42,9 +45,6 @@ jobs:
4245
docker run -v "$(pwd)":/code mplatform/manifest-tool \
4346
--username="$DOCKER_USERNAME" --password="$DOCKER_PASSWORD" \
4447
push from-spec /code/tier3/manifest.yml
45-
docker run -v "$(pwd)":/code mplatform/manifest-tool \
46-
--username="$DOCKER_USERNAME" --password="$DOCKER_PASSWORD" \
47-
push from-spec /code/tiericpc/manifest.yml
4848
env:
4949
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
5050
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

tiericpc/Dockerfile

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:jammy
1+
FROM ubuntu:jammy AS base
22

33
RUN apt-get update && \
44
apt-get install -y --no-install-recommends \
@@ -26,17 +26,34 @@ RUN if [ "$(arch)" = x86_64 ]; then DEB_ARCH=amd64; else DEB_ARCH=arm64; fi && \
2626
curl -L -O $GCC_FILES_URL/libtsan0_11.3.0-1ubuntu1~22.04_$DEB_ARCH.deb && \
2727
dpkg -i *.deb && rm *.deb
2828

29-
RUN if [ "$(arch)" = x86_64 ]; then PYPY_ARCH=linux64; else PYPY_ARCH="$(arch)"; fi && \
30-
mkdir /opt/pypy3 && curl -L "https://downloads.python.org/pypy/pypy3.9-v7.3.10-$PYPY_ARCH.tar.bz2" | \
31-
tar xj -C /opt/pypy3 --strip-components=1 && /opt/pypy3/bin/pypy -mcompileall && \
32-
rm -f /opt/pypy3/bin/python*
33-
3429
RUN curl -L -okotlin.zip https://github.com/JetBrains/kotlin/releases/download/v1.7.21/kotlin-compiler-1.7.21.zip && \
3530
unzip kotlin.zip && mv kotlinc /opt/kotlin && rm kotlin.zip
3631

3732
RUN apt-get clean && rm -rf /var/lib/apt/lists/* && \
3833
useradd -m judge
3934

40-
ENV PATH="/opt/kotlin/bin:/opt/pypy3/bin:${PATH}"
35+
FROM base AS build
36+
37+
RUN apt-get update && apt-get install -y dpkg-dev devscripts equivs
38+
39+
RUN mkdir /build-pypy3 && \
40+
cd /build-pypy3 && \
41+
curl -L -O https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/pypy3/7.3.10+dfsg-1/pypy3_7.3.10+dfsg-1.dsc && \
42+
curl -L -O https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/pypy3/7.3.10+dfsg-1/pypy3_7.3.10+dfsg.orig-cpython27.tar.xz && \
43+
curl -L -O https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/pypy3/7.3.10+dfsg-1/pypy3_7.3.10+dfsg.orig.tar.xz && \
44+
curl -L -O https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/pypy3/7.3.10+dfsg-1/pypy3_7.3.10+dfsg-1.debian.tar.xz && \
45+
dpkg-source -x pypy3_7.3.10+dfsg-1.dsc && \
46+
cd pypy3-7.3.10+dfsg && \
47+
mk-build-deps && apt-get install -y ./pypy3-build-deps_7.3.10+dfsg-1_all.deb && \
48+
dpkg-buildpackage -us -uc -b
49+
50+
FROM base AS main
51+
52+
COPY --from=build /build-pypy3/pypy3-lib_7.3.10+dfsg-1_amd64.deb pypy3-lib_7.3.10+dfsg-1_amd64.deb
53+
COPY --from=build /build-pypy3/pypy3_7.3.10+dfsg-1_amd64.deb pypy3_7.3.10+dfsg-1_amd64.deb
54+
55+
RUN dpkg -i pypy3-lib_7.3.10+dfsg-1_amd64.deb && dpkg -i pypy3_7.3.10+dfsg-1_amd64.deb && rm -rf *.deb
56+
57+
ENV PATH="/opt/kotlin/bin:${PATH}"
4158

4259
ENTRYPOINT ["/usr/bin/tini", "/code/run"]

0 commit comments

Comments
 (0)