Skip to content

Commit

Permalink
Merge pull request #50 from rust-cross/revert-42-main
Browse files Browse the repository at this point in the history
Revert "build cross python from scratch for aarch64"
  • Loading branch information
messense authored Jul 16, 2023
2 parents e7eccfd + de49315 commit 362962b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 170 deletions.
88 changes: 3 additions & 85 deletions manylinux2014/aarch64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
FROM quay.io/pypa/manylinux2014_aarch64 AS manylinux

FROM ubuntu:20.04 AS toolchain

Expand Down Expand Up @@ -122,92 +123,9 @@ RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else expor
curl -sqL https://downloads.python.org/pypy/pypy3.10-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.10 --strip-components=1 && \
ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10

COPY --from=manylinux /opt/_internal /opt/_internal
COPY --from=manylinux /opt/python /opt/python

RUN mkdir -p /opt/python

RUN cd /tmp && \
VERS=3.7.16 && PREFIX=/opt/python/cp37-cp37m && \
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=aarch64-unknown-linux-gnu --target=aarch64-unknown-linux-gnu --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-linux-gnu --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
make -j4 && make -j4 install && \
rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \
# we don't need libpython*.a, and they're many megabytes
find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \
# We do not need the Python test suites
find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \
# We do not need precompiled .pyc and .pyo files.
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete

RUN cd /tmp && \
VERS=3.8.16 && PREFIX=/opt/python/cp38-cp38 && \
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=aarch64-unknown-linux-gnu --target=aarch64-unknown-linux-gnu --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-linux-gnu --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
make -j4 && make -j4 install && \
rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \
# we don't need libpython*.a, and they're many megabytes
find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \
# We do not need the Python test suites
find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \
# We do not need precompiled .pyc and .pyo files.
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete

RUN cd /tmp && \
VERS=3.9.16 && PREFIX=/opt/python/cp39-cp39 && \
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=aarch64-unknown-linux-gnu --target=aarch64-unknown-linux-gnu --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-linux-gnu --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
make -j4 && make -j4 install && \
rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \
# we don't need libpython*.a, and they're many megabytes
find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \
# We do not need the Python test suites
find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \
# We do not need precompiled .pyc and .pyo files.
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete

RUN cd /tmp && \
VERS=3.10.9 && PREFIX=/opt/python/cp310-cp310 && \
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=aarch64-unknown-linux-gnu --target=aarch64-unknown-linux-gnu --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-linux-gnu --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
make -j4 && make -j4 install && \
rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \
# we don't need libpython*.a, and they're many megabytes
find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \
# We do not need the Python test suites
find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \
# We do not need precompiled .pyc and .pyo files.
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete

RUN cd /tmp && \
VERS=3.11.3 && PREFIX=/opt/python/cp311-cp311 && \
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=aarch64-unknown-linux-gnu --target=aarch64-unknown-linux-gnu --prefix=$PREFIX --disable-shared --with-build-python=python3.11 --with-ensurepip=no --build=$(uname -m)-linux-gnu --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
make -j4 && make -j4 install && \
rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \
# we don't need libpython*.a, and they're many megabytes
find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \
# We do not need the Python test suites
find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \
# We do not need precompiled .pyc and .pyo files.
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete

RUN cd /tmp && \
VERS=3.12.0b1 && PREFIX=/opt/python/cp312-cp312 && \
curl -LO https://www.python.org/ftp/python/3.12.0/Python-$VERS.tgz && \
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=aarch64-unknown-linux-gnu --target=aarch64-unknown-linux-gnu --prefix=$PREFIX --disable-shared --with-build-python=python3.12 --with-ensurepip=no --build=$(uname -m)-linux-gnu --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
make -j4 && make -j4 install && \
rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \
# we don't need libpython*.a, and they're many megabytes
find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \
# We do not need the Python test suites
find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \
# We do not need precompiled .pyc and .pyo files.
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete
RUN for VER in 3.12 3.11 3.7 3.8 3.9 3.10; do curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; done && \
for VER in 3.7 3.8 3.9 3.10; do curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; done && \
for VER in 3.12 3.11 3.7 3.8 3.9 3.10; do "python$VER" -m pip install --no-cache-dir cffi; done && \
Expand Down
88 changes: 3 additions & 85 deletions manylinux_2_28/aarch64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
FROM quay.io/pypa/manylinux_2_28_aarch64 AS manylinux

FROM ubuntu:22.04 AS toolchain

Expand Down Expand Up @@ -122,92 +123,9 @@ RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else expor
curl -sqL https://downloads.python.org/pypy/pypy3.10-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.10 --strip-components=1 && \
ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10

COPY --from=manylinux /opt/_internal /opt/_internal
COPY --from=manylinux /opt/python /opt/python

RUN mkdir -p /opt/python

RUN cd /tmp && \
VERS=3.7.16 && PREFIX=/opt/python/cp37-cp37m && \
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=aarch64-unknown-linux-gnu --target=aarch64-unknown-linux-gnu --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-linux-gnu --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
make -j4 && make -j4 install && \
rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \
# we don't need libpython*.a, and they're many megabytes
find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \
# We do not need the Python test suites
find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \
# We do not need precompiled .pyc and .pyo files.
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete

RUN cd /tmp && \
VERS=3.8.16 && PREFIX=/opt/python/cp38-cp38 && \
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=aarch64-unknown-linux-gnu --target=aarch64-unknown-linux-gnu --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-linux-gnu --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
make -j4 && make -j4 install && \
rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \
# we don't need libpython*.a, and they're many megabytes
find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \
# We do not need the Python test suites
find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \
# We do not need precompiled .pyc and .pyo files.
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete

RUN cd /tmp && \
VERS=3.9.16 && PREFIX=/opt/python/cp39-cp39 && \
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=aarch64-unknown-linux-gnu --target=aarch64-unknown-linux-gnu --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-linux-gnu --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
make -j4 && make -j4 install && \
rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \
# we don't need libpython*.a, and they're many megabytes
find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \
# We do not need the Python test suites
find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \
# We do not need precompiled .pyc and .pyo files.
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete

RUN cd /tmp && \
VERS=3.10.9 && PREFIX=/opt/python/cp310-cp310 && \
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=aarch64-unknown-linux-gnu --target=aarch64-unknown-linux-gnu --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-linux-gnu --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
make -j4 && make -j4 install && \
rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \
# we don't need libpython*.a, and they're many megabytes
find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \
# We do not need the Python test suites
find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \
# We do not need precompiled .pyc and .pyo files.
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete

RUN cd /tmp && \
VERS=3.11.3 && PREFIX=/opt/python/cp311-cp311 && \
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=aarch64-unknown-linux-gnu --target=aarch64-unknown-linux-gnu --prefix=$PREFIX --disable-shared --with-build-python=python3.11 --with-ensurepip=no --build=$(uname -m)-linux-gnu --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
make -j4 && make -j4 install && \
rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \
# we don't need libpython*.a, and they're many megabytes
find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \
# We do not need the Python test suites
find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \
# We do not need precompiled .pyc and .pyo files.
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete

RUN cd /tmp && \
VERS=3.12.0b1 && PREFIX=/opt/python/cp312-cp312 && \
curl -LO https://www.python.org/ftp/python/3.12.0/Python-$VERS.tgz && \
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=aarch64-unknown-linux-gnu --target=aarch64-unknown-linux-gnu --prefix=$PREFIX --disable-shared --with-build-python=python3.12 --with-ensurepip=no --build=$(uname -m)-linux-gnu --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
make -j4 && make -j4 install && \
rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \
# we don't need libpython*.a, and they're many megabytes
find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \
# We do not need the Python test suites
find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \
# We do not need precompiled .pyc and .pyo files.
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete
RUN for VER in 3.12 3.11 3.7 3.8 3.9 3.10; do curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; done && \
for VER in 3.7 3.8 3.9 3.10; do curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; done && \
for VER in 3.12 3.11 3.7 3.8 3.9 3.10; do "python$VER" -m pip install --no-cache-dir cffi; done && \
Expand Down
3 changes: 3 additions & 0 deletions render.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"manylinux2014": [
{
"arch": "aarch64",
"manylinux": "quay.io/pypa/manylinux2014_aarch64",
"ct_ng_version": MANYLINUX2014_CT_NG_VERSION,
"toolchain_os": MANYLINUX2014_TOOLCHAIN_OS,
"target": "aarch64-unknown-linux-gnu",
Expand Down Expand Up @@ -63,6 +64,7 @@
"manylinux_2_28": [
{
"arch": "aarch64",
"manylinux": "quay.io/pypa/manylinux_2_28_aarch64",
"ct_ng_version": MANYLINUX_2_28_CT_NG_VERSION,
"toolchain_os": TOOLCHAIN_OS,
"target": "aarch64-unknown-linux-gnu",
Expand Down Expand Up @@ -97,6 +99,7 @@
"musllinux_1_2": [
{
"arch": "aarch64",
"musllinux": "quay.io/pypa/musllinux_1_1_aarch64",
"base": "messense/rust-musl-cross:aarch64-musl",
"target": "aarch64-unknown-linux-gnu",
},
Expand Down

0 comments on commit 362962b

Please sign in to comment.