├── .github ├── FUNDING.yml ├── bors.toml ├── dependabot.yml └── workflows │ ├── Build.yml │ ├── Test.yml │ └── scorecards.yml ├── .gitignore ├── CODEOWNERS ├── Dockerfile.j2 ├── LICENSE ├── README.md ├── manylinux2014 ├── aarch64 │ ├── .config │ └── Dockerfile ├── armv7l │ ├── .config │ └── Dockerfile ├── i686 │ ├── .config │ └── Dockerfile ├── ppc64 │ ├── .config │ └── Dockerfile ├── ppc64le │ ├── .config │ └── Dockerfile ├── s390x │ ├── .config │ └── Dockerfile └── x86_64 │ ├── .config │ └── Dockerfile ├── manylinux_2_28 ├── aarch64 │ ├── .config │ └── Dockerfile ├── armv7l │ ├── .config │ └── Dockerfile ├── ppc64le │ ├── .config │ └── Dockerfile ├── s390x │ ├── .config │ └── Dockerfile └── x86_64 │ ├── .config │ └── Dockerfile ├── manylinux_2_31 └── riscv64 │ ├── .config │ └── Dockerfile ├── manylinux_2_36 └── loongarch64 │ ├── .config │ └── Dockerfile ├── musllinux_1_2 ├── aarch64 │ └── Dockerfile ├── armv7l │ └── Dockerfile ├── i686 │ └── Dockerfile ├── loongarch64 │ ├── .config │ └── Dockerfile └── x86_64 │ └── Dockerfile ├── pyo3-test ├── Cargo.lock ├── Cargo.toml ├── pyproject.toml ├── setup.py └── src │ └── lib.rs └── render.py /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: messense 2 | -------------------------------------------------------------------------------- /.github/bors.toml: -------------------------------------------------------------------------------- 1 | delete_merged_branches = true 2 | required_approvals = 0 3 | use_codeowners = false 4 | status = ["conclusion"] 5 | timeout_sec = 21600 6 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "github-actions" 9 | directory: "/" 10 | schedule: 11 | interval: "monthly" 12 | -------------------------------------------------------------------------------- /.github/workflows/Test.yml: -------------------------------------------------------------------------------- 1 | on: 2 | workflow_dispatch: 3 | 4 | name: Test 5 | 6 | jobs: 7 | test-maturin: 8 | name: Test maturin (${{ matrix.arch }}, ${{ matrix.python.version }}, ${{ matrix.manylinux }}) 9 | runs-on: ubuntu-latest 10 | strategy: 11 | fail-fast: false 12 | matrix: 13 | python: [ 14 | { version: '3.7', abi: 'cp37-cp37m' }, 15 | { version: '3.8', abi: 'cp38-cp38' }, 16 | { version: '3.9', abi: 'cp39-cp39' }, 17 | { version: '3.10', abi: 'cp310-cp310' }, 18 | ] 19 | arch: [aarch64, armv7, s390x, ppc64le] 20 | manylinux: [manylinux2014, manylinux_2_28] 21 | steps: 22 | - uses: actions/checkout@v4 23 | - name: Build Wheel 24 | uses: messense/maturin-action@v1 25 | env: 26 | PYO3_CROSS_LIB_DIR: /opt/python/${{ matrix.python.abi }}/lib 27 | with: 28 | target: ${{ matrix.arch }} 29 | manylinux: ${{ matrix.manylinux }} 30 | args: -i python3.9 --release --out dist -m pyo3-test/Cargo.toml 31 | - name: Upload wheels 32 | uses: actions/upload-artifact@v4 33 | with: 34 | name: wheels-maturin 35 | path: dist 36 | 37 | test-maturin-wheels: 38 | name: Test maturin built wheels 39 | runs-on: ubuntu-latest 40 | needs: [ test-maturin ] 41 | strategy: 42 | matrix: 43 | arch: ['aarch64', 'armv7', 's390x', 'ppc64le'] 44 | steps: 45 | - uses: actions/download-artifact@v4 46 | with: 47 | name: wheels-maturin 48 | - uses: uraimo/run-on-arch-action@v3.0.1 49 | name: Install built wheel 50 | with: 51 | arch: ${{ matrix.arch }} 52 | distro: ubuntu20.04 53 | githubToken: ${{ github.token }} 54 | dockerRunArgs: | 55 | --volume "${PWD}:/io" 56 | install: | 57 | apt-get update 58 | apt-get install -y --no-install-recommends python3 python3-distutils software-properties-common curl 59 | add-apt-repository ppa:deadsnakes/ppa 60 | apt-get update 61 | apt-get install -y python3.7 python3.7-distutils python3.9 python3.9-distutils python3.10 python3.10-distutils 62 | for VER in 3.7 3.8 3.9 3.10; do curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; done 63 | run: | 64 | for VER in 3.7 3.8 3.9 3.10; do 65 | PYTHON="python$VER" 66 | $PYTHON -m pip install pyo3-test --no-index --find-links /io --force-reinstall 67 | $PYTHON -c 'import pyo3_test; assert pyo3_test.fourtytwo == 42' 68 | done 69 | 70 | test-setuptools-rust: 71 | name: Test setuptools-rust (${{ matrix.platform.arch }}, ${{ matrix.python.version }}, ${{ matrix.manylinux }}) 72 | runs-on: ubuntu-latest 73 | # needs: [ build ] 74 | strategy: 75 | matrix: 76 | python: [ 77 | { version: '3.7', name: 'cp37-cp37m' }, 78 | { version: '3.8', name: 'cp38-cp38' }, 79 | { version: '3.9', name: 'cp39-cp39' }, 80 | { version: '3.10', name: 'cp310-cp310' }, 81 | ] 82 | platform: [ 83 | { target: "aarch64-unknown-linux-gnu", arch: "aarch64" }, 84 | { target: "armv7-unknown-linux-gnueabihf", arch: "armv7" }, 85 | { target: "s390x-unknown-linux-gnu", arch: "s390x" }, 86 | { target: "powerpc64le-unknown-linux-gnu", arch: "ppc64le" }, 87 | ] 88 | manylinux: [manylinux2014, manylinux_2_28] 89 | container: 90 | image: docker://messense/${{ matrix.manylinux }}-cross:${{ matrix.platform.arch }} 91 | steps: 92 | - uses: actions/checkout@v4 93 | - uses: actions-rs/toolchain@v1 94 | with: 95 | profile: minimal 96 | toolchain: stable 97 | override: true 98 | target: ${{ matrix.platform.target }} 99 | - name: Build Wheels 100 | env: 101 | PLAT_NAME: manylinux2014_${{ matrix.platform.arch }} 102 | shell: bash -e {0} 103 | run: | 104 | PYTHON=python${{ matrix.python.version }} 105 | $PYTHON -m pip install 'crossenv>=1.1.2' 106 | cd pyo3-test 107 | $PYTHON -m crossenv /opt/python/${{ matrix.python.name }}/bin/python3 --cc $TARGET_CC --cxx $TARGET_CXX --sysroot $TARGET_SYSROOT --env LIBRARY_PATH= venv 108 | . venv/bin/activate 109 | build-pip install wheel "setuptools>=62.4" 110 | pip install -U pip wheel setuptools-rust 111 | export PYO3_CROSS_LIB_DIR="$PWD/venv/lib" 112 | python setup.py bdist_wheel --dist-dir ../dist/ 113 | ls -lrth ../dist/ 114 | - name: Audit Wheel Symbols 115 | shell: bash -e {0} 116 | run: | 117 | for whl in dist/pyo3_test*.whl; do 118 | auditwheel-symbols "$whl" 119 | done 120 | - name: Upload wheels 121 | uses: actions/upload-artifact@v4 122 | with: 123 | name: wheels-setuptools-rust 124 | path: dist 125 | 126 | test-setuptools-rust-wheels: 127 | name: Test setuptools-rust built wheels 128 | runs-on: ubuntu-latest 129 | needs: [ test-setuptools-rust ] 130 | strategy: 131 | matrix: 132 | arch: ['aarch64', 'armv7', 's390x', 'ppc64le'] 133 | steps: 134 | - uses: actions/download-artifact@v4 135 | with: 136 | name: wheels-setuptools-rust 137 | - uses: uraimo/run-on-arch-action@v3.0.1 138 | name: Install built wheel 139 | with: 140 | arch: ${{ matrix.arch }} 141 | distro: ubuntu20.04 142 | githubToken: ${{ github.token }} 143 | dockerRunArgs: | 144 | --volume "${PWD}:/io" 145 | install: | 146 | apt-get update 147 | apt-get install -y --no-install-recommends python3 python3-distutils software-properties-common curl 148 | add-apt-repository ppa:deadsnakes/ppa 149 | apt-get update 150 | apt-get install -y python3.7 python3.7-distutils python3.9 python3.9-distutils python3.10 python3.10-distutils 151 | for VER in 3.7 3.8 3.9 3.10; do curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; done 152 | run: | 153 | for VER in 3.7 3.8 3.9 3.10; do 154 | PYTHON="python$VER" 155 | $PYTHON -m pip install pyo3-test --no-index --find-links /io --force-reinstall 156 | $PYTHON -c 'import pyo3_test; assert pyo3_test.fourtytwo == 42' 157 | done 158 | -------------------------------------------------------------------------------- /.github/workflows/scorecards.yml: -------------------------------------------------------------------------------- 1 | # This workflow uses actions that are not certified by GitHub. They are provided 2 | # by a third-party and are governed by separate terms of service, privacy 3 | # policy, and support documentation. 4 | 5 | name: Scorecards supply-chain security 6 | on: 7 | # For Branch-Protection check. Only the default branch is supported. See 8 | # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection 9 | branch_protection_rule: 10 | # To guarantee Maintained check is occasionally updated. See 11 | # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained 12 | schedule: 13 | - cron: '35 13 * * 5' 14 | push: 15 | branches: [ "main" ] 16 | 17 | # Declare default permissions as read only. 18 | permissions: read-all 19 | 20 | jobs: 21 | analysis: 22 | name: Scorecards analysis 23 | runs-on: ubuntu-latest 24 | permissions: 25 | # Needed to upload the results to code-scanning dashboard. 26 | security-events: write 27 | # Needed to publish results and get a badge (see publish_results below). 28 | id-token: write 29 | # Uncomment the permissions below if installing in a private repository. 30 | # contents: read 31 | # actions: read 32 | 33 | steps: 34 | - name: "Checkout code" 35 | uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 36 | with: 37 | persist-credentials: false 38 | 39 | - name: "Run analysis" 40 | uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2 41 | with: 42 | results_file: results.sarif 43 | results_format: sarif 44 | # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: 45 | # - you want to enable the Branch-Protection check on a *public* repository, or 46 | # - you are installing Scorecards on a *private* repository 47 | # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat. 48 | # repo_token: ${{ secrets.SCORECARD_TOKEN }} 49 | 50 | # Public repositories: 51 | # - Publish results to OpenSSF REST API for easy access by consumers 52 | # - Allows the repository to include the Scorecard badge. 53 | # - See https://github.com/ossf/scorecard-action#publishing-results. 54 | # For private repositories: 55 | # - `publish_results` will always be set to `false`, regardless 56 | # of the value entered here. 57 | publish_results: true 58 | 59 | # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF 60 | # format to the repository Actions tab. 61 | - name: "Upload artifact" 62 | uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 63 | with: 64 | name: SARIF file 65 | path: results.sarif 66 | retention-days: 5 67 | 68 | # Upload the results to GitHub's code scanning dashboard. 69 | - name: "Upload to code-scanning" 70 | uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 71 | with: 72 | sarif_file: results.sarif 73 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | include 3 | .config.old 4 | .config.before-* 5 | build/ 6 | *.egg-info 7 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | .github/workflows @messense 2 | -------------------------------------------------------------------------------- /Dockerfile.j2: -------------------------------------------------------------------------------- 1 | {% if manylinux -%} 2 | FROM {{ manylinux }} AS manylinux 3 | {% elif musllinux -%} 4 | FROM {{ musllinux }} as musllinux 5 | {% endif %} 6 | 7 | {%- if base %} 8 | FROM {{ base }} 9 | 10 | ENV TARGET_READELF={{ target }}-readelf 11 | {%- else %} 12 | FROM {{ toolchain_os }} AS toolchain 13 | {% endif %} 14 | 15 | {%- if ct_ng_version %} 16 | ENV DEBIAN_FRONTEND noninteractive 17 | 18 | RUN apt-get update && \ 19 | apt-get install --no-install-recommends -y \ 20 | automake \ 21 | bison \ 22 | bzip2 \ 23 | ca-certificates \ 24 | cmake \ 25 | curl \ 26 | file \ 27 | flex \ 28 | g++ \ 29 | gawk \ 30 | gdb \ 31 | git \ 32 | gperf \ 33 | help2man \ 34 | libncurses-dev \ 35 | libssl-dev \ 36 | libtool-bin \ 37 | lzip \ 38 | make \ 39 | ninja-build \ 40 | patch \ 41 | pkg-config \ 42 | python3 \ 43 | rsync \ 44 | sudo \ 45 | texinfo \ 46 | unzip \ 47 | wget \ 48 | xz-utils \ 49 | libssl-dev \ 50 | libffi-dev 51 | 52 | # Install crosstool-ng 53 | RUN curl -Lf https://github.com/crosstool-ng/crosstool-ng/archive/{{ ct_ng_version }}.tar.gz | tar xzf - && \ 54 | cd crosstool-ng-{{ ct_ng_version }} && \ 55 | {% if target.startswith('riscv64-') -%} 56 | # Backport https://github.com/crosstool-ng/crosstool-ng/pull/{2315,2316} to fix build 57 | curl -Lf https://github.com/crosstool-ng/crosstool-ng/pull/2315.patch | patch -Np1 && \ 58 | curl -Lf https://github.com/crosstool-ng/crosstool-ng/pull/2316.patch | patch -Np1 && \ 59 | {% endif -%} 60 | ./bootstrap && \ 61 | ./configure --prefix=/usr/local && \ 62 | make -j4 && \ 63 | make install && \ 64 | cd .. && rm -rf crosstool-ng-* 65 | 66 | COPY .config /tmp/toolchain.config 67 | 68 | # Build cross compiler 69 | RUN mkdir build && \ 70 | cd build && \ 71 | cp /tmp/toolchain.config .config && \ 72 | export CT_ALLOW_BUILD_AS_ROOT_SURE=1 && \ 73 | ct-ng build.2 || { tail -n 500 build.log; exit $ERRCODE; } && \ 74 | cd .. && \ 75 | rm -rf build 76 | 77 | FROM ubuntu:22.04 78 | 79 | # Copy cross toolchain 80 | COPY --from=toolchain /usr/{{ target }} /usr/{{ target }} 81 | 82 | ENV DEBIAN_FRONTEND noninteractive 83 | ENV PATH=$PATH:/usr/{{ target }}/bin 84 | 85 | ENV CC_{{ target | replace('ibm', 'unknown') | replace('-', '_') }}={{ target }}-gcc \ 86 | AR_{{ target | replace('ibm', 'unknown') | replace('-', '_') }}={{ target }}-ar \ 87 | CXX_{{ target | replace('ibm', 'unknown') | replace('-', '_') }}={{ target }}-g++ 88 | 89 | ENV TARGET_CC={{ target }}-gcc \ 90 | TARGET_AR={{ target }}-ar \ 91 | TARGET_RANLIB={{ target }}-ranlib \ 92 | TARGET_CXX={{ target }}-g++ \ 93 | TARGET_READELF={{ target }}-readelf \ 94 | TARGET_SYSROOT=/usr/{{ target }}/{{ target }}/sysroot/ \ 95 | TARGET_C_INCLUDE_PATH=/usr/{{ target }}/{{ target }}/sysroot/usr/include/ 96 | 97 | ENV CARGO_BUILD_TARGET={{ target | replace('ibm', 'unknown') | replace('riscv64', 'riscv64gc') }} 98 | ENV CARGO_TARGET_{{ target | replace('ibm', 'unknown') | replace('-', '_') | replace('riscv64', 'riscv64gc') | upper }}_LINKER={{ target }}-gcc 99 | RUN echo "set(CMAKE_SYSTEM_NAME Linux)\nset(CMAKE_SYSTEM_PROCESSOR {{ cmake_arch | default(arch) }})\nset(CMAKE_SYSROOT /usr/{{ target }}/{{ target }}/sysroot/)\nset(CMAKE_C_COMPILER {{ target }}-gcc)\nset(CMAKE_CXX_COMPILER {{ target }}-g++)" > /usr/{{ target }}/cmake-toolchain.cmake 100 | ENV TARGET_CMAKE_TOOLCHAIN_FILE_PATH=/usr/{{ target }}/cmake-toolchain.cmake 101 | {% endif %} 102 | 103 | RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ 104 | apt-get update && \ 105 | apt-get install --no-install-recommends -y \ 106 | curl \ 107 | git \ 108 | g++ \ 109 | make \ 110 | sudo \ 111 | wget \ 112 | software-properties-common \ 113 | gpg-agent \ 114 | cmake \ 115 | llvm-dev \ 116 | libclang-dev \ 117 | clang 118 | 119 | {% if not musllinux -%} 120 | ENV {{ target | replace('ibm', 'unknown') | replace('-', '_') | upper }}_OPENSSL_DIR=/usr/{{ target }}/ 121 | {% endif -%} 122 | RUN add-apt-repository -y ppa:deadsnakes/ppa && \ 123 | apt-get update && \ 124 | apt-get install -y \ 125 | python3.7 python3.7-venv python3.7-dev \ 126 | python3.8 python3.8-venv python3.8-dev \ 127 | python3.9 python3.9-venv python3.9-dev \ 128 | python3.11 python3.11-venv python3.11-dev \ 129 | python3.12 python3.12-venv python3.12-dev \ 130 | python3.13 python3.13-venv python3.13-dev \ 131 | python3 python3-venv python3-dev python-is-python3 132 | 133 | RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else export PYPY_ARCH="aarch64"; fi && \ 134 | mkdir -p /usr/local/pypy/pypy3.7 && \ 135 | curl -sqL https://downloads.python.org/pypy/pypy3.7-v7.3.9-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.7 --strip-components=1 && \ 136 | ln -s /usr/local/pypy/pypy3.7/bin/pypy /usr/local/bin/pypy3.7 && \ 137 | mkdir -p /usr/local/pypy/pypy3.8 && \ 138 | curl -sqL https://downloads.python.org/pypy/pypy3.8-v7.3.11-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.8 --strip-components=1 && \ 139 | ln -s /usr/local/pypy/pypy3.8/bin/pypy /usr/local/bin/pypy3.8 && \ 140 | mkdir -p /usr/local/pypy/pypy3.9 && \ 141 | curl -sqL https://downloads.python.org/pypy/pypy3.9-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.9 --strip-components=1 && \ 142 | ln -s /usr/local/pypy/pypy3.9/bin/pypy /usr/local/bin/pypy3.9 && \ 143 | mkdir -p /usr/local/pypy/pypy3.10 && \ 144 | 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 && \ 145 | ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10 146 | {% if manylinux %} 147 | COPY --from=manylinux /opt/_internal /opt/_internal 148 | COPY --from=manylinux /opt/python /opt/python 149 | {% elif musllinux %} 150 | COPY --from=musllinux /opt/_internal /opt/_internal 151 | COPY --from=musllinux /opt/python /opt/python 152 | {% else %} 153 | {% set python_target = "armv7l-unknown-linux-gnueabihf" if target.startswith("armv7-") else target %} 154 | RUN mkdir -p /opt/python 155 | 156 | RUN cd /tmp && \ 157 | VERS=3.7.17 && PREFIX=/opt/python/cp37-cp37m && \ 158 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 159 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 160 | {% if target.startswith('loongarch64-') -%} 161 | curl -LO 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub' && \ 162 | curl -LO 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess' && \ 163 | {% endif -%} 164 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-{{ 'linux-gnu' if platform.startswith('manylinux') else 'linux-musl' }} --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \ 165 | {% if target.startswith('armv7-') -%} 166 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 167 | {% endif -%} 168 | make -j4 && make -j4 install && \ 169 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 170 | # we don't need libpython*.a, and they're many megabytes 171 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 172 | # We do not need the Python test suites 173 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 174 | # We do not need precompiled .pyc and .pyo files. 175 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 176 | 177 | RUN cd /tmp && \ 178 | VERS=3.8.20 && PREFIX=/opt/python/cp38-cp38 && \ 179 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 180 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 181 | {% if target.startswith('loongarch64-') -%} 182 | curl -LO 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub' && \ 183 | curl -LO 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess' && \ 184 | {% endif -%} 185 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-{{ 'linux-gnu' if platform.startswith('manylinux') else 'linux-musl' }} --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \ 186 | {% if target.startswith('armv7-') -%} 187 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 188 | {% endif -%} 189 | make -j4 && make -j4 install && \ 190 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 191 | # we don't need libpython*.a, and they're many megabytes 192 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 193 | # We do not need the Python test suites 194 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 195 | # We do not need precompiled .pyc and .pyo files. 196 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 197 | 198 | RUN cd /tmp && \ 199 | VERS=3.9.22 && PREFIX=/opt/python/cp39-cp39 && \ 200 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 201 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 202 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-{{ 'linux-gnu' if platform.startswith('manylinux') else 'linux-musl' }} --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \ 203 | {% if target.startswith('armv7-') -%} 204 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 205 | {% endif -%} 206 | make -j4 && make -j4 install && \ 207 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 208 | # we don't need libpython*.a, and they're many megabytes 209 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 210 | # We do not need the Python test suites 211 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 212 | # We do not need precompiled .pyc and .pyo files. 213 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 214 | 215 | RUN cd /tmp && \ 216 | VERS=3.10.17 && PREFIX=/opt/python/cp310-cp310 && \ 217 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 218 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 219 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-{{ 'linux-gnu' if platform.startswith('manylinux') else 'linux-musl' }} --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \ 220 | {% if target.startswith('armv7-') -%} 221 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 222 | {% endif -%} 223 | make -j4 && make -j4 install && \ 224 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 225 | # we don't need libpython*.a, and they're many megabytes 226 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 227 | # We do not need the Python test suites 228 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 229 | # We do not need precompiled .pyc and .pyo files. 230 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 231 | 232 | RUN cd /tmp && \ 233 | VERS=3.11.12 && PREFIX=/opt/python/cp311-cp311 && \ 234 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 235 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 236 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-build-python=python3.11 --with-ensurepip=no --build=$(uname -m)-{{ 'linux-gnu' if platform.startswith('manylinux') else 'linux-musl' }} --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \ 237 | {% if target.startswith('armv7-') -%} 238 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 239 | {% endif -%} 240 | make -j4 && make -j4 install && \ 241 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 242 | # we don't need libpython*.a, and they're many megabytes 243 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 244 | # We do not need the Python test suites 245 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 246 | # We do not need precompiled .pyc and .pyo files. 247 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 248 | 249 | RUN cd /tmp && \ 250 | VERS=3.12.10 && PREFIX=/opt/python/cp312-cp312 && \ 251 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 252 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 253 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-build-python=python3.12 --with-ensurepip=no --build=$(uname -m)-{{ 'linux-gnu' if platform.startswith('manylinux') else 'linux-musl' }} --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \ 254 | {% if target.startswith('armv7-') -%} 255 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 256 | {% endif -%} 257 | make -j4 && make -j4 install && \ 258 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 259 | # we don't need libpython*.a, and they're many megabytes 260 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 261 | # We do not need the Python test suites 262 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 263 | # We do not need precompiled .pyc and .pyo files. 264 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 265 | 266 | RUN cd /tmp && \ 267 | VERS=3.13.3 && PREFIX=/opt/python/cp313-cp313 && \ 268 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 269 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 270 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-build-python=python3.13 --with-ensurepip=no --build=$(uname -m)-{{ 'linux-gnu' if platform.startswith('manylinux') else 'linux-musl' }} --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no {{ 'ac_cv_libatomic_needed=yes' if 'riscv64' in target or 'loongarch64' in target }} && \ 271 | {% if target.startswith('armv7-') -%} 272 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 273 | {% endif -%} 274 | make -j4 && make -j4 install && \ 275 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 276 | # we don't need libpython*.a, and they're many megabytes 277 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 278 | # We do not need the Python test suites 279 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 280 | # We do not need precompiled .pyc and .pyo files. 281 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 282 | {%- endif %} 283 | RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \ 284 | case $VER in \ 285 | 3.7|3.8) \ 286 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \ 287 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \ 288 | ;; \ 289 | 3.9|3.10) \ 290 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 291 | curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \ 292 | ;; \ 293 | 3.11|3.12|3.13) \ 294 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 295 | ;; \ 296 | esac && \ 297 | "python$VER" -m pip install --no-cache-dir cffi; \ 298 | done && \ 299 | python3 -m pip --version && \ 300 | python3 -m pip install --no-cache-dir auditwheel patchelf build && \ 301 | python3 -m pip install --no-cache-dir auditwheel-symbols 302 | 303 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021-present messense 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # manylinux-cross 2 | 3 | [![manylinux2014 Docker Image](https://img.shields.io/docker/pulls/messense/manylinux2014-cross.svg?maxAge=2592000&label=manylinux2014)](https://hub.docker.com/r/messense/manylinux2014-cross/) 4 | [![manylinux_2_28 Docker Image](https://img.shields.io/docker/pulls/messense/manylinux_2_28-cross.svg?maxAge=2592000&label=manylinux_2_28)](https://hub.docker.com/r/messense/manylinux_2_28-cross/) 5 | [![manylinux_2_31 Docker Image](https://img.shields.io/docker/pulls/messense/manylinux_2_31-cross.svg?maxAge=2592000&label=manylinux_2_31)](https://hub.docker.com/r/messense/manylinux_2_31-cross/) 6 | [![manylinux_2_36 Docker Image](https://img.shields.io/docker/pulls/messense/manylinux_2_36-cross.svg?maxAge=2592000&label=manylinux_2_36)](https://hub.docker.com/r/messense/manylinux_2_36-cross/) 7 | [![Test](https://github.com/rust-cross/manylinux-cross/workflows/Test/badge.svg)](https://github.com/rust-cross/manylinux-cross/actions?query=workflow%3ATest) 8 | [![Bors enabled](https://bors.tech/images/badge_small.svg)](https://app.bors.tech/repositories/58198) 9 | 10 | manylinux2014, manylinux_2_28 aarch64/armv7l/s390x/ppc64le and manylinux_2_31 riscv64 and manylinux_2_36 loongarch64 cross compilation docker images, 11 | supports both x86_64(amd64) and aarch64(arm64) architectures. 12 | 13 | ## manylinux2014 14 | 15 | Docker image repository: [messense/manylinux2014-cross], based on Ubuntu 22.04 with **GCC 4.8.5**. 16 | 17 | | Architecture | Tag | Target Python | Host Python | 18 | | ------------ | --------------- | ------------------------------------------ | ---------------------- | 19 | | x86_64 | x86_64 | Copied from manylinux2014_x86_64 | Python 3.7 - 3.13 | 20 | | i686 | i686 | Copied from manylinux2014_i686 | Python 3.7 - 3.13 | 21 | | aarch64 | aarch64 | Copied from manylinux2014_aarch64 | Python 3.7 - 3.13 | 22 | | armv7l | armv7l / armv7 | `/opt/python/cp3[7-13]`, built from source | Python 3.7 - 3.13 | 23 | | s390x | s390x | Copied from manylinux2014_s390x | Python 3.7 - 3.13 | 24 | | ppc64 | ppc64 | `/opt/python/cp3[7-13]`, built from source | Python 3.7 - 3.13 | 25 | | ppc64le | ppc64le | Copied from manylinux2014_ppc64le | Python 3.7 - 3.13 | 26 | 27 | ## manylinux_2_28 28 | 29 | Docker image repository: [messense/manylinux_2_28-cross], based on Ubuntu 22.04 with **GCC 7.5.0**. 30 | 31 | | Architecture | Tag | Target Python | Host Python | 32 | | ------------ | --------------- | ------------------------------------------ | ---------------------- | 33 | | x86_64 | x86_64 | Copied from manylinux_2_28_x86_64 | Python 3.7 - 3.13 | 34 | | aarch64 | aarch64 | Copied from manylinux_2_28_aarch64 | Python 3.7 - 3.13 | 35 | | armv7l | armv7l / armv7 | `/opt/python/cp3[7-13]`, built from source | Python 3.7 - 3.13 | 36 | | s390x | s390x | `/opt/python/cp3[7-13]`, built from source | Python 3.7 - 3.13 | 37 | | ppc64le | ppc64le | `/opt/python/cp3[7-13]`, built from source | Python 3.7 - 3.13 | 38 | 39 | ## manylinux_2_31 40 | 41 | Docker image repository: [messense/manylinux_2_31-cross], based on Ubuntu 22.04 with **GCC 7.5.0**. 42 | 43 | | Architecture | Tag | Target Python | Host Python | 44 | | ------------ | --------------- | ------------------------------------------ | ---------------------- | 45 | | riscv64 | riscv64 | `/opt/python/cp3[7-13]`, built from source | Python 3.7 - 3.13 | 46 | 47 | ## manylinux_2_36 48 | 49 | Docker image repository: [messense/manylinux_2_36-cross], based on Ubuntu 22.04 with **GCC 14.2.0**. 50 | 51 | | Architecture | Tag | Target Python | Host Python | 52 | | ------------ | --------------- | ------------------------------------------ | ---------------------- | 53 | | loongarch64 | loongarch64 | `/opt/python/cp3[7-13]`, built from source | Python 3.7 - 3.13 | 54 | 55 | ## Environment variables 56 | 57 | Following list of environment variables are set: 58 | 59 | * `TARGET_CC` 60 | * `TARGET_CXX` 61 | * `TARGET_AR` 62 | * `TARGET_SYSROOT` 63 | * `TARGET_C_INCLUDE_PATH` 64 | * `CARGO_BUILD_TARGET` 65 | * `CARGO_TARGET_${target}_LINKER` 66 | 67 | [messense/manylinux2014-cross]: https://hub.docker.com/r/messense/manylinux2014-cross 68 | [messense/manylinux_2_28-cross]: https://hub.docker.com/r/messense/manylinux_2_28-cross 69 | [messense/manylinux_2_31-cross]: https://hub.docker.com/r/messense/manylinux_2_31-cross 70 | [messense/manylinux_2_36-cross]: https://hub.docker.com/r/messense/manylinux_2_36-cross 71 | -------------------------------------------------------------------------------- /manylinux2014/aarch64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/pypa/manylinux2014_aarch64 AS manylinux 2 | 3 | FROM ubuntu:20.04 AS toolchain 4 | 5 | ENV DEBIAN_FRONTEND noninteractive 6 | 7 | RUN apt-get update && \ 8 | apt-get install --no-install-recommends -y \ 9 | automake \ 10 | bison \ 11 | bzip2 \ 12 | ca-certificates \ 13 | cmake \ 14 | curl \ 15 | file \ 16 | flex \ 17 | g++ \ 18 | gawk \ 19 | gdb \ 20 | git \ 21 | gperf \ 22 | help2man \ 23 | libncurses-dev \ 24 | libssl-dev \ 25 | libtool-bin \ 26 | lzip \ 27 | make \ 28 | ninja-build \ 29 | patch \ 30 | pkg-config \ 31 | python3 \ 32 | rsync \ 33 | sudo \ 34 | texinfo \ 35 | unzip \ 36 | wget \ 37 | xz-utils \ 38 | libssl-dev \ 39 | libffi-dev 40 | 41 | # Install crosstool-ng 42 | RUN curl -Lf https://github.com/crosstool-ng/crosstool-ng/archive/02d1503f6769be4ad8058b393d4245febced459f.tar.gz | tar xzf - && \ 43 | cd crosstool-ng-02d1503f6769be4ad8058b393d4245febced459f && \ 44 | ./bootstrap && \ 45 | ./configure --prefix=/usr/local && \ 46 | make -j4 && \ 47 | make install && \ 48 | cd .. && rm -rf crosstool-ng-* 49 | 50 | COPY .config /tmp/toolchain.config 51 | 52 | # Build cross compiler 53 | RUN mkdir build && \ 54 | cd build && \ 55 | cp /tmp/toolchain.config .config && \ 56 | export CT_ALLOW_BUILD_AS_ROOT_SURE=1 && \ 57 | ct-ng build.2 || { tail -n 500 build.log; exit $ERRCODE; } && \ 58 | cd .. && \ 59 | rm -rf build 60 | 61 | FROM ubuntu:22.04 62 | 63 | # Copy cross toolchain 64 | COPY --from=toolchain /usr/aarch64-unknown-linux-gnu /usr/aarch64-unknown-linux-gnu 65 | 66 | ENV DEBIAN_FRONTEND noninteractive 67 | ENV PATH=$PATH:/usr/aarch64-unknown-linux-gnu/bin 68 | 69 | ENV CC_aarch64_unknown_linux_gnu=aarch64-unknown-linux-gnu-gcc \ 70 | AR_aarch64_unknown_linux_gnu=aarch64-unknown-linux-gnu-ar \ 71 | CXX_aarch64_unknown_linux_gnu=aarch64-unknown-linux-gnu-g++ 72 | 73 | ENV TARGET_CC=aarch64-unknown-linux-gnu-gcc \ 74 | TARGET_AR=aarch64-unknown-linux-gnu-ar \ 75 | TARGET_RANLIB=aarch64-unknown-linux-gnu-ranlib \ 76 | TARGET_CXX=aarch64-unknown-linux-gnu-g++ \ 77 | TARGET_READELF=aarch64-unknown-linux-gnu-readelf \ 78 | TARGET_SYSROOT=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/ \ 79 | TARGET_C_INCLUDE_PATH=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/usr/include/ 80 | 81 | ENV CARGO_BUILD_TARGET=aarch64-unknown-linux-gnu 82 | ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-unknown-linux-gnu-gcc 83 | RUN echo "set(CMAKE_SYSTEM_NAME Linux)\nset(CMAKE_SYSTEM_PROCESSOR aarch64)\nset(CMAKE_SYSROOT /usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/)\nset(CMAKE_C_COMPILER aarch64-unknown-linux-gnu-gcc)\nset(CMAKE_CXX_COMPILER aarch64-unknown-linux-gnu-g++)" > /usr/aarch64-unknown-linux-gnu/cmake-toolchain.cmake 84 | ENV TARGET_CMAKE_TOOLCHAIN_FILE_PATH=/usr/aarch64-unknown-linux-gnu/cmake-toolchain.cmake 85 | 86 | 87 | RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ 88 | apt-get update && \ 89 | apt-get install --no-install-recommends -y \ 90 | curl \ 91 | git \ 92 | g++ \ 93 | make \ 94 | sudo \ 95 | wget \ 96 | software-properties-common \ 97 | gpg-agent \ 98 | cmake \ 99 | llvm-dev \ 100 | libclang-dev \ 101 | clang 102 | 103 | ENV AARCH64_UNKNOWN_LINUX_GNU_OPENSSL_DIR=/usr/aarch64-unknown-linux-gnu/ 104 | RUN add-apt-repository -y ppa:deadsnakes/ppa && \ 105 | apt-get update && \ 106 | apt-get install -y \ 107 | python3.7 python3.7-venv python3.7-dev \ 108 | python3.8 python3.8-venv python3.8-dev \ 109 | python3.9 python3.9-venv python3.9-dev \ 110 | python3.11 python3.11-venv python3.11-dev \ 111 | python3.12 python3.12-venv python3.12-dev \ 112 | python3.13 python3.13-venv python3.13-dev \ 113 | python3 python3-venv python3-dev python-is-python3 114 | 115 | RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else export PYPY_ARCH="aarch64"; fi && \ 116 | mkdir -p /usr/local/pypy/pypy3.7 && \ 117 | curl -sqL https://downloads.python.org/pypy/pypy3.7-v7.3.9-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.7 --strip-components=1 && \ 118 | ln -s /usr/local/pypy/pypy3.7/bin/pypy /usr/local/bin/pypy3.7 && \ 119 | mkdir -p /usr/local/pypy/pypy3.8 && \ 120 | curl -sqL https://downloads.python.org/pypy/pypy3.8-v7.3.11-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.8 --strip-components=1 && \ 121 | ln -s /usr/local/pypy/pypy3.8/bin/pypy /usr/local/bin/pypy3.8 && \ 122 | mkdir -p /usr/local/pypy/pypy3.9 && \ 123 | curl -sqL https://downloads.python.org/pypy/pypy3.9-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.9 --strip-components=1 && \ 124 | ln -s /usr/local/pypy/pypy3.9/bin/pypy /usr/local/bin/pypy3.9 && \ 125 | mkdir -p /usr/local/pypy/pypy3.10 && \ 126 | 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 && \ 127 | ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10 128 | 129 | COPY --from=manylinux /opt/_internal /opt/_internal 130 | COPY --from=manylinux /opt/python /opt/python 131 | 132 | RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \ 133 | case $VER in \ 134 | 3.7|3.8) \ 135 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \ 136 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \ 137 | ;; \ 138 | 3.9|3.10) \ 139 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 140 | curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \ 141 | ;; \ 142 | 3.11|3.12|3.13) \ 143 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 144 | ;; \ 145 | esac && \ 146 | "python$VER" -m pip install --no-cache-dir cffi; \ 147 | done && \ 148 | python3 -m pip --version && \ 149 | python3 -m pip install --no-cache-dir auditwheel patchelf build && \ 150 | python3 -m pip install --no-cache-dir auditwheel-symbols 151 | -------------------------------------------------------------------------------- /manylinux2014/armv7l/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM ubuntu:20.04 AS toolchain 3 | 4 | ENV DEBIAN_FRONTEND noninteractive 5 | 6 | RUN apt-get update && \ 7 | apt-get install --no-install-recommends -y \ 8 | automake \ 9 | bison \ 10 | bzip2 \ 11 | ca-certificates \ 12 | cmake \ 13 | curl \ 14 | file \ 15 | flex \ 16 | g++ \ 17 | gawk \ 18 | gdb \ 19 | git \ 20 | gperf \ 21 | help2man \ 22 | libncurses-dev \ 23 | libssl-dev \ 24 | libtool-bin \ 25 | lzip \ 26 | make \ 27 | ninja-build \ 28 | patch \ 29 | pkg-config \ 30 | python3 \ 31 | rsync \ 32 | sudo \ 33 | texinfo \ 34 | unzip \ 35 | wget \ 36 | xz-utils \ 37 | libssl-dev \ 38 | libffi-dev 39 | 40 | # Install crosstool-ng 41 | RUN curl -Lf https://github.com/crosstool-ng/crosstool-ng/archive/02d1503f6769be4ad8058b393d4245febced459f.tar.gz | tar xzf - && \ 42 | cd crosstool-ng-02d1503f6769be4ad8058b393d4245febced459f && \ 43 | ./bootstrap && \ 44 | ./configure --prefix=/usr/local && \ 45 | make -j4 && \ 46 | make install && \ 47 | cd .. && rm -rf crosstool-ng-* 48 | 49 | COPY .config /tmp/toolchain.config 50 | 51 | # Build cross compiler 52 | RUN mkdir build && \ 53 | cd build && \ 54 | cp /tmp/toolchain.config .config && \ 55 | export CT_ALLOW_BUILD_AS_ROOT_SURE=1 && \ 56 | ct-ng build.2 || { tail -n 500 build.log; exit $ERRCODE; } && \ 57 | cd .. && \ 58 | rm -rf build 59 | 60 | FROM ubuntu:22.04 61 | 62 | # Copy cross toolchain 63 | COPY --from=toolchain /usr/armv7-unknown-linux-gnueabihf /usr/armv7-unknown-linux-gnueabihf 64 | 65 | ENV DEBIAN_FRONTEND noninteractive 66 | ENV PATH=$PATH:/usr/armv7-unknown-linux-gnueabihf/bin 67 | 68 | ENV CC_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-gcc \ 69 | AR_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-ar \ 70 | CXX_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-g++ 71 | 72 | ENV TARGET_CC=armv7-unknown-linux-gnueabihf-gcc \ 73 | TARGET_AR=armv7-unknown-linux-gnueabihf-ar \ 74 | TARGET_RANLIB=armv7-unknown-linux-gnueabihf-ranlib \ 75 | TARGET_CXX=armv7-unknown-linux-gnueabihf-g++ \ 76 | TARGET_READELF=armv7-unknown-linux-gnueabihf-readelf \ 77 | TARGET_SYSROOT=/usr/armv7-unknown-linux-gnueabihf/armv7-unknown-linux-gnueabihf/sysroot/ \ 78 | TARGET_C_INCLUDE_PATH=/usr/armv7-unknown-linux-gnueabihf/armv7-unknown-linux-gnueabihf/sysroot/usr/include/ 79 | 80 | ENV CARGO_BUILD_TARGET=armv7-unknown-linux-gnueabihf 81 | ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=armv7-unknown-linux-gnueabihf-gcc 82 | RUN echo "set(CMAKE_SYSTEM_NAME Linux)\nset(CMAKE_SYSTEM_PROCESSOR armv7)\nset(CMAKE_SYSROOT /usr/armv7-unknown-linux-gnueabihf/armv7-unknown-linux-gnueabihf/sysroot/)\nset(CMAKE_C_COMPILER armv7-unknown-linux-gnueabihf-gcc)\nset(CMAKE_CXX_COMPILER armv7-unknown-linux-gnueabihf-g++)" > /usr/armv7-unknown-linux-gnueabihf/cmake-toolchain.cmake 83 | ENV TARGET_CMAKE_TOOLCHAIN_FILE_PATH=/usr/armv7-unknown-linux-gnueabihf/cmake-toolchain.cmake 84 | 85 | 86 | RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ 87 | apt-get update && \ 88 | apt-get install --no-install-recommends -y \ 89 | curl \ 90 | git \ 91 | g++ \ 92 | make \ 93 | sudo \ 94 | wget \ 95 | software-properties-common \ 96 | gpg-agent \ 97 | cmake \ 98 | llvm-dev \ 99 | libclang-dev \ 100 | clang 101 | 102 | ENV ARMV7_UNKNOWN_LINUX_GNUEABIHF_OPENSSL_DIR=/usr/armv7-unknown-linux-gnueabihf/ 103 | RUN add-apt-repository -y ppa:deadsnakes/ppa && \ 104 | apt-get update && \ 105 | apt-get install -y \ 106 | python3.7 python3.7-venv python3.7-dev \ 107 | python3.8 python3.8-venv python3.8-dev \ 108 | python3.9 python3.9-venv python3.9-dev \ 109 | python3.11 python3.11-venv python3.11-dev \ 110 | python3.12 python3.12-venv python3.12-dev \ 111 | python3.13 python3.13-venv python3.13-dev \ 112 | python3 python3-venv python3-dev python-is-python3 113 | 114 | RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else export PYPY_ARCH="aarch64"; fi && \ 115 | mkdir -p /usr/local/pypy/pypy3.7 && \ 116 | curl -sqL https://downloads.python.org/pypy/pypy3.7-v7.3.9-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.7 --strip-components=1 && \ 117 | ln -s /usr/local/pypy/pypy3.7/bin/pypy /usr/local/bin/pypy3.7 && \ 118 | mkdir -p /usr/local/pypy/pypy3.8 && \ 119 | curl -sqL https://downloads.python.org/pypy/pypy3.8-v7.3.11-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.8 --strip-components=1 && \ 120 | ln -s /usr/local/pypy/pypy3.8/bin/pypy /usr/local/bin/pypy3.8 && \ 121 | mkdir -p /usr/local/pypy/pypy3.9 && \ 122 | curl -sqL https://downloads.python.org/pypy/pypy3.9-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.9 --strip-components=1 && \ 123 | ln -s /usr/local/pypy/pypy3.9/bin/pypy /usr/local/bin/pypy3.9 && \ 124 | mkdir -p /usr/local/pypy/pypy3.10 && \ 125 | 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 && \ 126 | ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10 127 | 128 | 129 | RUN mkdir -p /opt/python 130 | 131 | RUN cd /tmp && \ 132 | VERS=3.7.17 && PREFIX=/opt/python/cp37-cp37m && \ 133 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 134 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 135 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --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 && \ 136 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 137 | make -j4 && make -j4 install && \ 138 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 139 | # we don't need libpython*.a, and they're many megabytes 140 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 141 | # We do not need the Python test suites 142 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 143 | # We do not need precompiled .pyc and .pyo files. 144 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 145 | 146 | RUN cd /tmp && \ 147 | VERS=3.8.20 && PREFIX=/opt/python/cp38-cp38 && \ 148 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 149 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 150 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --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 && \ 151 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 152 | make -j4 && make -j4 install && \ 153 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 154 | # we don't need libpython*.a, and they're many megabytes 155 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 156 | # We do not need the Python test suites 157 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 158 | # We do not need precompiled .pyc and .pyo files. 159 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 160 | 161 | RUN cd /tmp && \ 162 | VERS=3.9.22 && PREFIX=/opt/python/cp39-cp39 && \ 163 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 164 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 165 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --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 && \ 166 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 167 | make -j4 && make -j4 install && \ 168 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 169 | # we don't need libpython*.a, and they're many megabytes 170 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 171 | # We do not need the Python test suites 172 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 173 | # We do not need precompiled .pyc and .pyo files. 174 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 175 | 176 | RUN cd /tmp && \ 177 | VERS=3.10.17 && PREFIX=/opt/python/cp310-cp310 && \ 178 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 179 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 180 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --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 && \ 181 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 182 | make -j4 && make -j4 install && \ 183 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 184 | # we don't need libpython*.a, and they're many megabytes 185 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 186 | # We do not need the Python test suites 187 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 188 | # We do not need precompiled .pyc and .pyo files. 189 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 190 | 191 | RUN cd /tmp && \ 192 | VERS=3.11.12 && PREFIX=/opt/python/cp311-cp311 && \ 193 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 194 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 195 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --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 && \ 196 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 197 | make -j4 && make -j4 install && \ 198 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 199 | # we don't need libpython*.a, and they're many megabytes 200 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 201 | # We do not need the Python test suites 202 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 203 | # We do not need precompiled .pyc and .pyo files. 204 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 205 | 206 | RUN cd /tmp && \ 207 | VERS=3.12.10 && PREFIX=/opt/python/cp312-cp312 && \ 208 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 209 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 210 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --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 && \ 211 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 212 | make -j4 && make -j4 install && \ 213 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 214 | # we don't need libpython*.a, and they're many megabytes 215 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 216 | # We do not need the Python test suites 217 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 218 | # We do not need precompiled .pyc and .pyo files. 219 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 220 | 221 | RUN cd /tmp && \ 222 | VERS=3.13.3 && PREFIX=/opt/python/cp313-cp313 && \ 223 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 224 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 225 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --prefix=$PREFIX --disable-shared --with-build-python=python3.13 --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 && \ 226 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 227 | make -j4 && make -j4 install && \ 228 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 229 | # we don't need libpython*.a, and they're many megabytes 230 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 231 | # We do not need the Python test suites 232 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 233 | # We do not need precompiled .pyc and .pyo files. 234 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 235 | RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \ 236 | case $VER in \ 237 | 3.7|3.8) \ 238 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \ 239 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \ 240 | ;; \ 241 | 3.9|3.10) \ 242 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 243 | curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \ 244 | ;; \ 245 | 3.11|3.12|3.13) \ 246 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 247 | ;; \ 248 | esac && \ 249 | "python$VER" -m pip install --no-cache-dir cffi; \ 250 | done && \ 251 | python3 -m pip --version && \ 252 | python3 -m pip install --no-cache-dir auditwheel patchelf build && \ 253 | python3 -m pip install --no-cache-dir auditwheel-symbols 254 | -------------------------------------------------------------------------------- /manylinux2014/i686/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/pypa/manylinux2014_i686 AS manylinux 2 | 3 | FROM ubuntu:20.04 AS toolchain 4 | 5 | ENV DEBIAN_FRONTEND noninteractive 6 | 7 | RUN apt-get update && \ 8 | apt-get install --no-install-recommends -y \ 9 | automake \ 10 | bison \ 11 | bzip2 \ 12 | ca-certificates \ 13 | cmake \ 14 | curl \ 15 | file \ 16 | flex \ 17 | g++ \ 18 | gawk \ 19 | gdb \ 20 | git \ 21 | gperf \ 22 | help2man \ 23 | libncurses-dev \ 24 | libssl-dev \ 25 | libtool-bin \ 26 | lzip \ 27 | make \ 28 | ninja-build \ 29 | patch \ 30 | pkg-config \ 31 | python3 \ 32 | rsync \ 33 | sudo \ 34 | texinfo \ 35 | unzip \ 36 | wget \ 37 | xz-utils \ 38 | libssl-dev \ 39 | libffi-dev 40 | 41 | # Install crosstool-ng 42 | RUN curl -Lf https://github.com/crosstool-ng/crosstool-ng/archive/02d1503f6769be4ad8058b393d4245febced459f.tar.gz | tar xzf - && \ 43 | cd crosstool-ng-02d1503f6769be4ad8058b393d4245febced459f && \ 44 | ./bootstrap && \ 45 | ./configure --prefix=/usr/local && \ 46 | make -j4 && \ 47 | make install && \ 48 | cd .. && rm -rf crosstool-ng-* 49 | 50 | COPY .config /tmp/toolchain.config 51 | 52 | # Build cross compiler 53 | RUN mkdir build && \ 54 | cd build && \ 55 | cp /tmp/toolchain.config .config && \ 56 | export CT_ALLOW_BUILD_AS_ROOT_SURE=1 && \ 57 | ct-ng build.2 || { tail -n 500 build.log; exit $ERRCODE; } && \ 58 | cd .. && \ 59 | rm -rf build 60 | 61 | FROM ubuntu:22.04 62 | 63 | # Copy cross toolchain 64 | COPY --from=toolchain /usr/i686-unknown-linux-gnu /usr/i686-unknown-linux-gnu 65 | 66 | ENV DEBIAN_FRONTEND noninteractive 67 | ENV PATH=$PATH:/usr/i686-unknown-linux-gnu/bin 68 | 69 | ENV CC_i686_unknown_linux_gnu=i686-unknown-linux-gnu-gcc \ 70 | AR_i686_unknown_linux_gnu=i686-unknown-linux-gnu-ar \ 71 | CXX_i686_unknown_linux_gnu=i686-unknown-linux-gnu-g++ 72 | 73 | ENV TARGET_CC=i686-unknown-linux-gnu-gcc \ 74 | TARGET_AR=i686-unknown-linux-gnu-ar \ 75 | TARGET_RANLIB=i686-unknown-linux-gnu-ranlib \ 76 | TARGET_CXX=i686-unknown-linux-gnu-g++ \ 77 | TARGET_READELF=i686-unknown-linux-gnu-readelf \ 78 | TARGET_SYSROOT=/usr/i686-unknown-linux-gnu/i686-unknown-linux-gnu/sysroot/ \ 79 | TARGET_C_INCLUDE_PATH=/usr/i686-unknown-linux-gnu/i686-unknown-linux-gnu/sysroot/usr/include/ 80 | 81 | ENV CARGO_BUILD_TARGET=i686-unknown-linux-gnu 82 | ENV CARGO_TARGET_I686_UNKNOWN_LINUX_GNU_LINKER=i686-unknown-linux-gnu-gcc 83 | RUN echo "set(CMAKE_SYSTEM_NAME Linux)\nset(CMAKE_SYSTEM_PROCESSOR i686)\nset(CMAKE_SYSROOT /usr/i686-unknown-linux-gnu/i686-unknown-linux-gnu/sysroot/)\nset(CMAKE_C_COMPILER i686-unknown-linux-gnu-gcc)\nset(CMAKE_CXX_COMPILER i686-unknown-linux-gnu-g++)" > /usr/i686-unknown-linux-gnu/cmake-toolchain.cmake 84 | ENV TARGET_CMAKE_TOOLCHAIN_FILE_PATH=/usr/i686-unknown-linux-gnu/cmake-toolchain.cmake 85 | 86 | 87 | RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ 88 | apt-get update && \ 89 | apt-get install --no-install-recommends -y \ 90 | curl \ 91 | git \ 92 | g++ \ 93 | make \ 94 | sudo \ 95 | wget \ 96 | software-properties-common \ 97 | gpg-agent \ 98 | cmake \ 99 | llvm-dev \ 100 | libclang-dev \ 101 | clang 102 | 103 | ENV I686_UNKNOWN_LINUX_GNU_OPENSSL_DIR=/usr/i686-unknown-linux-gnu/ 104 | RUN add-apt-repository -y ppa:deadsnakes/ppa && \ 105 | apt-get update && \ 106 | apt-get install -y \ 107 | python3.7 python3.7-venv python3.7-dev \ 108 | python3.8 python3.8-venv python3.8-dev \ 109 | python3.9 python3.9-venv python3.9-dev \ 110 | python3.11 python3.11-venv python3.11-dev \ 111 | python3.12 python3.12-venv python3.12-dev \ 112 | python3.13 python3.13-venv python3.13-dev \ 113 | python3 python3-venv python3-dev python-is-python3 114 | 115 | RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else export PYPY_ARCH="aarch64"; fi && \ 116 | mkdir -p /usr/local/pypy/pypy3.7 && \ 117 | curl -sqL https://downloads.python.org/pypy/pypy3.7-v7.3.9-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.7 --strip-components=1 && \ 118 | ln -s /usr/local/pypy/pypy3.7/bin/pypy /usr/local/bin/pypy3.7 && \ 119 | mkdir -p /usr/local/pypy/pypy3.8 && \ 120 | curl -sqL https://downloads.python.org/pypy/pypy3.8-v7.3.11-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.8 --strip-components=1 && \ 121 | ln -s /usr/local/pypy/pypy3.8/bin/pypy /usr/local/bin/pypy3.8 && \ 122 | mkdir -p /usr/local/pypy/pypy3.9 && \ 123 | curl -sqL https://downloads.python.org/pypy/pypy3.9-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.9 --strip-components=1 && \ 124 | ln -s /usr/local/pypy/pypy3.9/bin/pypy /usr/local/bin/pypy3.9 && \ 125 | mkdir -p /usr/local/pypy/pypy3.10 && \ 126 | 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 && \ 127 | ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10 128 | 129 | COPY --from=manylinux /opt/_internal /opt/_internal 130 | COPY --from=manylinux /opt/python /opt/python 131 | 132 | RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \ 133 | case $VER in \ 134 | 3.7|3.8) \ 135 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \ 136 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \ 137 | ;; \ 138 | 3.9|3.10) \ 139 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 140 | curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \ 141 | ;; \ 142 | 3.11|3.12|3.13) \ 143 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 144 | ;; \ 145 | esac && \ 146 | "python$VER" -m pip install --no-cache-dir cffi; \ 147 | done && \ 148 | python3 -m pip --version && \ 149 | python3 -m pip install --no-cache-dir auditwheel patchelf build && \ 150 | python3 -m pip install --no-cache-dir auditwheel-symbols 151 | -------------------------------------------------------------------------------- /manylinux2014/ppc64/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM ubuntu:20.04 AS toolchain 3 | 4 | ENV DEBIAN_FRONTEND noninteractive 5 | 6 | RUN apt-get update && \ 7 | apt-get install --no-install-recommends -y \ 8 | automake \ 9 | bison \ 10 | bzip2 \ 11 | ca-certificates \ 12 | cmake \ 13 | curl \ 14 | file \ 15 | flex \ 16 | g++ \ 17 | gawk \ 18 | gdb \ 19 | git \ 20 | gperf \ 21 | help2man \ 22 | libncurses-dev \ 23 | libssl-dev \ 24 | libtool-bin \ 25 | lzip \ 26 | make \ 27 | ninja-build \ 28 | patch \ 29 | pkg-config \ 30 | python3 \ 31 | rsync \ 32 | sudo \ 33 | texinfo \ 34 | unzip \ 35 | wget \ 36 | xz-utils \ 37 | libssl-dev \ 38 | libffi-dev 39 | 40 | # Install crosstool-ng 41 | RUN curl -Lf https://github.com/crosstool-ng/crosstool-ng/archive/02d1503f6769be4ad8058b393d4245febced459f.tar.gz | tar xzf - && \ 42 | cd crosstool-ng-02d1503f6769be4ad8058b393d4245febced459f && \ 43 | ./bootstrap && \ 44 | ./configure --prefix=/usr/local && \ 45 | make -j4 && \ 46 | make install && \ 47 | cd .. && rm -rf crosstool-ng-* 48 | 49 | COPY .config /tmp/toolchain.config 50 | 51 | # Build cross compiler 52 | RUN mkdir build && \ 53 | cd build && \ 54 | cp /tmp/toolchain.config .config && \ 55 | export CT_ALLOW_BUILD_AS_ROOT_SURE=1 && \ 56 | ct-ng build.2 || { tail -n 500 build.log; exit $ERRCODE; } && \ 57 | cd .. && \ 58 | rm -rf build 59 | 60 | FROM ubuntu:22.04 61 | 62 | # Copy cross toolchain 63 | COPY --from=toolchain /usr/powerpc64-unknown-linux-gnu /usr/powerpc64-unknown-linux-gnu 64 | 65 | ENV DEBIAN_FRONTEND noninteractive 66 | ENV PATH=$PATH:/usr/powerpc64-unknown-linux-gnu/bin 67 | 68 | ENV CC_powerpc64_unknown_linux_gnu=powerpc64-unknown-linux-gnu-gcc \ 69 | AR_powerpc64_unknown_linux_gnu=powerpc64-unknown-linux-gnu-ar \ 70 | CXX_powerpc64_unknown_linux_gnu=powerpc64-unknown-linux-gnu-g++ 71 | 72 | ENV TARGET_CC=powerpc64-unknown-linux-gnu-gcc \ 73 | TARGET_AR=powerpc64-unknown-linux-gnu-ar \ 74 | TARGET_RANLIB=powerpc64-unknown-linux-gnu-ranlib \ 75 | TARGET_CXX=powerpc64-unknown-linux-gnu-g++ \ 76 | TARGET_READELF=powerpc64-unknown-linux-gnu-readelf \ 77 | TARGET_SYSROOT=/usr/powerpc64-unknown-linux-gnu/powerpc64-unknown-linux-gnu/sysroot/ \ 78 | TARGET_C_INCLUDE_PATH=/usr/powerpc64-unknown-linux-gnu/powerpc64-unknown-linux-gnu/sysroot/usr/include/ 79 | 80 | ENV CARGO_BUILD_TARGET=powerpc64-unknown-linux-gnu 81 | ENV CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_LINKER=powerpc64-unknown-linux-gnu-gcc 82 | RUN echo "set(CMAKE_SYSTEM_NAME Linux)\nset(CMAKE_SYSTEM_PROCESSOR ppc64)\nset(CMAKE_SYSROOT /usr/powerpc64-unknown-linux-gnu/powerpc64-unknown-linux-gnu/sysroot/)\nset(CMAKE_C_COMPILER powerpc64-unknown-linux-gnu-gcc)\nset(CMAKE_CXX_COMPILER powerpc64-unknown-linux-gnu-g++)" > /usr/powerpc64-unknown-linux-gnu/cmake-toolchain.cmake 83 | ENV TARGET_CMAKE_TOOLCHAIN_FILE_PATH=/usr/powerpc64-unknown-linux-gnu/cmake-toolchain.cmake 84 | 85 | 86 | RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ 87 | apt-get update && \ 88 | apt-get install --no-install-recommends -y \ 89 | curl \ 90 | git \ 91 | g++ \ 92 | make \ 93 | sudo \ 94 | wget \ 95 | software-properties-common \ 96 | gpg-agent \ 97 | cmake \ 98 | llvm-dev \ 99 | libclang-dev \ 100 | clang 101 | 102 | ENV POWERPC64_UNKNOWN_LINUX_GNU_OPENSSL_DIR=/usr/powerpc64-unknown-linux-gnu/ 103 | RUN add-apt-repository -y ppa:deadsnakes/ppa && \ 104 | apt-get update && \ 105 | apt-get install -y \ 106 | python3.7 python3.7-venv python3.7-dev \ 107 | python3.8 python3.8-venv python3.8-dev \ 108 | python3.9 python3.9-venv python3.9-dev \ 109 | python3.11 python3.11-venv python3.11-dev \ 110 | python3.12 python3.12-venv python3.12-dev \ 111 | python3.13 python3.13-venv python3.13-dev \ 112 | python3 python3-venv python3-dev python-is-python3 113 | 114 | RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else export PYPY_ARCH="aarch64"; fi && \ 115 | mkdir -p /usr/local/pypy/pypy3.7 && \ 116 | curl -sqL https://downloads.python.org/pypy/pypy3.7-v7.3.9-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.7 --strip-components=1 && \ 117 | ln -s /usr/local/pypy/pypy3.7/bin/pypy /usr/local/bin/pypy3.7 && \ 118 | mkdir -p /usr/local/pypy/pypy3.8 && \ 119 | curl -sqL https://downloads.python.org/pypy/pypy3.8-v7.3.11-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.8 --strip-components=1 && \ 120 | ln -s /usr/local/pypy/pypy3.8/bin/pypy /usr/local/bin/pypy3.8 && \ 121 | mkdir -p /usr/local/pypy/pypy3.9 && \ 122 | curl -sqL https://downloads.python.org/pypy/pypy3.9-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.9 --strip-components=1 && \ 123 | ln -s /usr/local/pypy/pypy3.9/bin/pypy /usr/local/bin/pypy3.9 && \ 124 | mkdir -p /usr/local/pypy/pypy3.10 && \ 125 | 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 && \ 126 | ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10 127 | 128 | 129 | RUN mkdir -p /opt/python 130 | 131 | RUN cd /tmp && \ 132 | VERS=3.7.17 && PREFIX=/opt/python/cp37-cp37m && \ 133 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 134 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 135 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=powerpc64-unknown-linux-gnu --target=powerpc64-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 && \ 136 | make -j4 && make -j4 install && \ 137 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 138 | # we don't need libpython*.a, and they're many megabytes 139 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 140 | # We do not need the Python test suites 141 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 142 | # We do not need precompiled .pyc and .pyo files. 143 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 144 | 145 | RUN cd /tmp && \ 146 | VERS=3.8.20 && PREFIX=/opt/python/cp38-cp38 && \ 147 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 148 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 149 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=powerpc64-unknown-linux-gnu --target=powerpc64-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 && \ 150 | make -j4 && make -j4 install && \ 151 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 152 | # we don't need libpython*.a, and they're many megabytes 153 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 154 | # We do not need the Python test suites 155 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 156 | # We do not need precompiled .pyc and .pyo files. 157 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 158 | 159 | RUN cd /tmp && \ 160 | VERS=3.9.22 && PREFIX=/opt/python/cp39-cp39 && \ 161 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 162 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 163 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=powerpc64-unknown-linux-gnu --target=powerpc64-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 && \ 164 | make -j4 && make -j4 install && \ 165 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 166 | # we don't need libpython*.a, and they're many megabytes 167 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 168 | # We do not need the Python test suites 169 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 170 | # We do not need precompiled .pyc and .pyo files. 171 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 172 | 173 | RUN cd /tmp && \ 174 | VERS=3.10.17 && PREFIX=/opt/python/cp310-cp310 && \ 175 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 176 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 177 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=powerpc64-unknown-linux-gnu --target=powerpc64-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 && \ 178 | make -j4 && make -j4 install && \ 179 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 180 | # we don't need libpython*.a, and they're many megabytes 181 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 182 | # We do not need the Python test suites 183 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 184 | # We do not need precompiled .pyc and .pyo files. 185 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 186 | 187 | RUN cd /tmp && \ 188 | VERS=3.11.12 && PREFIX=/opt/python/cp311-cp311 && \ 189 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 190 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 191 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=powerpc64-unknown-linux-gnu --target=powerpc64-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 && \ 192 | make -j4 && make -j4 install && \ 193 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 194 | # we don't need libpython*.a, and they're many megabytes 195 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 196 | # We do not need the Python test suites 197 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 198 | # We do not need precompiled .pyc and .pyo files. 199 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 200 | 201 | RUN cd /tmp && \ 202 | VERS=3.12.10 && PREFIX=/opt/python/cp312-cp312 && \ 203 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 204 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 205 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=powerpc64-unknown-linux-gnu --target=powerpc64-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 && \ 206 | make -j4 && make -j4 install && \ 207 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 208 | # we don't need libpython*.a, and they're many megabytes 209 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 210 | # We do not need the Python test suites 211 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 212 | # We do not need precompiled .pyc and .pyo files. 213 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 214 | 215 | RUN cd /tmp && \ 216 | VERS=3.13.3 && PREFIX=/opt/python/cp313-cp313 && \ 217 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 218 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 219 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=powerpc64-unknown-linux-gnu --target=powerpc64-unknown-linux-gnu --prefix=$PREFIX --disable-shared --with-build-python=python3.13 --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 && \ 220 | make -j4 && make -j4 install && \ 221 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 222 | # we don't need libpython*.a, and they're many megabytes 223 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 224 | # We do not need the Python test suites 225 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 226 | # We do not need precompiled .pyc and .pyo files. 227 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 228 | RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \ 229 | case $VER in \ 230 | 3.7|3.8) \ 231 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \ 232 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \ 233 | ;; \ 234 | 3.9|3.10) \ 235 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 236 | curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \ 237 | ;; \ 238 | 3.11|3.12|3.13) \ 239 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 240 | ;; \ 241 | esac && \ 242 | "python$VER" -m pip install --no-cache-dir cffi; \ 243 | done && \ 244 | python3 -m pip --version && \ 245 | python3 -m pip install --no-cache-dir auditwheel patchelf build && \ 246 | python3 -m pip install --no-cache-dir auditwheel-symbols 247 | -------------------------------------------------------------------------------- /manylinux2014/ppc64le/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/pypa/manylinux2014_ppc64le AS manylinux 2 | 3 | FROM ubuntu:20.04 AS toolchain 4 | 5 | ENV DEBIAN_FRONTEND noninteractive 6 | 7 | RUN apt-get update && \ 8 | apt-get install --no-install-recommends -y \ 9 | automake \ 10 | bison \ 11 | bzip2 \ 12 | ca-certificates \ 13 | cmake \ 14 | curl \ 15 | file \ 16 | flex \ 17 | g++ \ 18 | gawk \ 19 | gdb \ 20 | git \ 21 | gperf \ 22 | help2man \ 23 | libncurses-dev \ 24 | libssl-dev \ 25 | libtool-bin \ 26 | lzip \ 27 | make \ 28 | ninja-build \ 29 | patch \ 30 | pkg-config \ 31 | python3 \ 32 | rsync \ 33 | sudo \ 34 | texinfo \ 35 | unzip \ 36 | wget \ 37 | xz-utils \ 38 | libssl-dev \ 39 | libffi-dev 40 | 41 | # Install crosstool-ng 42 | RUN curl -Lf https://github.com/crosstool-ng/crosstool-ng/archive/02d1503f6769be4ad8058b393d4245febced459f.tar.gz | tar xzf - && \ 43 | cd crosstool-ng-02d1503f6769be4ad8058b393d4245febced459f && \ 44 | ./bootstrap && \ 45 | ./configure --prefix=/usr/local && \ 46 | make -j4 && \ 47 | make install && \ 48 | cd .. && rm -rf crosstool-ng-* 49 | 50 | COPY .config /tmp/toolchain.config 51 | 52 | # Build cross compiler 53 | RUN mkdir build && \ 54 | cd build && \ 55 | cp /tmp/toolchain.config .config && \ 56 | export CT_ALLOW_BUILD_AS_ROOT_SURE=1 && \ 57 | ct-ng build.2 || { tail -n 500 build.log; exit $ERRCODE; } && \ 58 | cd .. && \ 59 | rm -rf build 60 | 61 | FROM ubuntu:22.04 62 | 63 | # Copy cross toolchain 64 | COPY --from=toolchain /usr/powerpc64le-unknown-linux-gnu /usr/powerpc64le-unknown-linux-gnu 65 | 66 | ENV DEBIAN_FRONTEND noninteractive 67 | ENV PATH=$PATH:/usr/powerpc64le-unknown-linux-gnu/bin 68 | 69 | ENV CC_powerpc64le_unknown_linux_gnu=powerpc64le-unknown-linux-gnu-gcc \ 70 | AR_powerpc64le_unknown_linux_gnu=powerpc64le-unknown-linux-gnu-ar \ 71 | CXX_powerpc64le_unknown_linux_gnu=powerpc64le-unknown-linux-gnu-g++ 72 | 73 | ENV TARGET_CC=powerpc64le-unknown-linux-gnu-gcc \ 74 | TARGET_AR=powerpc64le-unknown-linux-gnu-ar \ 75 | TARGET_RANLIB=powerpc64le-unknown-linux-gnu-ranlib \ 76 | TARGET_CXX=powerpc64le-unknown-linux-gnu-g++ \ 77 | TARGET_READELF=powerpc64le-unknown-linux-gnu-readelf \ 78 | TARGET_SYSROOT=/usr/powerpc64le-unknown-linux-gnu/powerpc64le-unknown-linux-gnu/sysroot/ \ 79 | TARGET_C_INCLUDE_PATH=/usr/powerpc64le-unknown-linux-gnu/powerpc64le-unknown-linux-gnu/sysroot/usr/include/ 80 | 81 | ENV CARGO_BUILD_TARGET=powerpc64le-unknown-linux-gnu 82 | ENV CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_LINKER=powerpc64le-unknown-linux-gnu-gcc 83 | RUN echo "set(CMAKE_SYSTEM_NAME Linux)\nset(CMAKE_SYSTEM_PROCESSOR ppc64le)\nset(CMAKE_SYSROOT /usr/powerpc64le-unknown-linux-gnu/powerpc64le-unknown-linux-gnu/sysroot/)\nset(CMAKE_C_COMPILER powerpc64le-unknown-linux-gnu-gcc)\nset(CMAKE_CXX_COMPILER powerpc64le-unknown-linux-gnu-g++)" > /usr/powerpc64le-unknown-linux-gnu/cmake-toolchain.cmake 84 | ENV TARGET_CMAKE_TOOLCHAIN_FILE_PATH=/usr/powerpc64le-unknown-linux-gnu/cmake-toolchain.cmake 85 | 86 | 87 | RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ 88 | apt-get update && \ 89 | apt-get install --no-install-recommends -y \ 90 | curl \ 91 | git \ 92 | g++ \ 93 | make \ 94 | sudo \ 95 | wget \ 96 | software-properties-common \ 97 | gpg-agent \ 98 | cmake \ 99 | llvm-dev \ 100 | libclang-dev \ 101 | clang 102 | 103 | ENV POWERPC64LE_UNKNOWN_LINUX_GNU_OPENSSL_DIR=/usr/powerpc64le-unknown-linux-gnu/ 104 | RUN add-apt-repository -y ppa:deadsnakes/ppa && \ 105 | apt-get update && \ 106 | apt-get install -y \ 107 | python3.7 python3.7-venv python3.7-dev \ 108 | python3.8 python3.8-venv python3.8-dev \ 109 | python3.9 python3.9-venv python3.9-dev \ 110 | python3.11 python3.11-venv python3.11-dev \ 111 | python3.12 python3.12-venv python3.12-dev \ 112 | python3.13 python3.13-venv python3.13-dev \ 113 | python3 python3-venv python3-dev python-is-python3 114 | 115 | RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else export PYPY_ARCH="aarch64"; fi && \ 116 | mkdir -p /usr/local/pypy/pypy3.7 && \ 117 | curl -sqL https://downloads.python.org/pypy/pypy3.7-v7.3.9-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.7 --strip-components=1 && \ 118 | ln -s /usr/local/pypy/pypy3.7/bin/pypy /usr/local/bin/pypy3.7 && \ 119 | mkdir -p /usr/local/pypy/pypy3.8 && \ 120 | curl -sqL https://downloads.python.org/pypy/pypy3.8-v7.3.11-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.8 --strip-components=1 && \ 121 | ln -s /usr/local/pypy/pypy3.8/bin/pypy /usr/local/bin/pypy3.8 && \ 122 | mkdir -p /usr/local/pypy/pypy3.9 && \ 123 | curl -sqL https://downloads.python.org/pypy/pypy3.9-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.9 --strip-components=1 && \ 124 | ln -s /usr/local/pypy/pypy3.9/bin/pypy /usr/local/bin/pypy3.9 && \ 125 | mkdir -p /usr/local/pypy/pypy3.10 && \ 126 | 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 && \ 127 | ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10 128 | 129 | COPY --from=manylinux /opt/_internal /opt/_internal 130 | COPY --from=manylinux /opt/python /opt/python 131 | 132 | RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \ 133 | case $VER in \ 134 | 3.7|3.8) \ 135 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \ 136 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \ 137 | ;; \ 138 | 3.9|3.10) \ 139 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 140 | curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \ 141 | ;; \ 142 | 3.11|3.12|3.13) \ 143 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 144 | ;; \ 145 | esac && \ 146 | "python$VER" -m pip install --no-cache-dir cffi; \ 147 | done && \ 148 | python3 -m pip --version && \ 149 | python3 -m pip install --no-cache-dir auditwheel patchelf build && \ 150 | python3 -m pip install --no-cache-dir auditwheel-symbols 151 | -------------------------------------------------------------------------------- /manylinux2014/s390x/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/pypa/manylinux2014_s390x AS manylinux 2 | 3 | FROM ubuntu:20.04 AS toolchain 4 | 5 | ENV DEBIAN_FRONTEND noninteractive 6 | 7 | RUN apt-get update && \ 8 | apt-get install --no-install-recommends -y \ 9 | automake \ 10 | bison \ 11 | bzip2 \ 12 | ca-certificates \ 13 | cmake \ 14 | curl \ 15 | file \ 16 | flex \ 17 | g++ \ 18 | gawk \ 19 | gdb \ 20 | git \ 21 | gperf \ 22 | help2man \ 23 | libncurses-dev \ 24 | libssl-dev \ 25 | libtool-bin \ 26 | lzip \ 27 | make \ 28 | ninja-build \ 29 | patch \ 30 | pkg-config \ 31 | python3 \ 32 | rsync \ 33 | sudo \ 34 | texinfo \ 35 | unzip \ 36 | wget \ 37 | xz-utils \ 38 | libssl-dev \ 39 | libffi-dev 40 | 41 | # Install crosstool-ng 42 | RUN curl -Lf https://github.com/crosstool-ng/crosstool-ng/archive/02d1503f6769be4ad8058b393d4245febced459f.tar.gz | tar xzf - && \ 43 | cd crosstool-ng-02d1503f6769be4ad8058b393d4245febced459f && \ 44 | ./bootstrap && \ 45 | ./configure --prefix=/usr/local && \ 46 | make -j4 && \ 47 | make install && \ 48 | cd .. && rm -rf crosstool-ng-* 49 | 50 | COPY .config /tmp/toolchain.config 51 | 52 | # Build cross compiler 53 | RUN mkdir build && \ 54 | cd build && \ 55 | cp /tmp/toolchain.config .config && \ 56 | export CT_ALLOW_BUILD_AS_ROOT_SURE=1 && \ 57 | ct-ng build.2 || { tail -n 500 build.log; exit $ERRCODE; } && \ 58 | cd .. && \ 59 | rm -rf build 60 | 61 | FROM ubuntu:22.04 62 | 63 | # Copy cross toolchain 64 | COPY --from=toolchain /usr/s390x-ibm-linux-gnu /usr/s390x-ibm-linux-gnu 65 | 66 | ENV DEBIAN_FRONTEND noninteractive 67 | ENV PATH=$PATH:/usr/s390x-ibm-linux-gnu/bin 68 | 69 | ENV CC_s390x_unknown_linux_gnu=s390x-ibm-linux-gnu-gcc \ 70 | AR_s390x_unknown_linux_gnu=s390x-ibm-linux-gnu-ar \ 71 | CXX_s390x_unknown_linux_gnu=s390x-ibm-linux-gnu-g++ 72 | 73 | ENV TARGET_CC=s390x-ibm-linux-gnu-gcc \ 74 | TARGET_AR=s390x-ibm-linux-gnu-ar \ 75 | TARGET_RANLIB=s390x-ibm-linux-gnu-ranlib \ 76 | TARGET_CXX=s390x-ibm-linux-gnu-g++ \ 77 | TARGET_READELF=s390x-ibm-linux-gnu-readelf \ 78 | TARGET_SYSROOT=/usr/s390x-ibm-linux-gnu/s390x-ibm-linux-gnu/sysroot/ \ 79 | TARGET_C_INCLUDE_PATH=/usr/s390x-ibm-linux-gnu/s390x-ibm-linux-gnu/sysroot/usr/include/ 80 | 81 | ENV CARGO_BUILD_TARGET=s390x-unknown-linux-gnu 82 | ENV CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-ibm-linux-gnu-gcc 83 | RUN echo "set(CMAKE_SYSTEM_NAME Linux)\nset(CMAKE_SYSTEM_PROCESSOR s390x)\nset(CMAKE_SYSROOT /usr/s390x-ibm-linux-gnu/s390x-ibm-linux-gnu/sysroot/)\nset(CMAKE_C_COMPILER s390x-ibm-linux-gnu-gcc)\nset(CMAKE_CXX_COMPILER s390x-ibm-linux-gnu-g++)" > /usr/s390x-ibm-linux-gnu/cmake-toolchain.cmake 84 | ENV TARGET_CMAKE_TOOLCHAIN_FILE_PATH=/usr/s390x-ibm-linux-gnu/cmake-toolchain.cmake 85 | 86 | 87 | RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ 88 | apt-get update && \ 89 | apt-get install --no-install-recommends -y \ 90 | curl \ 91 | git \ 92 | g++ \ 93 | make \ 94 | sudo \ 95 | wget \ 96 | software-properties-common \ 97 | gpg-agent \ 98 | cmake \ 99 | llvm-dev \ 100 | libclang-dev \ 101 | clang 102 | 103 | ENV S390X_UNKNOWN_LINUX_GNU_OPENSSL_DIR=/usr/s390x-ibm-linux-gnu/ 104 | RUN add-apt-repository -y ppa:deadsnakes/ppa && \ 105 | apt-get update && \ 106 | apt-get install -y \ 107 | python3.7 python3.7-venv python3.7-dev \ 108 | python3.8 python3.8-venv python3.8-dev \ 109 | python3.9 python3.9-venv python3.9-dev \ 110 | python3.11 python3.11-venv python3.11-dev \ 111 | python3.12 python3.12-venv python3.12-dev \ 112 | python3.13 python3.13-venv python3.13-dev \ 113 | python3 python3-venv python3-dev python-is-python3 114 | 115 | RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else export PYPY_ARCH="aarch64"; fi && \ 116 | mkdir -p /usr/local/pypy/pypy3.7 && \ 117 | curl -sqL https://downloads.python.org/pypy/pypy3.7-v7.3.9-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.7 --strip-components=1 && \ 118 | ln -s /usr/local/pypy/pypy3.7/bin/pypy /usr/local/bin/pypy3.7 && \ 119 | mkdir -p /usr/local/pypy/pypy3.8 && \ 120 | curl -sqL https://downloads.python.org/pypy/pypy3.8-v7.3.11-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.8 --strip-components=1 && \ 121 | ln -s /usr/local/pypy/pypy3.8/bin/pypy /usr/local/bin/pypy3.8 && \ 122 | mkdir -p /usr/local/pypy/pypy3.9 && \ 123 | curl -sqL https://downloads.python.org/pypy/pypy3.9-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.9 --strip-components=1 && \ 124 | ln -s /usr/local/pypy/pypy3.9/bin/pypy /usr/local/bin/pypy3.9 && \ 125 | mkdir -p /usr/local/pypy/pypy3.10 && \ 126 | 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 && \ 127 | ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10 128 | 129 | COPY --from=manylinux /opt/_internal /opt/_internal 130 | COPY --from=manylinux /opt/python /opt/python 131 | 132 | RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \ 133 | case $VER in \ 134 | 3.7|3.8) \ 135 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \ 136 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \ 137 | ;; \ 138 | 3.9|3.10) \ 139 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 140 | curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \ 141 | ;; \ 142 | 3.11|3.12|3.13) \ 143 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 144 | ;; \ 145 | esac && \ 146 | "python$VER" -m pip install --no-cache-dir cffi; \ 147 | done && \ 148 | python3 -m pip --version && \ 149 | python3 -m pip install --no-cache-dir auditwheel patchelf build && \ 150 | python3 -m pip install --no-cache-dir auditwheel-symbols 151 | -------------------------------------------------------------------------------- /manylinux2014/x86_64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/pypa/manylinux2014_x86_64 AS manylinux 2 | 3 | FROM ubuntu:20.04 AS toolchain 4 | 5 | ENV DEBIAN_FRONTEND noninteractive 6 | 7 | RUN apt-get update && \ 8 | apt-get install --no-install-recommends -y \ 9 | automake \ 10 | bison \ 11 | bzip2 \ 12 | ca-certificates \ 13 | cmake \ 14 | curl \ 15 | file \ 16 | flex \ 17 | g++ \ 18 | gawk \ 19 | gdb \ 20 | git \ 21 | gperf \ 22 | help2man \ 23 | libncurses-dev \ 24 | libssl-dev \ 25 | libtool-bin \ 26 | lzip \ 27 | make \ 28 | ninja-build \ 29 | patch \ 30 | pkg-config \ 31 | python3 \ 32 | rsync \ 33 | sudo \ 34 | texinfo \ 35 | unzip \ 36 | wget \ 37 | xz-utils \ 38 | libssl-dev \ 39 | libffi-dev 40 | 41 | # Install crosstool-ng 42 | RUN curl -Lf https://github.com/crosstool-ng/crosstool-ng/archive/02d1503f6769be4ad8058b393d4245febced459f.tar.gz | tar xzf - && \ 43 | cd crosstool-ng-02d1503f6769be4ad8058b393d4245febced459f && \ 44 | ./bootstrap && \ 45 | ./configure --prefix=/usr/local && \ 46 | make -j4 && \ 47 | make install && \ 48 | cd .. && rm -rf crosstool-ng-* 49 | 50 | COPY .config /tmp/toolchain.config 51 | 52 | # Build cross compiler 53 | RUN mkdir build && \ 54 | cd build && \ 55 | cp /tmp/toolchain.config .config && \ 56 | export CT_ALLOW_BUILD_AS_ROOT_SURE=1 && \ 57 | ct-ng build.2 || { tail -n 500 build.log; exit $ERRCODE; } && \ 58 | cd .. && \ 59 | rm -rf build 60 | 61 | FROM ubuntu:22.04 62 | 63 | # Copy cross toolchain 64 | COPY --from=toolchain /usr/x86_64-unknown-linux-gnu /usr/x86_64-unknown-linux-gnu 65 | 66 | ENV DEBIAN_FRONTEND noninteractive 67 | ENV PATH=$PATH:/usr/x86_64-unknown-linux-gnu/bin 68 | 69 | ENV CC_x86_64_unknown_linux_gnu=x86_64-unknown-linux-gnu-gcc \ 70 | AR_x86_64_unknown_linux_gnu=x86_64-unknown-linux-gnu-ar \ 71 | CXX_x86_64_unknown_linux_gnu=x86_64-unknown-linux-gnu-g++ 72 | 73 | ENV TARGET_CC=x86_64-unknown-linux-gnu-gcc \ 74 | TARGET_AR=x86_64-unknown-linux-gnu-ar \ 75 | TARGET_RANLIB=x86_64-unknown-linux-gnu-ranlib \ 76 | TARGET_CXX=x86_64-unknown-linux-gnu-g++ \ 77 | TARGET_READELF=x86_64-unknown-linux-gnu-readelf \ 78 | TARGET_SYSROOT=/usr/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/ \ 79 | TARGET_C_INCLUDE_PATH=/usr/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/usr/include/ 80 | 81 | ENV CARGO_BUILD_TARGET=x86_64-unknown-linux-gnu 82 | ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-unknown-linux-gnu-gcc 83 | RUN echo "set(CMAKE_SYSTEM_NAME Linux)\nset(CMAKE_SYSTEM_PROCESSOR x86_64)\nset(CMAKE_SYSROOT /usr/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/)\nset(CMAKE_C_COMPILER x86_64-unknown-linux-gnu-gcc)\nset(CMAKE_CXX_COMPILER x86_64-unknown-linux-gnu-g++)" > /usr/x86_64-unknown-linux-gnu/cmake-toolchain.cmake 84 | ENV TARGET_CMAKE_TOOLCHAIN_FILE_PATH=/usr/x86_64-unknown-linux-gnu/cmake-toolchain.cmake 85 | 86 | 87 | RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ 88 | apt-get update && \ 89 | apt-get install --no-install-recommends -y \ 90 | curl \ 91 | git \ 92 | g++ \ 93 | make \ 94 | sudo \ 95 | wget \ 96 | software-properties-common \ 97 | gpg-agent \ 98 | cmake \ 99 | llvm-dev \ 100 | libclang-dev \ 101 | clang 102 | 103 | ENV X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR=/usr/x86_64-unknown-linux-gnu/ 104 | RUN add-apt-repository -y ppa:deadsnakes/ppa && \ 105 | apt-get update && \ 106 | apt-get install -y \ 107 | python3.7 python3.7-venv python3.7-dev \ 108 | python3.8 python3.8-venv python3.8-dev \ 109 | python3.9 python3.9-venv python3.9-dev \ 110 | python3.11 python3.11-venv python3.11-dev \ 111 | python3.12 python3.12-venv python3.12-dev \ 112 | python3.13 python3.13-venv python3.13-dev \ 113 | python3 python3-venv python3-dev python-is-python3 114 | 115 | RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else export PYPY_ARCH="aarch64"; fi && \ 116 | mkdir -p /usr/local/pypy/pypy3.7 && \ 117 | curl -sqL https://downloads.python.org/pypy/pypy3.7-v7.3.9-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.7 --strip-components=1 && \ 118 | ln -s /usr/local/pypy/pypy3.7/bin/pypy /usr/local/bin/pypy3.7 && \ 119 | mkdir -p /usr/local/pypy/pypy3.8 && \ 120 | curl -sqL https://downloads.python.org/pypy/pypy3.8-v7.3.11-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.8 --strip-components=1 && \ 121 | ln -s /usr/local/pypy/pypy3.8/bin/pypy /usr/local/bin/pypy3.8 && \ 122 | mkdir -p /usr/local/pypy/pypy3.9 && \ 123 | curl -sqL https://downloads.python.org/pypy/pypy3.9-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.9 --strip-components=1 && \ 124 | ln -s /usr/local/pypy/pypy3.9/bin/pypy /usr/local/bin/pypy3.9 && \ 125 | mkdir -p /usr/local/pypy/pypy3.10 && \ 126 | 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 && \ 127 | ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10 128 | 129 | COPY --from=manylinux /opt/_internal /opt/_internal 130 | COPY --from=manylinux /opt/python /opt/python 131 | 132 | RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \ 133 | case $VER in \ 134 | 3.7|3.8) \ 135 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \ 136 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \ 137 | ;; \ 138 | 3.9|3.10) \ 139 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 140 | curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \ 141 | ;; \ 142 | 3.11|3.12|3.13) \ 143 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 144 | ;; \ 145 | esac && \ 146 | "python$VER" -m pip install --no-cache-dir cffi; \ 147 | done && \ 148 | python3 -m pip --version && \ 149 | python3 -m pip install --no-cache-dir auditwheel patchelf build && \ 150 | python3 -m pip install --no-cache-dir auditwheel-symbols 151 | -------------------------------------------------------------------------------- /manylinux_2_28/aarch64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/pypa/manylinux_2_28_aarch64 AS manylinux 2 | 3 | FROM ubuntu:22.04 AS toolchain 4 | 5 | ENV DEBIAN_FRONTEND noninteractive 6 | 7 | RUN apt-get update && \ 8 | apt-get install --no-install-recommends -y \ 9 | automake \ 10 | bison \ 11 | bzip2 \ 12 | ca-certificates \ 13 | cmake \ 14 | curl \ 15 | file \ 16 | flex \ 17 | g++ \ 18 | gawk \ 19 | gdb \ 20 | git \ 21 | gperf \ 22 | help2man \ 23 | libncurses-dev \ 24 | libssl-dev \ 25 | libtool-bin \ 26 | lzip \ 27 | make \ 28 | ninja-build \ 29 | patch \ 30 | pkg-config \ 31 | python3 \ 32 | rsync \ 33 | sudo \ 34 | texinfo \ 35 | unzip \ 36 | wget \ 37 | xz-utils \ 38 | libssl-dev \ 39 | libffi-dev 40 | 41 | # Install crosstool-ng 42 | RUN curl -Lf https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.25.0.tar.gz | tar xzf - && \ 43 | cd crosstool-ng-crosstool-ng-1.25.0 && \ 44 | ./bootstrap && \ 45 | ./configure --prefix=/usr/local && \ 46 | make -j4 && \ 47 | make install && \ 48 | cd .. && rm -rf crosstool-ng-* 49 | 50 | COPY .config /tmp/toolchain.config 51 | 52 | # Build cross compiler 53 | RUN mkdir build && \ 54 | cd build && \ 55 | cp /tmp/toolchain.config .config && \ 56 | export CT_ALLOW_BUILD_AS_ROOT_SURE=1 && \ 57 | ct-ng build.2 || { tail -n 500 build.log; exit $ERRCODE; } && \ 58 | cd .. && \ 59 | rm -rf build 60 | 61 | FROM ubuntu:22.04 62 | 63 | # Copy cross toolchain 64 | COPY --from=toolchain /usr/aarch64-unknown-linux-gnu /usr/aarch64-unknown-linux-gnu 65 | 66 | ENV DEBIAN_FRONTEND noninteractive 67 | ENV PATH=$PATH:/usr/aarch64-unknown-linux-gnu/bin 68 | 69 | ENV CC_aarch64_unknown_linux_gnu=aarch64-unknown-linux-gnu-gcc \ 70 | AR_aarch64_unknown_linux_gnu=aarch64-unknown-linux-gnu-ar \ 71 | CXX_aarch64_unknown_linux_gnu=aarch64-unknown-linux-gnu-g++ 72 | 73 | ENV TARGET_CC=aarch64-unknown-linux-gnu-gcc \ 74 | TARGET_AR=aarch64-unknown-linux-gnu-ar \ 75 | TARGET_RANLIB=aarch64-unknown-linux-gnu-ranlib \ 76 | TARGET_CXX=aarch64-unknown-linux-gnu-g++ \ 77 | TARGET_READELF=aarch64-unknown-linux-gnu-readelf \ 78 | TARGET_SYSROOT=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/ \ 79 | TARGET_C_INCLUDE_PATH=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/usr/include/ 80 | 81 | ENV CARGO_BUILD_TARGET=aarch64-unknown-linux-gnu 82 | ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-unknown-linux-gnu-gcc 83 | RUN echo "set(CMAKE_SYSTEM_NAME Linux)\nset(CMAKE_SYSTEM_PROCESSOR aarch64)\nset(CMAKE_SYSROOT /usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/)\nset(CMAKE_C_COMPILER aarch64-unknown-linux-gnu-gcc)\nset(CMAKE_CXX_COMPILER aarch64-unknown-linux-gnu-g++)" > /usr/aarch64-unknown-linux-gnu/cmake-toolchain.cmake 84 | ENV TARGET_CMAKE_TOOLCHAIN_FILE_PATH=/usr/aarch64-unknown-linux-gnu/cmake-toolchain.cmake 85 | 86 | 87 | RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ 88 | apt-get update && \ 89 | apt-get install --no-install-recommends -y \ 90 | curl \ 91 | git \ 92 | g++ \ 93 | make \ 94 | sudo \ 95 | wget \ 96 | software-properties-common \ 97 | gpg-agent \ 98 | cmake \ 99 | llvm-dev \ 100 | libclang-dev \ 101 | clang 102 | 103 | ENV AARCH64_UNKNOWN_LINUX_GNU_OPENSSL_DIR=/usr/aarch64-unknown-linux-gnu/ 104 | RUN add-apt-repository -y ppa:deadsnakes/ppa && \ 105 | apt-get update && \ 106 | apt-get install -y \ 107 | python3.7 python3.7-venv python3.7-dev \ 108 | python3.8 python3.8-venv python3.8-dev \ 109 | python3.9 python3.9-venv python3.9-dev \ 110 | python3.11 python3.11-venv python3.11-dev \ 111 | python3.12 python3.12-venv python3.12-dev \ 112 | python3.13 python3.13-venv python3.13-dev \ 113 | python3 python3-venv python3-dev python-is-python3 114 | 115 | RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else export PYPY_ARCH="aarch64"; fi && \ 116 | mkdir -p /usr/local/pypy/pypy3.7 && \ 117 | curl -sqL https://downloads.python.org/pypy/pypy3.7-v7.3.9-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.7 --strip-components=1 && \ 118 | ln -s /usr/local/pypy/pypy3.7/bin/pypy /usr/local/bin/pypy3.7 && \ 119 | mkdir -p /usr/local/pypy/pypy3.8 && \ 120 | curl -sqL https://downloads.python.org/pypy/pypy3.8-v7.3.11-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.8 --strip-components=1 && \ 121 | ln -s /usr/local/pypy/pypy3.8/bin/pypy /usr/local/bin/pypy3.8 && \ 122 | mkdir -p /usr/local/pypy/pypy3.9 && \ 123 | curl -sqL https://downloads.python.org/pypy/pypy3.9-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.9 --strip-components=1 && \ 124 | ln -s /usr/local/pypy/pypy3.9/bin/pypy /usr/local/bin/pypy3.9 && \ 125 | mkdir -p /usr/local/pypy/pypy3.10 && \ 126 | 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 && \ 127 | ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10 128 | 129 | COPY --from=manylinux /opt/_internal /opt/_internal 130 | COPY --from=manylinux /opt/python /opt/python 131 | 132 | RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \ 133 | case $VER in \ 134 | 3.7|3.8) \ 135 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \ 136 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \ 137 | ;; \ 138 | 3.9|3.10) \ 139 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 140 | curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \ 141 | ;; \ 142 | 3.11|3.12|3.13) \ 143 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 144 | ;; \ 145 | esac && \ 146 | "python$VER" -m pip install --no-cache-dir cffi; \ 147 | done && \ 148 | python3 -m pip --version && \ 149 | python3 -m pip install --no-cache-dir auditwheel patchelf build && \ 150 | python3 -m pip install --no-cache-dir auditwheel-symbols 151 | -------------------------------------------------------------------------------- /manylinux_2_28/armv7l/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM ubuntu:22.04 AS toolchain 3 | 4 | ENV DEBIAN_FRONTEND noninteractive 5 | 6 | RUN apt-get update && \ 7 | apt-get install --no-install-recommends -y \ 8 | automake \ 9 | bison \ 10 | bzip2 \ 11 | ca-certificates \ 12 | cmake \ 13 | curl \ 14 | file \ 15 | flex \ 16 | g++ \ 17 | gawk \ 18 | gdb \ 19 | git \ 20 | gperf \ 21 | help2man \ 22 | libncurses-dev \ 23 | libssl-dev \ 24 | libtool-bin \ 25 | lzip \ 26 | make \ 27 | ninja-build \ 28 | patch \ 29 | pkg-config \ 30 | python3 \ 31 | rsync \ 32 | sudo \ 33 | texinfo \ 34 | unzip \ 35 | wget \ 36 | xz-utils \ 37 | libssl-dev \ 38 | libffi-dev 39 | 40 | # Install crosstool-ng 41 | RUN curl -Lf https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.25.0.tar.gz | tar xzf - && \ 42 | cd crosstool-ng-crosstool-ng-1.25.0 && \ 43 | ./bootstrap && \ 44 | ./configure --prefix=/usr/local && \ 45 | make -j4 && \ 46 | make install && \ 47 | cd .. && rm -rf crosstool-ng-* 48 | 49 | COPY .config /tmp/toolchain.config 50 | 51 | # Build cross compiler 52 | RUN mkdir build && \ 53 | cd build && \ 54 | cp /tmp/toolchain.config .config && \ 55 | export CT_ALLOW_BUILD_AS_ROOT_SURE=1 && \ 56 | ct-ng build.2 || { tail -n 500 build.log; exit $ERRCODE; } && \ 57 | cd .. && \ 58 | rm -rf build 59 | 60 | FROM ubuntu:22.04 61 | 62 | # Copy cross toolchain 63 | COPY --from=toolchain /usr/armv7-unknown-linux-gnueabihf /usr/armv7-unknown-linux-gnueabihf 64 | 65 | ENV DEBIAN_FRONTEND noninteractive 66 | ENV PATH=$PATH:/usr/armv7-unknown-linux-gnueabihf/bin 67 | 68 | ENV CC_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-gcc \ 69 | AR_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-ar \ 70 | CXX_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-g++ 71 | 72 | ENV TARGET_CC=armv7-unknown-linux-gnueabihf-gcc \ 73 | TARGET_AR=armv7-unknown-linux-gnueabihf-ar \ 74 | TARGET_RANLIB=armv7-unknown-linux-gnueabihf-ranlib \ 75 | TARGET_CXX=armv7-unknown-linux-gnueabihf-g++ \ 76 | TARGET_READELF=armv7-unknown-linux-gnueabihf-readelf \ 77 | TARGET_SYSROOT=/usr/armv7-unknown-linux-gnueabihf/armv7-unknown-linux-gnueabihf/sysroot/ \ 78 | TARGET_C_INCLUDE_PATH=/usr/armv7-unknown-linux-gnueabihf/armv7-unknown-linux-gnueabihf/sysroot/usr/include/ 79 | 80 | ENV CARGO_BUILD_TARGET=armv7-unknown-linux-gnueabihf 81 | ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=armv7-unknown-linux-gnueabihf-gcc 82 | RUN echo "set(CMAKE_SYSTEM_NAME Linux)\nset(CMAKE_SYSTEM_PROCESSOR armv7l)\nset(CMAKE_SYSROOT /usr/armv7-unknown-linux-gnueabihf/armv7-unknown-linux-gnueabihf/sysroot/)\nset(CMAKE_C_COMPILER armv7-unknown-linux-gnueabihf-gcc)\nset(CMAKE_CXX_COMPILER armv7-unknown-linux-gnueabihf-g++)" > /usr/armv7-unknown-linux-gnueabihf/cmake-toolchain.cmake 83 | ENV TARGET_CMAKE_TOOLCHAIN_FILE_PATH=/usr/armv7-unknown-linux-gnueabihf/cmake-toolchain.cmake 84 | 85 | 86 | RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ 87 | apt-get update && \ 88 | apt-get install --no-install-recommends -y \ 89 | curl \ 90 | git \ 91 | g++ \ 92 | make \ 93 | sudo \ 94 | wget \ 95 | software-properties-common \ 96 | gpg-agent \ 97 | cmake \ 98 | llvm-dev \ 99 | libclang-dev \ 100 | clang 101 | 102 | ENV ARMV7_UNKNOWN_LINUX_GNUEABIHF_OPENSSL_DIR=/usr/armv7-unknown-linux-gnueabihf/ 103 | RUN add-apt-repository -y ppa:deadsnakes/ppa && \ 104 | apt-get update && \ 105 | apt-get install -y \ 106 | python3.7 python3.7-venv python3.7-dev \ 107 | python3.8 python3.8-venv python3.8-dev \ 108 | python3.9 python3.9-venv python3.9-dev \ 109 | python3.11 python3.11-venv python3.11-dev \ 110 | python3.12 python3.12-venv python3.12-dev \ 111 | python3.13 python3.13-venv python3.13-dev \ 112 | python3 python3-venv python3-dev python-is-python3 113 | 114 | RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else export PYPY_ARCH="aarch64"; fi && \ 115 | mkdir -p /usr/local/pypy/pypy3.7 && \ 116 | curl -sqL https://downloads.python.org/pypy/pypy3.7-v7.3.9-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.7 --strip-components=1 && \ 117 | ln -s /usr/local/pypy/pypy3.7/bin/pypy /usr/local/bin/pypy3.7 && \ 118 | mkdir -p /usr/local/pypy/pypy3.8 && \ 119 | curl -sqL https://downloads.python.org/pypy/pypy3.8-v7.3.11-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.8 --strip-components=1 && \ 120 | ln -s /usr/local/pypy/pypy3.8/bin/pypy /usr/local/bin/pypy3.8 && \ 121 | mkdir -p /usr/local/pypy/pypy3.9 && \ 122 | curl -sqL https://downloads.python.org/pypy/pypy3.9-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.9 --strip-components=1 && \ 123 | ln -s /usr/local/pypy/pypy3.9/bin/pypy /usr/local/bin/pypy3.9 && \ 124 | mkdir -p /usr/local/pypy/pypy3.10 && \ 125 | 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 && \ 126 | ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10 127 | 128 | 129 | RUN mkdir -p /opt/python 130 | 131 | RUN cd /tmp && \ 132 | VERS=3.7.17 && PREFIX=/opt/python/cp37-cp37m && \ 133 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 134 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 135 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --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 && \ 136 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 137 | make -j4 && make -j4 install && \ 138 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 139 | # we don't need libpython*.a, and they're many megabytes 140 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 141 | # We do not need the Python test suites 142 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 143 | # We do not need precompiled .pyc and .pyo files. 144 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 145 | 146 | RUN cd /tmp && \ 147 | VERS=3.8.20 && PREFIX=/opt/python/cp38-cp38 && \ 148 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 149 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 150 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --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 && \ 151 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 152 | make -j4 && make -j4 install && \ 153 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 154 | # we don't need libpython*.a, and they're many megabytes 155 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 156 | # We do not need the Python test suites 157 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 158 | # We do not need precompiled .pyc and .pyo files. 159 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 160 | 161 | RUN cd /tmp && \ 162 | VERS=3.9.22 && PREFIX=/opt/python/cp39-cp39 && \ 163 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 164 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 165 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --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 && \ 166 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 167 | make -j4 && make -j4 install && \ 168 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 169 | # we don't need libpython*.a, and they're many megabytes 170 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 171 | # We do not need the Python test suites 172 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 173 | # We do not need precompiled .pyc and .pyo files. 174 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 175 | 176 | RUN cd /tmp && \ 177 | VERS=3.10.17 && PREFIX=/opt/python/cp310-cp310 && \ 178 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 179 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 180 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --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 && \ 181 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 182 | make -j4 && make -j4 install && \ 183 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 184 | # we don't need libpython*.a, and they're many megabytes 185 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 186 | # We do not need the Python test suites 187 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 188 | # We do not need precompiled .pyc and .pyo files. 189 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 190 | 191 | RUN cd /tmp && \ 192 | VERS=3.11.12 && PREFIX=/opt/python/cp311-cp311 && \ 193 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 194 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 195 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --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 && \ 196 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 197 | make -j4 && make -j4 install && \ 198 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 199 | # we don't need libpython*.a, and they're many megabytes 200 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 201 | # We do not need the Python test suites 202 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 203 | # We do not need precompiled .pyc and .pyo files. 204 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 205 | 206 | RUN cd /tmp && \ 207 | VERS=3.12.10 && PREFIX=/opt/python/cp312-cp312 && \ 208 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 209 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 210 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --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 && \ 211 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 212 | make -j4 && make -j4 install && \ 213 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 214 | # we don't need libpython*.a, and they're many megabytes 215 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 216 | # We do not need the Python test suites 217 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 218 | # We do not need precompiled .pyc and .pyo files. 219 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 220 | 221 | RUN cd /tmp && \ 222 | VERS=3.13.3 && PREFIX=/opt/python/cp313-cp313 && \ 223 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 224 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 225 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --prefix=$PREFIX --disable-shared --with-build-python=python3.13 --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 && \ 226 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 227 | make -j4 && make -j4 install && \ 228 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 229 | # we don't need libpython*.a, and they're many megabytes 230 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 231 | # We do not need the Python test suites 232 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 233 | # We do not need precompiled .pyc and .pyo files. 234 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 235 | RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \ 236 | case $VER in \ 237 | 3.7|3.8) \ 238 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \ 239 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \ 240 | ;; \ 241 | 3.9|3.10) \ 242 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 243 | curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \ 244 | ;; \ 245 | 3.11|3.12|3.13) \ 246 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 247 | ;; \ 248 | esac && \ 249 | "python$VER" -m pip install --no-cache-dir cffi; \ 250 | done && \ 251 | python3 -m pip --version && \ 252 | python3 -m pip install --no-cache-dir auditwheel patchelf build && \ 253 | python3 -m pip install --no-cache-dir auditwheel-symbols 254 | -------------------------------------------------------------------------------- /manylinux_2_28/ppc64le/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/pypa/manylinux_2_28_ppc64le AS manylinux 2 | 3 | FROM ubuntu:22.04 AS toolchain 4 | 5 | ENV DEBIAN_FRONTEND noninteractive 6 | 7 | RUN apt-get update && \ 8 | apt-get install --no-install-recommends -y \ 9 | automake \ 10 | bison \ 11 | bzip2 \ 12 | ca-certificates \ 13 | cmake \ 14 | curl \ 15 | file \ 16 | flex \ 17 | g++ \ 18 | gawk \ 19 | gdb \ 20 | git \ 21 | gperf \ 22 | help2man \ 23 | libncurses-dev \ 24 | libssl-dev \ 25 | libtool-bin \ 26 | lzip \ 27 | make \ 28 | ninja-build \ 29 | patch \ 30 | pkg-config \ 31 | python3 \ 32 | rsync \ 33 | sudo \ 34 | texinfo \ 35 | unzip \ 36 | wget \ 37 | xz-utils \ 38 | libssl-dev \ 39 | libffi-dev 40 | 41 | # Install crosstool-ng 42 | RUN curl -Lf https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.25.0.tar.gz | tar xzf - && \ 43 | cd crosstool-ng-crosstool-ng-1.25.0 && \ 44 | ./bootstrap && \ 45 | ./configure --prefix=/usr/local && \ 46 | make -j4 && \ 47 | make install && \ 48 | cd .. && rm -rf crosstool-ng-* 49 | 50 | COPY .config /tmp/toolchain.config 51 | 52 | # Build cross compiler 53 | RUN mkdir build && \ 54 | cd build && \ 55 | cp /tmp/toolchain.config .config && \ 56 | export CT_ALLOW_BUILD_AS_ROOT_SURE=1 && \ 57 | ct-ng build.2 || { tail -n 500 build.log; exit $ERRCODE; } && \ 58 | cd .. && \ 59 | rm -rf build 60 | 61 | FROM ubuntu:22.04 62 | 63 | # Copy cross toolchain 64 | COPY --from=toolchain /usr/powerpc64le-unknown-linux-gnu /usr/powerpc64le-unknown-linux-gnu 65 | 66 | ENV DEBIAN_FRONTEND noninteractive 67 | ENV PATH=$PATH:/usr/powerpc64le-unknown-linux-gnu/bin 68 | 69 | ENV CC_powerpc64le_unknown_linux_gnu=powerpc64le-unknown-linux-gnu-gcc \ 70 | AR_powerpc64le_unknown_linux_gnu=powerpc64le-unknown-linux-gnu-ar \ 71 | CXX_powerpc64le_unknown_linux_gnu=powerpc64le-unknown-linux-gnu-g++ 72 | 73 | ENV TARGET_CC=powerpc64le-unknown-linux-gnu-gcc \ 74 | TARGET_AR=powerpc64le-unknown-linux-gnu-ar \ 75 | TARGET_RANLIB=powerpc64le-unknown-linux-gnu-ranlib \ 76 | TARGET_CXX=powerpc64le-unknown-linux-gnu-g++ \ 77 | TARGET_READELF=powerpc64le-unknown-linux-gnu-readelf \ 78 | TARGET_SYSROOT=/usr/powerpc64le-unknown-linux-gnu/powerpc64le-unknown-linux-gnu/sysroot/ \ 79 | TARGET_C_INCLUDE_PATH=/usr/powerpc64le-unknown-linux-gnu/powerpc64le-unknown-linux-gnu/sysroot/usr/include/ 80 | 81 | ENV CARGO_BUILD_TARGET=powerpc64le-unknown-linux-gnu 82 | ENV CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_LINKER=powerpc64le-unknown-linux-gnu-gcc 83 | RUN echo "set(CMAKE_SYSTEM_NAME Linux)\nset(CMAKE_SYSTEM_PROCESSOR ppc64le)\nset(CMAKE_SYSROOT /usr/powerpc64le-unknown-linux-gnu/powerpc64le-unknown-linux-gnu/sysroot/)\nset(CMAKE_C_COMPILER powerpc64le-unknown-linux-gnu-gcc)\nset(CMAKE_CXX_COMPILER powerpc64le-unknown-linux-gnu-g++)" > /usr/powerpc64le-unknown-linux-gnu/cmake-toolchain.cmake 84 | ENV TARGET_CMAKE_TOOLCHAIN_FILE_PATH=/usr/powerpc64le-unknown-linux-gnu/cmake-toolchain.cmake 85 | 86 | 87 | RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ 88 | apt-get update && \ 89 | apt-get install --no-install-recommends -y \ 90 | curl \ 91 | git \ 92 | g++ \ 93 | make \ 94 | sudo \ 95 | wget \ 96 | software-properties-common \ 97 | gpg-agent \ 98 | cmake \ 99 | llvm-dev \ 100 | libclang-dev \ 101 | clang 102 | 103 | ENV POWERPC64LE_UNKNOWN_LINUX_GNU_OPENSSL_DIR=/usr/powerpc64le-unknown-linux-gnu/ 104 | RUN add-apt-repository -y ppa:deadsnakes/ppa && \ 105 | apt-get update && \ 106 | apt-get install -y \ 107 | python3.7 python3.7-venv python3.7-dev \ 108 | python3.8 python3.8-venv python3.8-dev \ 109 | python3.9 python3.9-venv python3.9-dev \ 110 | python3.11 python3.11-venv python3.11-dev \ 111 | python3.12 python3.12-venv python3.12-dev \ 112 | python3.13 python3.13-venv python3.13-dev \ 113 | python3 python3-venv python3-dev python-is-python3 114 | 115 | RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else export PYPY_ARCH="aarch64"; fi && \ 116 | mkdir -p /usr/local/pypy/pypy3.7 && \ 117 | curl -sqL https://downloads.python.org/pypy/pypy3.7-v7.3.9-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.7 --strip-components=1 && \ 118 | ln -s /usr/local/pypy/pypy3.7/bin/pypy /usr/local/bin/pypy3.7 && \ 119 | mkdir -p /usr/local/pypy/pypy3.8 && \ 120 | curl -sqL https://downloads.python.org/pypy/pypy3.8-v7.3.11-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.8 --strip-components=1 && \ 121 | ln -s /usr/local/pypy/pypy3.8/bin/pypy /usr/local/bin/pypy3.8 && \ 122 | mkdir -p /usr/local/pypy/pypy3.9 && \ 123 | curl -sqL https://downloads.python.org/pypy/pypy3.9-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.9 --strip-components=1 && \ 124 | ln -s /usr/local/pypy/pypy3.9/bin/pypy /usr/local/bin/pypy3.9 && \ 125 | mkdir -p /usr/local/pypy/pypy3.10 && \ 126 | 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 && \ 127 | ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10 128 | 129 | COPY --from=manylinux /opt/_internal /opt/_internal 130 | COPY --from=manylinux /opt/python /opt/python 131 | 132 | RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \ 133 | case $VER in \ 134 | 3.7|3.8) \ 135 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \ 136 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \ 137 | ;; \ 138 | 3.9|3.10) \ 139 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 140 | curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \ 141 | ;; \ 142 | 3.11|3.12|3.13) \ 143 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 144 | ;; \ 145 | esac && \ 146 | "python$VER" -m pip install --no-cache-dir cffi; \ 147 | done && \ 148 | python3 -m pip --version && \ 149 | python3 -m pip install --no-cache-dir auditwheel patchelf build && \ 150 | python3 -m pip install --no-cache-dir auditwheel-symbols 151 | -------------------------------------------------------------------------------- /manylinux_2_28/s390x/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM ubuntu:22.04 AS toolchain 3 | 4 | ENV DEBIAN_FRONTEND noninteractive 5 | 6 | RUN apt-get update && \ 7 | apt-get install --no-install-recommends -y \ 8 | automake \ 9 | bison \ 10 | bzip2 \ 11 | ca-certificates \ 12 | cmake \ 13 | curl \ 14 | file \ 15 | flex \ 16 | g++ \ 17 | gawk \ 18 | gdb \ 19 | git \ 20 | gperf \ 21 | help2man \ 22 | libncurses-dev \ 23 | libssl-dev \ 24 | libtool-bin \ 25 | lzip \ 26 | make \ 27 | ninja-build \ 28 | patch \ 29 | pkg-config \ 30 | python3 \ 31 | rsync \ 32 | sudo \ 33 | texinfo \ 34 | unzip \ 35 | wget \ 36 | xz-utils \ 37 | libssl-dev \ 38 | libffi-dev 39 | 40 | # Install crosstool-ng 41 | RUN curl -Lf https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.25.0.tar.gz | tar xzf - && \ 42 | cd crosstool-ng-crosstool-ng-1.25.0 && \ 43 | ./bootstrap && \ 44 | ./configure --prefix=/usr/local && \ 45 | make -j4 && \ 46 | make install && \ 47 | cd .. && rm -rf crosstool-ng-* 48 | 49 | COPY .config /tmp/toolchain.config 50 | 51 | # Build cross compiler 52 | RUN mkdir build && \ 53 | cd build && \ 54 | cp /tmp/toolchain.config .config && \ 55 | export CT_ALLOW_BUILD_AS_ROOT_SURE=1 && \ 56 | ct-ng build.2 || { tail -n 500 build.log; exit $ERRCODE; } && \ 57 | cd .. && \ 58 | rm -rf build 59 | 60 | FROM ubuntu:22.04 61 | 62 | # Copy cross toolchain 63 | COPY --from=toolchain /usr/s390x-ibm-linux-gnu /usr/s390x-ibm-linux-gnu 64 | 65 | ENV DEBIAN_FRONTEND noninteractive 66 | ENV PATH=$PATH:/usr/s390x-ibm-linux-gnu/bin 67 | 68 | ENV CC_s390x_unknown_linux_gnu=s390x-ibm-linux-gnu-gcc \ 69 | AR_s390x_unknown_linux_gnu=s390x-ibm-linux-gnu-ar \ 70 | CXX_s390x_unknown_linux_gnu=s390x-ibm-linux-gnu-g++ 71 | 72 | ENV TARGET_CC=s390x-ibm-linux-gnu-gcc \ 73 | TARGET_AR=s390x-ibm-linux-gnu-ar \ 74 | TARGET_RANLIB=s390x-ibm-linux-gnu-ranlib \ 75 | TARGET_CXX=s390x-ibm-linux-gnu-g++ \ 76 | TARGET_READELF=s390x-ibm-linux-gnu-readelf \ 77 | TARGET_SYSROOT=/usr/s390x-ibm-linux-gnu/s390x-ibm-linux-gnu/sysroot/ \ 78 | TARGET_C_INCLUDE_PATH=/usr/s390x-ibm-linux-gnu/s390x-ibm-linux-gnu/sysroot/usr/include/ 79 | 80 | ENV CARGO_BUILD_TARGET=s390x-unknown-linux-gnu 81 | ENV CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-ibm-linux-gnu-gcc 82 | RUN echo "set(CMAKE_SYSTEM_NAME Linux)\nset(CMAKE_SYSTEM_PROCESSOR s390x)\nset(CMAKE_SYSROOT /usr/s390x-ibm-linux-gnu/s390x-ibm-linux-gnu/sysroot/)\nset(CMAKE_C_COMPILER s390x-ibm-linux-gnu-gcc)\nset(CMAKE_CXX_COMPILER s390x-ibm-linux-gnu-g++)" > /usr/s390x-ibm-linux-gnu/cmake-toolchain.cmake 83 | ENV TARGET_CMAKE_TOOLCHAIN_FILE_PATH=/usr/s390x-ibm-linux-gnu/cmake-toolchain.cmake 84 | 85 | 86 | RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ 87 | apt-get update && \ 88 | apt-get install --no-install-recommends -y \ 89 | curl \ 90 | git \ 91 | g++ \ 92 | make \ 93 | sudo \ 94 | wget \ 95 | software-properties-common \ 96 | gpg-agent \ 97 | cmake \ 98 | llvm-dev \ 99 | libclang-dev \ 100 | clang 101 | 102 | ENV S390X_UNKNOWN_LINUX_GNU_OPENSSL_DIR=/usr/s390x-ibm-linux-gnu/ 103 | RUN add-apt-repository -y ppa:deadsnakes/ppa && \ 104 | apt-get update && \ 105 | apt-get install -y \ 106 | python3.7 python3.7-venv python3.7-dev \ 107 | python3.8 python3.8-venv python3.8-dev \ 108 | python3.9 python3.9-venv python3.9-dev \ 109 | python3.11 python3.11-venv python3.11-dev \ 110 | python3.12 python3.12-venv python3.12-dev \ 111 | python3.13 python3.13-venv python3.13-dev \ 112 | python3 python3-venv python3-dev python-is-python3 113 | 114 | RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else export PYPY_ARCH="aarch64"; fi && \ 115 | mkdir -p /usr/local/pypy/pypy3.7 && \ 116 | curl -sqL https://downloads.python.org/pypy/pypy3.7-v7.3.9-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.7 --strip-components=1 && \ 117 | ln -s /usr/local/pypy/pypy3.7/bin/pypy /usr/local/bin/pypy3.7 && \ 118 | mkdir -p /usr/local/pypy/pypy3.8 && \ 119 | curl -sqL https://downloads.python.org/pypy/pypy3.8-v7.3.11-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.8 --strip-components=1 && \ 120 | ln -s /usr/local/pypy/pypy3.8/bin/pypy /usr/local/bin/pypy3.8 && \ 121 | mkdir -p /usr/local/pypy/pypy3.9 && \ 122 | curl -sqL https://downloads.python.org/pypy/pypy3.9-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.9 --strip-components=1 && \ 123 | ln -s /usr/local/pypy/pypy3.9/bin/pypy /usr/local/bin/pypy3.9 && \ 124 | mkdir -p /usr/local/pypy/pypy3.10 && \ 125 | 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 && \ 126 | ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10 127 | 128 | 129 | RUN mkdir -p /opt/python 130 | 131 | RUN cd /tmp && \ 132 | VERS=3.7.17 && PREFIX=/opt/python/cp37-cp37m && \ 133 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 134 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 135 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=s390x-ibm-linux-gnu --target=s390x-ibm-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 && \ 136 | make -j4 && make -j4 install && \ 137 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 138 | # we don't need libpython*.a, and they're many megabytes 139 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 140 | # We do not need the Python test suites 141 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 142 | # We do not need precompiled .pyc and .pyo files. 143 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 144 | 145 | RUN cd /tmp && \ 146 | VERS=3.8.20 && PREFIX=/opt/python/cp38-cp38 && \ 147 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 148 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 149 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=s390x-ibm-linux-gnu --target=s390x-ibm-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 && \ 150 | make -j4 && make -j4 install && \ 151 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 152 | # we don't need libpython*.a, and they're many megabytes 153 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 154 | # We do not need the Python test suites 155 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 156 | # We do not need precompiled .pyc and .pyo files. 157 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 158 | 159 | RUN cd /tmp && \ 160 | VERS=3.9.22 && PREFIX=/opt/python/cp39-cp39 && \ 161 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 162 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 163 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=s390x-ibm-linux-gnu --target=s390x-ibm-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 && \ 164 | make -j4 && make -j4 install && \ 165 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 166 | # we don't need libpython*.a, and they're many megabytes 167 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 168 | # We do not need the Python test suites 169 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 170 | # We do not need precompiled .pyc and .pyo files. 171 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 172 | 173 | RUN cd /tmp && \ 174 | VERS=3.10.17 && PREFIX=/opt/python/cp310-cp310 && \ 175 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 176 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 177 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=s390x-ibm-linux-gnu --target=s390x-ibm-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 && \ 178 | make -j4 && make -j4 install && \ 179 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 180 | # we don't need libpython*.a, and they're many megabytes 181 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 182 | # We do not need the Python test suites 183 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 184 | # We do not need precompiled .pyc and .pyo files. 185 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 186 | 187 | RUN cd /tmp && \ 188 | VERS=3.11.12 && PREFIX=/opt/python/cp311-cp311 && \ 189 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 190 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 191 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=s390x-ibm-linux-gnu --target=s390x-ibm-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 && \ 192 | make -j4 && make -j4 install && \ 193 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 194 | # we don't need libpython*.a, and they're many megabytes 195 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 196 | # We do not need the Python test suites 197 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 198 | # We do not need precompiled .pyc and .pyo files. 199 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 200 | 201 | RUN cd /tmp && \ 202 | VERS=3.12.10 && PREFIX=/opt/python/cp312-cp312 && \ 203 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 204 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 205 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=s390x-ibm-linux-gnu --target=s390x-ibm-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 && \ 206 | make -j4 && make -j4 install && \ 207 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 208 | # we don't need libpython*.a, and they're many megabytes 209 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 210 | # We do not need the Python test suites 211 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 212 | # We do not need precompiled .pyc and .pyo files. 213 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 214 | 215 | RUN cd /tmp && \ 216 | VERS=3.13.3 && PREFIX=/opt/python/cp313-cp313 && \ 217 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 218 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 219 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=s390x-ibm-linux-gnu --target=s390x-ibm-linux-gnu --prefix=$PREFIX --disable-shared --with-build-python=python3.13 --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 && \ 220 | make -j4 && make -j4 install && \ 221 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 222 | # we don't need libpython*.a, and they're many megabytes 223 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 224 | # We do not need the Python test suites 225 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 226 | # We do not need precompiled .pyc and .pyo files. 227 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 228 | RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \ 229 | case $VER in \ 230 | 3.7|3.8) \ 231 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \ 232 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \ 233 | ;; \ 234 | 3.9|3.10) \ 235 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 236 | curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \ 237 | ;; \ 238 | 3.11|3.12|3.13) \ 239 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 240 | ;; \ 241 | esac && \ 242 | "python$VER" -m pip install --no-cache-dir cffi; \ 243 | done && \ 244 | python3 -m pip --version && \ 245 | python3 -m pip install --no-cache-dir auditwheel patchelf build && \ 246 | python3 -m pip install --no-cache-dir auditwheel-symbols 247 | -------------------------------------------------------------------------------- /manylinux_2_28/x86_64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/pypa/manylinux_2_28_x86_64 AS manylinux 2 | 3 | FROM ubuntu:22.04 AS toolchain 4 | 5 | ENV DEBIAN_FRONTEND noninteractive 6 | 7 | RUN apt-get update && \ 8 | apt-get install --no-install-recommends -y \ 9 | automake \ 10 | bison \ 11 | bzip2 \ 12 | ca-certificates \ 13 | cmake \ 14 | curl \ 15 | file \ 16 | flex \ 17 | g++ \ 18 | gawk \ 19 | gdb \ 20 | git \ 21 | gperf \ 22 | help2man \ 23 | libncurses-dev \ 24 | libssl-dev \ 25 | libtool-bin \ 26 | lzip \ 27 | make \ 28 | ninja-build \ 29 | patch \ 30 | pkg-config \ 31 | python3 \ 32 | rsync \ 33 | sudo \ 34 | texinfo \ 35 | unzip \ 36 | wget \ 37 | xz-utils \ 38 | libssl-dev \ 39 | libffi-dev 40 | 41 | # Install crosstool-ng 42 | RUN curl -Lf https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.25.0.tar.gz | tar xzf - && \ 43 | cd crosstool-ng-crosstool-ng-1.25.0 && \ 44 | ./bootstrap && \ 45 | ./configure --prefix=/usr/local && \ 46 | make -j4 && \ 47 | make install && \ 48 | cd .. && rm -rf crosstool-ng-* 49 | 50 | COPY .config /tmp/toolchain.config 51 | 52 | # Build cross compiler 53 | RUN mkdir build && \ 54 | cd build && \ 55 | cp /tmp/toolchain.config .config && \ 56 | export CT_ALLOW_BUILD_AS_ROOT_SURE=1 && \ 57 | ct-ng build.2 || { tail -n 500 build.log; exit $ERRCODE; } && \ 58 | cd .. && \ 59 | rm -rf build 60 | 61 | FROM ubuntu:22.04 62 | 63 | # Copy cross toolchain 64 | COPY --from=toolchain /usr/x86_64-unknown-linux-gnu /usr/x86_64-unknown-linux-gnu 65 | 66 | ENV DEBIAN_FRONTEND noninteractive 67 | ENV PATH=$PATH:/usr/x86_64-unknown-linux-gnu/bin 68 | 69 | ENV CC_x86_64_unknown_linux_gnu=x86_64-unknown-linux-gnu-gcc \ 70 | AR_x86_64_unknown_linux_gnu=x86_64-unknown-linux-gnu-ar \ 71 | CXX_x86_64_unknown_linux_gnu=x86_64-unknown-linux-gnu-g++ 72 | 73 | ENV TARGET_CC=x86_64-unknown-linux-gnu-gcc \ 74 | TARGET_AR=x86_64-unknown-linux-gnu-ar \ 75 | TARGET_RANLIB=x86_64-unknown-linux-gnu-ranlib \ 76 | TARGET_CXX=x86_64-unknown-linux-gnu-g++ \ 77 | TARGET_READELF=x86_64-unknown-linux-gnu-readelf \ 78 | TARGET_SYSROOT=/usr/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/ \ 79 | TARGET_C_INCLUDE_PATH=/usr/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/usr/include/ 80 | 81 | ENV CARGO_BUILD_TARGET=x86_64-unknown-linux-gnu 82 | ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-unknown-linux-gnu-gcc 83 | RUN echo "set(CMAKE_SYSTEM_NAME Linux)\nset(CMAKE_SYSTEM_PROCESSOR x86_64)\nset(CMAKE_SYSROOT /usr/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/)\nset(CMAKE_C_COMPILER x86_64-unknown-linux-gnu-gcc)\nset(CMAKE_CXX_COMPILER x86_64-unknown-linux-gnu-g++)" > /usr/x86_64-unknown-linux-gnu/cmake-toolchain.cmake 84 | ENV TARGET_CMAKE_TOOLCHAIN_FILE_PATH=/usr/x86_64-unknown-linux-gnu/cmake-toolchain.cmake 85 | 86 | 87 | RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ 88 | apt-get update && \ 89 | apt-get install --no-install-recommends -y \ 90 | curl \ 91 | git \ 92 | g++ \ 93 | make \ 94 | sudo \ 95 | wget \ 96 | software-properties-common \ 97 | gpg-agent \ 98 | cmake \ 99 | llvm-dev \ 100 | libclang-dev \ 101 | clang 102 | 103 | ENV X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR=/usr/x86_64-unknown-linux-gnu/ 104 | RUN add-apt-repository -y ppa:deadsnakes/ppa && \ 105 | apt-get update && \ 106 | apt-get install -y \ 107 | python3.7 python3.7-venv python3.7-dev \ 108 | python3.8 python3.8-venv python3.8-dev \ 109 | python3.9 python3.9-venv python3.9-dev \ 110 | python3.11 python3.11-venv python3.11-dev \ 111 | python3.12 python3.12-venv python3.12-dev \ 112 | python3.13 python3.13-venv python3.13-dev \ 113 | python3 python3-venv python3-dev python-is-python3 114 | 115 | RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else export PYPY_ARCH="aarch64"; fi && \ 116 | mkdir -p /usr/local/pypy/pypy3.7 && \ 117 | curl -sqL https://downloads.python.org/pypy/pypy3.7-v7.3.9-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.7 --strip-components=1 && \ 118 | ln -s /usr/local/pypy/pypy3.7/bin/pypy /usr/local/bin/pypy3.7 && \ 119 | mkdir -p /usr/local/pypy/pypy3.8 && \ 120 | curl -sqL https://downloads.python.org/pypy/pypy3.8-v7.3.11-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.8 --strip-components=1 && \ 121 | ln -s /usr/local/pypy/pypy3.8/bin/pypy /usr/local/bin/pypy3.8 && \ 122 | mkdir -p /usr/local/pypy/pypy3.9 && \ 123 | curl -sqL https://downloads.python.org/pypy/pypy3.9-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.9 --strip-components=1 && \ 124 | ln -s /usr/local/pypy/pypy3.9/bin/pypy /usr/local/bin/pypy3.9 && \ 125 | mkdir -p /usr/local/pypy/pypy3.10 && \ 126 | 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 && \ 127 | ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10 128 | 129 | COPY --from=manylinux /opt/_internal /opt/_internal 130 | COPY --from=manylinux /opt/python /opt/python 131 | 132 | RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \ 133 | case $VER in \ 134 | 3.7|3.8) \ 135 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \ 136 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \ 137 | ;; \ 138 | 3.9|3.10) \ 139 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 140 | curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \ 141 | ;; \ 142 | 3.11|3.12|3.13) \ 143 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 144 | ;; \ 145 | esac && \ 146 | "python$VER" -m pip install --no-cache-dir cffi; \ 147 | done && \ 148 | python3 -m pip --version && \ 149 | python3 -m pip install --no-cache-dir auditwheel patchelf build && \ 150 | python3 -m pip install --no-cache-dir auditwheel-symbols 151 | -------------------------------------------------------------------------------- /manylinux_2_31/riscv64/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM ubuntu:22.04 AS toolchain 3 | 4 | ENV DEBIAN_FRONTEND noninteractive 5 | 6 | RUN apt-get update && \ 7 | apt-get install --no-install-recommends -y \ 8 | automake \ 9 | bison \ 10 | bzip2 \ 11 | ca-certificates \ 12 | cmake \ 13 | curl \ 14 | file \ 15 | flex \ 16 | g++ \ 17 | gawk \ 18 | gdb \ 19 | git \ 20 | gperf \ 21 | help2man \ 22 | libncurses-dev \ 23 | libssl-dev \ 24 | libtool-bin \ 25 | lzip \ 26 | make \ 27 | ninja-build \ 28 | patch \ 29 | pkg-config \ 30 | python3 \ 31 | rsync \ 32 | sudo \ 33 | texinfo \ 34 | unzip \ 35 | wget \ 36 | xz-utils \ 37 | libssl-dev \ 38 | libffi-dev 39 | 40 | # Install crosstool-ng 41 | RUN curl -Lf https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.27.0.tar.gz | tar xzf - && \ 42 | cd crosstool-ng-crosstool-ng-1.27.0 && \ 43 | # Backport https://github.com/crosstool-ng/crosstool-ng/pull/{2315,2316} to fix build 44 | curl -Lf https://github.com/crosstool-ng/crosstool-ng/pull/2315.patch | patch -Np1 && \ 45 | curl -Lf https://github.com/crosstool-ng/crosstool-ng/pull/2316.patch | patch -Np1 && \ 46 | ./bootstrap && \ 47 | ./configure --prefix=/usr/local && \ 48 | make -j4 && \ 49 | make install && \ 50 | cd .. && rm -rf crosstool-ng-* 51 | 52 | COPY .config /tmp/toolchain.config 53 | 54 | # Build cross compiler 55 | RUN mkdir build && \ 56 | cd build && \ 57 | cp /tmp/toolchain.config .config && \ 58 | export CT_ALLOW_BUILD_AS_ROOT_SURE=1 && \ 59 | ct-ng build.2 || { tail -n 500 build.log; exit $ERRCODE; } && \ 60 | cd .. && \ 61 | rm -rf build 62 | 63 | FROM ubuntu:22.04 64 | 65 | # Copy cross toolchain 66 | COPY --from=toolchain /usr/riscv64-unknown-linux-gnu /usr/riscv64-unknown-linux-gnu 67 | 68 | ENV DEBIAN_FRONTEND noninteractive 69 | ENV PATH=$PATH:/usr/riscv64-unknown-linux-gnu/bin 70 | 71 | ENV CC_riscv64_unknown_linux_gnu=riscv64-unknown-linux-gnu-gcc \ 72 | AR_riscv64_unknown_linux_gnu=riscv64-unknown-linux-gnu-ar \ 73 | CXX_riscv64_unknown_linux_gnu=riscv64-unknown-linux-gnu-g++ 74 | 75 | ENV TARGET_CC=riscv64-unknown-linux-gnu-gcc \ 76 | TARGET_AR=riscv64-unknown-linux-gnu-ar \ 77 | TARGET_RANLIB=riscv64-unknown-linux-gnu-ranlib \ 78 | TARGET_CXX=riscv64-unknown-linux-gnu-g++ \ 79 | TARGET_READELF=riscv64-unknown-linux-gnu-readelf \ 80 | TARGET_SYSROOT=/usr/riscv64-unknown-linux-gnu/riscv64-unknown-linux-gnu/sysroot/ \ 81 | TARGET_C_INCLUDE_PATH=/usr/riscv64-unknown-linux-gnu/riscv64-unknown-linux-gnu/sysroot/usr/include/ 82 | 83 | ENV CARGO_BUILD_TARGET=riscv64gc-unknown-linux-gnu 84 | ENV CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER=riscv64-unknown-linux-gnu-gcc 85 | RUN echo "set(CMAKE_SYSTEM_NAME Linux)\nset(CMAKE_SYSTEM_PROCESSOR riscv64)\nset(CMAKE_SYSROOT /usr/riscv64-unknown-linux-gnu/riscv64-unknown-linux-gnu/sysroot/)\nset(CMAKE_C_COMPILER riscv64-unknown-linux-gnu-gcc)\nset(CMAKE_CXX_COMPILER riscv64-unknown-linux-gnu-g++)" > /usr/riscv64-unknown-linux-gnu/cmake-toolchain.cmake 86 | ENV TARGET_CMAKE_TOOLCHAIN_FILE_PATH=/usr/riscv64-unknown-linux-gnu/cmake-toolchain.cmake 87 | 88 | 89 | RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ 90 | apt-get update && \ 91 | apt-get install --no-install-recommends -y \ 92 | curl \ 93 | git \ 94 | g++ \ 95 | make \ 96 | sudo \ 97 | wget \ 98 | software-properties-common \ 99 | gpg-agent \ 100 | cmake \ 101 | llvm-dev \ 102 | libclang-dev \ 103 | clang 104 | 105 | ENV RISCV64_UNKNOWN_LINUX_GNU_OPENSSL_DIR=/usr/riscv64-unknown-linux-gnu/ 106 | RUN add-apt-repository -y ppa:deadsnakes/ppa && \ 107 | apt-get update && \ 108 | apt-get install -y \ 109 | python3.7 python3.7-venv python3.7-dev \ 110 | python3.8 python3.8-venv python3.8-dev \ 111 | python3.9 python3.9-venv python3.9-dev \ 112 | python3.11 python3.11-venv python3.11-dev \ 113 | python3.12 python3.12-venv python3.12-dev \ 114 | python3.13 python3.13-venv python3.13-dev \ 115 | python3 python3-venv python3-dev python-is-python3 116 | 117 | RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else export PYPY_ARCH="aarch64"; fi && \ 118 | mkdir -p /usr/local/pypy/pypy3.7 && \ 119 | curl -sqL https://downloads.python.org/pypy/pypy3.7-v7.3.9-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.7 --strip-components=1 && \ 120 | ln -s /usr/local/pypy/pypy3.7/bin/pypy /usr/local/bin/pypy3.7 && \ 121 | mkdir -p /usr/local/pypy/pypy3.8 && \ 122 | curl -sqL https://downloads.python.org/pypy/pypy3.8-v7.3.11-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.8 --strip-components=1 && \ 123 | ln -s /usr/local/pypy/pypy3.8/bin/pypy /usr/local/bin/pypy3.8 && \ 124 | mkdir -p /usr/local/pypy/pypy3.9 && \ 125 | curl -sqL https://downloads.python.org/pypy/pypy3.9-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.9 --strip-components=1 && \ 126 | ln -s /usr/local/pypy/pypy3.9/bin/pypy /usr/local/bin/pypy3.9 && \ 127 | mkdir -p /usr/local/pypy/pypy3.10 && \ 128 | 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 && \ 129 | ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10 130 | 131 | 132 | RUN mkdir -p /opt/python 133 | 134 | RUN cd /tmp && \ 135 | VERS=3.7.17 && PREFIX=/opt/python/cp37-cp37m && \ 136 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 137 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 138 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=riscv64-unknown-linux-gnu --target=riscv64-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 && \ 139 | make -j4 && make -j4 install && \ 140 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 141 | # we don't need libpython*.a, and they're many megabytes 142 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 143 | # We do not need the Python test suites 144 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 145 | # We do not need precompiled .pyc and .pyo files. 146 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 147 | 148 | RUN cd /tmp && \ 149 | VERS=3.8.20 && PREFIX=/opt/python/cp38-cp38 && \ 150 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 151 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 152 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=riscv64-unknown-linux-gnu --target=riscv64-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 && \ 153 | make -j4 && make -j4 install && \ 154 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 155 | # we don't need libpython*.a, and they're many megabytes 156 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 157 | # We do not need the Python test suites 158 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 159 | # We do not need precompiled .pyc and .pyo files. 160 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 161 | 162 | RUN cd /tmp && \ 163 | VERS=3.9.22 && PREFIX=/opt/python/cp39-cp39 && \ 164 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 165 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 166 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=riscv64-unknown-linux-gnu --target=riscv64-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 && \ 167 | make -j4 && make -j4 install && \ 168 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 169 | # we don't need libpython*.a, and they're many megabytes 170 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 171 | # We do not need the Python test suites 172 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 173 | # We do not need precompiled .pyc and .pyo files. 174 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 175 | 176 | RUN cd /tmp && \ 177 | VERS=3.10.17 && PREFIX=/opt/python/cp310-cp310 && \ 178 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 179 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 180 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=riscv64-unknown-linux-gnu --target=riscv64-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 && \ 181 | make -j4 && make -j4 install && \ 182 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 183 | # we don't need libpython*.a, and they're many megabytes 184 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 185 | # We do not need the Python test suites 186 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 187 | # We do not need precompiled .pyc and .pyo files. 188 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 189 | 190 | RUN cd /tmp && \ 191 | VERS=3.11.12 && PREFIX=/opt/python/cp311-cp311 && \ 192 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 193 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 194 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=riscv64-unknown-linux-gnu --target=riscv64-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 && \ 195 | make -j4 && make -j4 install && \ 196 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 197 | # we don't need libpython*.a, and they're many megabytes 198 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 199 | # We do not need the Python test suites 200 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 201 | # We do not need precompiled .pyc and .pyo files. 202 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 203 | 204 | RUN cd /tmp && \ 205 | VERS=3.12.10 && PREFIX=/opt/python/cp312-cp312 && \ 206 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 207 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 208 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=riscv64-unknown-linux-gnu --target=riscv64-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 && \ 209 | make -j4 && make -j4 install && \ 210 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 211 | # we don't need libpython*.a, and they're many megabytes 212 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 213 | # We do not need the Python test suites 214 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 215 | # We do not need precompiled .pyc and .pyo files. 216 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 217 | 218 | RUN cd /tmp && \ 219 | VERS=3.13.3 && PREFIX=/opt/python/cp313-cp313 && \ 220 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 221 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 222 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=riscv64-unknown-linux-gnu --target=riscv64-unknown-linux-gnu --prefix=$PREFIX --disable-shared --with-build-python=python3.13 --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 ac_cv_libatomic_needed=yes && \ 223 | make -j4 && make -j4 install && \ 224 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 225 | # we don't need libpython*.a, and they're many megabytes 226 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 227 | # We do not need the Python test suites 228 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 229 | # We do not need precompiled .pyc and .pyo files. 230 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 231 | RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \ 232 | case $VER in \ 233 | 3.7|3.8) \ 234 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \ 235 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \ 236 | ;; \ 237 | 3.9|3.10) \ 238 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 239 | curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \ 240 | ;; \ 241 | 3.11|3.12|3.13) \ 242 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 243 | ;; \ 244 | esac && \ 245 | "python$VER" -m pip install --no-cache-dir cffi; \ 246 | done && \ 247 | python3 -m pip --version && \ 248 | python3 -m pip install --no-cache-dir auditwheel patchelf build && \ 249 | python3 -m pip install --no-cache-dir auditwheel-symbols 250 | -------------------------------------------------------------------------------- /manylinux_2_36/loongarch64/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM ubuntu:22.04 AS toolchain 3 | 4 | ENV DEBIAN_FRONTEND noninteractive 5 | 6 | RUN apt-get update && \ 7 | apt-get install --no-install-recommends -y \ 8 | automake \ 9 | bison \ 10 | bzip2 \ 11 | ca-certificates \ 12 | cmake \ 13 | curl \ 14 | file \ 15 | flex \ 16 | g++ \ 17 | gawk \ 18 | gdb \ 19 | git \ 20 | gperf \ 21 | help2man \ 22 | libncurses-dev \ 23 | libssl-dev \ 24 | libtool-bin \ 25 | lzip \ 26 | make \ 27 | ninja-build \ 28 | patch \ 29 | pkg-config \ 30 | python3 \ 31 | rsync \ 32 | sudo \ 33 | texinfo \ 34 | unzip \ 35 | wget \ 36 | xz-utils \ 37 | libssl-dev \ 38 | libffi-dev 39 | 40 | # Install crosstool-ng 41 | RUN curl -Lf https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.27.0.tar.gz | tar xzf - && \ 42 | cd crosstool-ng-crosstool-ng-1.27.0 && \ 43 | ./bootstrap && \ 44 | ./configure --prefix=/usr/local && \ 45 | make -j4 && \ 46 | make install && \ 47 | cd .. && rm -rf crosstool-ng-* 48 | 49 | COPY .config /tmp/toolchain.config 50 | 51 | # Build cross compiler 52 | RUN mkdir build && \ 53 | cd build && \ 54 | cp /tmp/toolchain.config .config && \ 55 | export CT_ALLOW_BUILD_AS_ROOT_SURE=1 && \ 56 | ct-ng build.2 || { tail -n 500 build.log; exit $ERRCODE; } && \ 57 | cd .. && \ 58 | rm -rf build 59 | 60 | FROM ubuntu:22.04 61 | 62 | # Copy cross toolchain 63 | COPY --from=toolchain /usr/loongarch64-unknown-linux-gnu /usr/loongarch64-unknown-linux-gnu 64 | 65 | ENV DEBIAN_FRONTEND noninteractive 66 | ENV PATH=$PATH:/usr/loongarch64-unknown-linux-gnu/bin 67 | 68 | ENV CC_loongarch64_unknown_linux_gnu=loongarch64-unknown-linux-gnu-gcc \ 69 | AR_loongarch64_unknown_linux_gnu=loongarch64-unknown-linux-gnu-ar \ 70 | CXX_loongarch64_unknown_linux_gnu=loongarch64-unknown-linux-gnu-g++ 71 | 72 | ENV TARGET_CC=loongarch64-unknown-linux-gnu-gcc \ 73 | TARGET_AR=loongarch64-unknown-linux-gnu-ar \ 74 | TARGET_RANLIB=loongarch64-unknown-linux-gnu-ranlib \ 75 | TARGET_CXX=loongarch64-unknown-linux-gnu-g++ \ 76 | TARGET_READELF=loongarch64-unknown-linux-gnu-readelf \ 77 | TARGET_SYSROOT=/usr/loongarch64-unknown-linux-gnu/loongarch64-unknown-linux-gnu/sysroot/ \ 78 | TARGET_C_INCLUDE_PATH=/usr/loongarch64-unknown-linux-gnu/loongarch64-unknown-linux-gnu/sysroot/usr/include/ 79 | 80 | ENV CARGO_BUILD_TARGET=loongarch64-unknown-linux-gnu 81 | ENV CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_LINKER=loongarch64-unknown-linux-gnu-gcc 82 | RUN echo "set(CMAKE_SYSTEM_NAME Linux)\nset(CMAKE_SYSTEM_PROCESSOR loongarch64)\nset(CMAKE_SYSROOT /usr/loongarch64-unknown-linux-gnu/loongarch64-unknown-linux-gnu/sysroot/)\nset(CMAKE_C_COMPILER loongarch64-unknown-linux-gnu-gcc)\nset(CMAKE_CXX_COMPILER loongarch64-unknown-linux-gnu-g++)" > /usr/loongarch64-unknown-linux-gnu/cmake-toolchain.cmake 83 | ENV TARGET_CMAKE_TOOLCHAIN_FILE_PATH=/usr/loongarch64-unknown-linux-gnu/cmake-toolchain.cmake 84 | 85 | 86 | RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ 87 | apt-get update && \ 88 | apt-get install --no-install-recommends -y \ 89 | curl \ 90 | git \ 91 | g++ \ 92 | make \ 93 | sudo \ 94 | wget \ 95 | software-properties-common \ 96 | gpg-agent \ 97 | cmake \ 98 | llvm-dev \ 99 | libclang-dev \ 100 | clang 101 | 102 | ENV LOONGARCH64_UNKNOWN_LINUX_GNU_OPENSSL_DIR=/usr/loongarch64-unknown-linux-gnu/ 103 | RUN add-apt-repository -y ppa:deadsnakes/ppa && \ 104 | apt-get update && \ 105 | apt-get install -y \ 106 | python3.7 python3.7-venv python3.7-dev \ 107 | python3.8 python3.8-venv python3.8-dev \ 108 | python3.9 python3.9-venv python3.9-dev \ 109 | python3.11 python3.11-venv python3.11-dev \ 110 | python3.12 python3.12-venv python3.12-dev \ 111 | python3.13 python3.13-venv python3.13-dev \ 112 | python3 python3-venv python3-dev python-is-python3 113 | 114 | RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else export PYPY_ARCH="aarch64"; fi && \ 115 | mkdir -p /usr/local/pypy/pypy3.7 && \ 116 | curl -sqL https://downloads.python.org/pypy/pypy3.7-v7.3.9-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.7 --strip-components=1 && \ 117 | ln -s /usr/local/pypy/pypy3.7/bin/pypy /usr/local/bin/pypy3.7 && \ 118 | mkdir -p /usr/local/pypy/pypy3.8 && \ 119 | curl -sqL https://downloads.python.org/pypy/pypy3.8-v7.3.11-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.8 --strip-components=1 && \ 120 | ln -s /usr/local/pypy/pypy3.8/bin/pypy /usr/local/bin/pypy3.8 && \ 121 | mkdir -p /usr/local/pypy/pypy3.9 && \ 122 | curl -sqL https://downloads.python.org/pypy/pypy3.9-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.9 --strip-components=1 && \ 123 | ln -s /usr/local/pypy/pypy3.9/bin/pypy /usr/local/bin/pypy3.9 && \ 124 | mkdir -p /usr/local/pypy/pypy3.10 && \ 125 | 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 && \ 126 | ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10 127 | 128 | 129 | RUN mkdir -p /opt/python 130 | 131 | RUN cd /tmp && \ 132 | VERS=3.7.17 && PREFIX=/opt/python/cp37-cp37m && \ 133 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 134 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 135 | curl -LO 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub' && \ 136 | curl -LO 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess' && \ 137 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=loongarch64-unknown-linux-gnu --target=loongarch64-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 && \ 138 | make -j4 && make -j4 install && \ 139 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 140 | # we don't need libpython*.a, and they're many megabytes 141 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 142 | # We do not need the Python test suites 143 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 144 | # We do not need precompiled .pyc and .pyo files. 145 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 146 | 147 | RUN cd /tmp && \ 148 | VERS=3.8.20 && PREFIX=/opt/python/cp38-cp38 && \ 149 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 150 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 151 | curl -LO 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub' && \ 152 | curl -LO 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess' && \ 153 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=loongarch64-unknown-linux-gnu --target=loongarch64-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 && \ 154 | make -j4 && make -j4 install && \ 155 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 156 | # we don't need libpython*.a, and they're many megabytes 157 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 158 | # We do not need the Python test suites 159 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 160 | # We do not need precompiled .pyc and .pyo files. 161 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 162 | 163 | RUN cd /tmp && \ 164 | VERS=3.9.22 && PREFIX=/opt/python/cp39-cp39 && \ 165 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 166 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 167 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=loongarch64-unknown-linux-gnu --target=loongarch64-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 && \ 168 | make -j4 && make -j4 install && \ 169 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 170 | # we don't need libpython*.a, and they're many megabytes 171 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 172 | # We do not need the Python test suites 173 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 174 | # We do not need precompiled .pyc and .pyo files. 175 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 176 | 177 | RUN cd /tmp && \ 178 | VERS=3.10.17 && PREFIX=/opt/python/cp310-cp310 && \ 179 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 180 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 181 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=loongarch64-unknown-linux-gnu --target=loongarch64-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 && \ 182 | make -j4 && make -j4 install && \ 183 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 184 | # we don't need libpython*.a, and they're many megabytes 185 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 186 | # We do not need the Python test suites 187 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 188 | # We do not need precompiled .pyc and .pyo files. 189 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 190 | 191 | RUN cd /tmp && \ 192 | VERS=3.11.12 && PREFIX=/opt/python/cp311-cp311 && \ 193 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 194 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 195 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=loongarch64-unknown-linux-gnu --target=loongarch64-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 && \ 196 | make -j4 && make -j4 install && \ 197 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 198 | # we don't need libpython*.a, and they're many megabytes 199 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 200 | # We do not need the Python test suites 201 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 202 | # We do not need precompiled .pyc and .pyo files. 203 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 204 | 205 | RUN cd /tmp && \ 206 | VERS=3.12.10 && PREFIX=/opt/python/cp312-cp312 && \ 207 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 208 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 209 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=loongarch64-unknown-linux-gnu --target=loongarch64-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 && \ 210 | make -j4 && make -j4 install && \ 211 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 212 | # we don't need libpython*.a, and they're many megabytes 213 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 214 | # We do not need the Python test suites 215 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 216 | # We do not need precompiled .pyc and .pyo files. 217 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 218 | 219 | RUN cd /tmp && \ 220 | VERS=3.13.3 && PREFIX=/opt/python/cp313-cp313 && \ 221 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 222 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 223 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=loongarch64-unknown-linux-gnu --target=loongarch64-unknown-linux-gnu --prefix=$PREFIX --disable-shared --with-build-python=python3.13 --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 ac_cv_libatomic_needed=yes && \ 224 | make -j4 && make -j4 install && \ 225 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 226 | # we don't need libpython*.a, and they're many megabytes 227 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 228 | # We do not need the Python test suites 229 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 230 | # We do not need precompiled .pyc and .pyo files. 231 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 232 | RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \ 233 | case $VER in \ 234 | 3.7|3.8) \ 235 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \ 236 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \ 237 | ;; \ 238 | 3.9|3.10) \ 239 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 240 | curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \ 241 | ;; \ 242 | 3.11|3.12|3.13) \ 243 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 244 | ;; \ 245 | esac && \ 246 | "python$VER" -m pip install --no-cache-dir cffi; \ 247 | done && \ 248 | python3 -m pip --version && \ 249 | python3 -m pip install --no-cache-dir auditwheel patchelf build && \ 250 | python3 -m pip install --no-cache-dir auditwheel-symbols 251 | -------------------------------------------------------------------------------- /musllinux_1_2/aarch64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/pypa/musllinux_1_1_aarch64 as musllinux 2 | 3 | FROM messense/rust-musl-cross:aarch64-musl 4 | 5 | ENV TARGET_READELF=aarch64-unknown-linux-musl-readelf 6 | 7 | RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ 8 | apt-get update && \ 9 | apt-get install --no-install-recommends -y \ 10 | curl \ 11 | git \ 12 | g++ \ 13 | make \ 14 | sudo \ 15 | wget \ 16 | software-properties-common \ 17 | gpg-agent \ 18 | cmake \ 19 | llvm-dev \ 20 | libclang-dev \ 21 | clang 22 | 23 | RUN add-apt-repository -y ppa:deadsnakes/ppa && \ 24 | apt-get update && \ 25 | apt-get install -y \ 26 | python3.7 python3.7-venv python3.7-dev \ 27 | python3.8 python3.8-venv python3.8-dev \ 28 | python3.9 python3.9-venv python3.9-dev \ 29 | python3.11 python3.11-venv python3.11-dev \ 30 | python3.12 python3.12-venv python3.12-dev \ 31 | python3.13 python3.13-venv python3.13-dev \ 32 | python3 python3-venv python3-dev python-is-python3 33 | 34 | RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else export PYPY_ARCH="aarch64"; fi && \ 35 | mkdir -p /usr/local/pypy/pypy3.7 && \ 36 | curl -sqL https://downloads.python.org/pypy/pypy3.7-v7.3.9-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.7 --strip-components=1 && \ 37 | ln -s /usr/local/pypy/pypy3.7/bin/pypy /usr/local/bin/pypy3.7 && \ 38 | mkdir -p /usr/local/pypy/pypy3.8 && \ 39 | curl -sqL https://downloads.python.org/pypy/pypy3.8-v7.3.11-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.8 --strip-components=1 && \ 40 | ln -s /usr/local/pypy/pypy3.8/bin/pypy /usr/local/bin/pypy3.8 && \ 41 | mkdir -p /usr/local/pypy/pypy3.9 && \ 42 | curl -sqL https://downloads.python.org/pypy/pypy3.9-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.9 --strip-components=1 && \ 43 | ln -s /usr/local/pypy/pypy3.9/bin/pypy /usr/local/bin/pypy3.9 && \ 44 | mkdir -p /usr/local/pypy/pypy3.10 && \ 45 | 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 && \ 46 | ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10 47 | 48 | COPY --from=musllinux /opt/_internal /opt/_internal 49 | COPY --from=musllinux /opt/python /opt/python 50 | 51 | RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \ 52 | case $VER in \ 53 | 3.7|3.8) \ 54 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \ 55 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \ 56 | ;; \ 57 | 3.9|3.10) \ 58 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 59 | curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \ 60 | ;; \ 61 | 3.11|3.12|3.13) \ 62 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 63 | ;; \ 64 | esac && \ 65 | "python$VER" -m pip install --no-cache-dir cffi; \ 66 | done && \ 67 | python3 -m pip --version && \ 68 | python3 -m pip install --no-cache-dir auditwheel patchelf build && \ 69 | python3 -m pip install --no-cache-dir auditwheel-symbols 70 | -------------------------------------------------------------------------------- /musllinux_1_2/armv7l/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM messense/rust-musl-cross:armv7-musleabihf 3 | 4 | ENV TARGET_READELF=armv7-unknown-linux-musleabihf-readelf 5 | 6 | RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ 7 | apt-get update && \ 8 | apt-get install --no-install-recommends -y \ 9 | curl \ 10 | git \ 11 | g++ \ 12 | make \ 13 | sudo \ 14 | wget \ 15 | software-properties-common \ 16 | gpg-agent \ 17 | cmake \ 18 | llvm-dev \ 19 | libclang-dev \ 20 | clang 21 | 22 | ENV ARMV7_UNKNOWN_LINUX_MUSLEABIHF_OPENSSL_DIR=/usr/armv7-unknown-linux-musleabihf/ 23 | RUN add-apt-repository -y ppa:deadsnakes/ppa && \ 24 | apt-get update && \ 25 | apt-get install -y \ 26 | python3.7 python3.7-venv python3.7-dev \ 27 | python3.8 python3.8-venv python3.8-dev \ 28 | python3.9 python3.9-venv python3.9-dev \ 29 | python3.11 python3.11-venv python3.11-dev \ 30 | python3.12 python3.12-venv python3.12-dev \ 31 | python3.13 python3.13-venv python3.13-dev \ 32 | python3 python3-venv python3-dev python-is-python3 33 | 34 | RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else export PYPY_ARCH="aarch64"; fi && \ 35 | mkdir -p /usr/local/pypy/pypy3.7 && \ 36 | curl -sqL https://downloads.python.org/pypy/pypy3.7-v7.3.9-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.7 --strip-components=1 && \ 37 | ln -s /usr/local/pypy/pypy3.7/bin/pypy /usr/local/bin/pypy3.7 && \ 38 | mkdir -p /usr/local/pypy/pypy3.8 && \ 39 | curl -sqL https://downloads.python.org/pypy/pypy3.8-v7.3.11-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.8 --strip-components=1 && \ 40 | ln -s /usr/local/pypy/pypy3.8/bin/pypy /usr/local/bin/pypy3.8 && \ 41 | mkdir -p /usr/local/pypy/pypy3.9 && \ 42 | curl -sqL https://downloads.python.org/pypy/pypy3.9-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.9 --strip-components=1 && \ 43 | ln -s /usr/local/pypy/pypy3.9/bin/pypy /usr/local/bin/pypy3.9 && \ 44 | mkdir -p /usr/local/pypy/pypy3.10 && \ 45 | 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 && \ 46 | ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10 47 | 48 | 49 | RUN mkdir -p /opt/python 50 | 51 | RUN cd /tmp && \ 52 | VERS=3.7.17 && PREFIX=/opt/python/cp37-cp37m && \ 53 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 54 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 55 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-linux-musl --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \ 56 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 57 | make -j4 && make -j4 install && \ 58 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 59 | # we don't need libpython*.a, and they're many megabytes 60 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 61 | # We do not need the Python test suites 62 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 63 | # We do not need precompiled .pyc and .pyo files. 64 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 65 | 66 | RUN cd /tmp && \ 67 | VERS=3.8.20 && PREFIX=/opt/python/cp38-cp38 && \ 68 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 69 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 70 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-linux-musl --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \ 71 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 72 | make -j4 && make -j4 install && \ 73 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 74 | # we don't need libpython*.a, and they're many megabytes 75 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 76 | # We do not need the Python test suites 77 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 78 | # We do not need precompiled .pyc and .pyo files. 79 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 80 | 81 | RUN cd /tmp && \ 82 | VERS=3.9.22 && PREFIX=/opt/python/cp39-cp39 && \ 83 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 84 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 85 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-linux-musl --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \ 86 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 87 | make -j4 && make -j4 install && \ 88 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 89 | # we don't need libpython*.a, and they're many megabytes 90 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 91 | # We do not need the Python test suites 92 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 93 | # We do not need precompiled .pyc and .pyo files. 94 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 95 | 96 | RUN cd /tmp && \ 97 | VERS=3.10.17 && PREFIX=/opt/python/cp310-cp310 && \ 98 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 99 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 100 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-linux-musl --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \ 101 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 102 | make -j4 && make -j4 install && \ 103 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 104 | # we don't need libpython*.a, and they're many megabytes 105 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 106 | # We do not need the Python test suites 107 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 108 | # We do not need precompiled .pyc and .pyo files. 109 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 110 | 111 | RUN cd /tmp && \ 112 | VERS=3.11.12 && PREFIX=/opt/python/cp311-cp311 && \ 113 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 114 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 115 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --prefix=$PREFIX --disable-shared --with-build-python=python3.11 --with-ensurepip=no --build=$(uname -m)-linux-musl --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \ 116 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 117 | make -j4 && make -j4 install && \ 118 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 119 | # we don't need libpython*.a, and they're many megabytes 120 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 121 | # We do not need the Python test suites 122 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 123 | # We do not need precompiled .pyc and .pyo files. 124 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 125 | 126 | RUN cd /tmp && \ 127 | VERS=3.12.10 && PREFIX=/opt/python/cp312-cp312 && \ 128 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 129 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 130 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --prefix=$PREFIX --disable-shared --with-build-python=python3.12 --with-ensurepip=no --build=$(uname -m)-linux-musl --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \ 131 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 132 | make -j4 && make -j4 install && \ 133 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 134 | # we don't need libpython*.a, and they're many megabytes 135 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 136 | # We do not need the Python test suites 137 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 138 | # We do not need precompiled .pyc and .pyo files. 139 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 140 | 141 | RUN cd /tmp && \ 142 | VERS=3.13.3 && PREFIX=/opt/python/cp313-cp313 && \ 143 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 144 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 145 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --prefix=$PREFIX --disable-shared --with-build-python=python3.13 --with-ensurepip=no --build=$(uname -m)-linux-musl --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \ 146 | sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \ 147 | make -j4 && make -j4 install && \ 148 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 149 | # we don't need libpython*.a, and they're many megabytes 150 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 151 | # We do not need the Python test suites 152 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 153 | # We do not need precompiled .pyc and .pyo files. 154 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 155 | RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \ 156 | case $VER in \ 157 | 3.7|3.8) \ 158 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \ 159 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \ 160 | ;; \ 161 | 3.9|3.10) \ 162 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 163 | curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \ 164 | ;; \ 165 | 3.11|3.12|3.13) \ 166 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 167 | ;; \ 168 | esac && \ 169 | "python$VER" -m pip install --no-cache-dir cffi; \ 170 | done && \ 171 | python3 -m pip --version && \ 172 | python3 -m pip install --no-cache-dir auditwheel patchelf build && \ 173 | python3 -m pip install --no-cache-dir auditwheel-symbols 174 | -------------------------------------------------------------------------------- /musllinux_1_2/i686/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/pypa/musllinux_1_1_i686 as musllinux 2 | 3 | FROM messense/rust-musl-cross:i686-musl 4 | 5 | ENV TARGET_READELF=-readelf 6 | 7 | RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ 8 | apt-get update && \ 9 | apt-get install --no-install-recommends -y \ 10 | curl \ 11 | git \ 12 | g++ \ 13 | make \ 14 | sudo \ 15 | wget \ 16 | software-properties-common \ 17 | gpg-agent \ 18 | cmake \ 19 | llvm-dev \ 20 | libclang-dev \ 21 | clang 22 | 23 | RUN add-apt-repository -y ppa:deadsnakes/ppa && \ 24 | apt-get update && \ 25 | apt-get install -y \ 26 | python3.7 python3.7-venv python3.7-dev \ 27 | python3.8 python3.8-venv python3.8-dev \ 28 | python3.9 python3.9-venv python3.9-dev \ 29 | python3.11 python3.11-venv python3.11-dev \ 30 | python3.12 python3.12-venv python3.12-dev \ 31 | python3.13 python3.13-venv python3.13-dev \ 32 | python3 python3-venv python3-dev python-is-python3 33 | 34 | RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else export PYPY_ARCH="aarch64"; fi && \ 35 | mkdir -p /usr/local/pypy/pypy3.7 && \ 36 | curl -sqL https://downloads.python.org/pypy/pypy3.7-v7.3.9-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.7 --strip-components=1 && \ 37 | ln -s /usr/local/pypy/pypy3.7/bin/pypy /usr/local/bin/pypy3.7 && \ 38 | mkdir -p /usr/local/pypy/pypy3.8 && \ 39 | curl -sqL https://downloads.python.org/pypy/pypy3.8-v7.3.11-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.8 --strip-components=1 && \ 40 | ln -s /usr/local/pypy/pypy3.8/bin/pypy /usr/local/bin/pypy3.8 && \ 41 | mkdir -p /usr/local/pypy/pypy3.9 && \ 42 | curl -sqL https://downloads.python.org/pypy/pypy3.9-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.9 --strip-components=1 && \ 43 | ln -s /usr/local/pypy/pypy3.9/bin/pypy /usr/local/bin/pypy3.9 && \ 44 | mkdir -p /usr/local/pypy/pypy3.10 && \ 45 | 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 && \ 46 | ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10 47 | 48 | COPY --from=musllinux /opt/_internal /opt/_internal 49 | COPY --from=musllinux /opt/python /opt/python 50 | 51 | RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \ 52 | case $VER in \ 53 | 3.7|3.8) \ 54 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \ 55 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \ 56 | ;; \ 57 | 3.9|3.10) \ 58 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 59 | curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \ 60 | ;; \ 61 | 3.11|3.12|3.13) \ 62 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 63 | ;; \ 64 | esac && \ 65 | "python$VER" -m pip install --no-cache-dir cffi; \ 66 | done && \ 67 | python3 -m pip --version && \ 68 | python3 -m pip install --no-cache-dir auditwheel patchelf build && \ 69 | python3 -m pip install --no-cache-dir auditwheel-symbols 70 | -------------------------------------------------------------------------------- /musllinux_1_2/loongarch64/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM ubuntu:22.04 AS toolchain 3 | 4 | ENV DEBIAN_FRONTEND noninteractive 5 | 6 | RUN apt-get update && \ 7 | apt-get install --no-install-recommends -y \ 8 | automake \ 9 | bison \ 10 | bzip2 \ 11 | ca-certificates \ 12 | cmake \ 13 | curl \ 14 | file \ 15 | flex \ 16 | g++ \ 17 | gawk \ 18 | gdb \ 19 | git \ 20 | gperf \ 21 | help2man \ 22 | libncurses-dev \ 23 | libssl-dev \ 24 | libtool-bin \ 25 | lzip \ 26 | make \ 27 | ninja-build \ 28 | patch \ 29 | pkg-config \ 30 | python3 \ 31 | rsync \ 32 | sudo \ 33 | texinfo \ 34 | unzip \ 35 | wget \ 36 | xz-utils \ 37 | libssl-dev \ 38 | libffi-dev 39 | 40 | # Install crosstool-ng 41 | RUN curl -Lf https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.27.0.tar.gz | tar xzf - && \ 42 | cd crosstool-ng-crosstool-ng-1.27.0 && \ 43 | ./bootstrap && \ 44 | ./configure --prefix=/usr/local && \ 45 | make -j4 && \ 46 | make install && \ 47 | cd .. && rm -rf crosstool-ng-* 48 | 49 | COPY .config /tmp/toolchain.config 50 | 51 | # Build cross compiler 52 | RUN mkdir build && \ 53 | cd build && \ 54 | cp /tmp/toolchain.config .config && \ 55 | export CT_ALLOW_BUILD_AS_ROOT_SURE=1 && \ 56 | ct-ng build.2 || { tail -n 500 build.log; exit $ERRCODE; } && \ 57 | cd .. && \ 58 | rm -rf build 59 | 60 | FROM ubuntu:22.04 61 | 62 | # Copy cross toolchain 63 | COPY --from=toolchain /usr/loongarch64-unknown-linux-musl /usr/loongarch64-unknown-linux-musl 64 | 65 | ENV DEBIAN_FRONTEND noninteractive 66 | ENV PATH=$PATH:/usr/loongarch64-unknown-linux-musl/bin 67 | 68 | ENV CC_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-gcc \ 69 | AR_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-ar \ 70 | CXX_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-g++ 71 | 72 | ENV TARGET_CC=loongarch64-unknown-linux-musl-gcc \ 73 | TARGET_AR=loongarch64-unknown-linux-musl-ar \ 74 | TARGET_RANLIB=loongarch64-unknown-linux-musl-ranlib \ 75 | TARGET_CXX=loongarch64-unknown-linux-musl-g++ \ 76 | TARGET_READELF=loongarch64-unknown-linux-musl-readelf \ 77 | TARGET_SYSROOT=/usr/loongarch64-unknown-linux-musl/loongarch64-unknown-linux-musl/sysroot/ \ 78 | TARGET_C_INCLUDE_PATH=/usr/loongarch64-unknown-linux-musl/loongarch64-unknown-linux-musl/sysroot/usr/include/ 79 | 80 | ENV CARGO_BUILD_TARGET=loongarch64-unknown-linux-musl 81 | ENV CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_LINKER=loongarch64-unknown-linux-musl-gcc 82 | RUN echo "set(CMAKE_SYSTEM_NAME Linux)\nset(CMAKE_SYSTEM_PROCESSOR loongarch64)\nset(CMAKE_SYSROOT /usr/loongarch64-unknown-linux-musl/loongarch64-unknown-linux-musl/sysroot/)\nset(CMAKE_C_COMPILER loongarch64-unknown-linux-musl-gcc)\nset(CMAKE_CXX_COMPILER loongarch64-unknown-linux-musl-g++)" > /usr/loongarch64-unknown-linux-musl/cmake-toolchain.cmake 83 | ENV TARGET_CMAKE_TOOLCHAIN_FILE_PATH=/usr/loongarch64-unknown-linux-musl/cmake-toolchain.cmake 84 | 85 | 86 | RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ 87 | apt-get update && \ 88 | apt-get install --no-install-recommends -y \ 89 | curl \ 90 | git \ 91 | g++ \ 92 | make \ 93 | sudo \ 94 | wget \ 95 | software-properties-common \ 96 | gpg-agent \ 97 | cmake \ 98 | llvm-dev \ 99 | libclang-dev \ 100 | clang 101 | 102 | ENV LOONGARCH64_UNKNOWN_LINUX_MUSL_OPENSSL_DIR=/usr/loongarch64-unknown-linux-musl/ 103 | RUN add-apt-repository -y ppa:deadsnakes/ppa && \ 104 | apt-get update && \ 105 | apt-get install -y \ 106 | python3.7 python3.7-venv python3.7-dev \ 107 | python3.8 python3.8-venv python3.8-dev \ 108 | python3.9 python3.9-venv python3.9-dev \ 109 | python3.11 python3.11-venv python3.11-dev \ 110 | python3.12 python3.12-venv python3.12-dev \ 111 | python3.13 python3.13-venv python3.13-dev \ 112 | python3 python3-venv python3-dev python-is-python3 113 | 114 | RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else export PYPY_ARCH="aarch64"; fi && \ 115 | mkdir -p /usr/local/pypy/pypy3.7 && \ 116 | curl -sqL https://downloads.python.org/pypy/pypy3.7-v7.3.9-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.7 --strip-components=1 && \ 117 | ln -s /usr/local/pypy/pypy3.7/bin/pypy /usr/local/bin/pypy3.7 && \ 118 | mkdir -p /usr/local/pypy/pypy3.8 && \ 119 | curl -sqL https://downloads.python.org/pypy/pypy3.8-v7.3.11-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.8 --strip-components=1 && \ 120 | ln -s /usr/local/pypy/pypy3.8/bin/pypy /usr/local/bin/pypy3.8 && \ 121 | mkdir -p /usr/local/pypy/pypy3.9 && \ 122 | curl -sqL https://downloads.python.org/pypy/pypy3.9-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.9 --strip-components=1 && \ 123 | ln -s /usr/local/pypy/pypy3.9/bin/pypy /usr/local/bin/pypy3.9 && \ 124 | mkdir -p /usr/local/pypy/pypy3.10 && \ 125 | 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 && \ 126 | ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10 127 | 128 | 129 | RUN mkdir -p /opt/python 130 | 131 | RUN cd /tmp && \ 132 | VERS=3.7.17 && PREFIX=/opt/python/cp37-cp37m && \ 133 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 134 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 135 | curl -LO 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub' && \ 136 | curl -LO 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess' && \ 137 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=loongarch64-unknown-linux-musl --target=loongarch64-unknown-linux-musl --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-linux-musl --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \ 138 | make -j4 && make -j4 install && \ 139 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 140 | # we don't need libpython*.a, and they're many megabytes 141 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 142 | # We do not need the Python test suites 143 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 144 | # We do not need precompiled .pyc and .pyo files. 145 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 146 | 147 | RUN cd /tmp && \ 148 | VERS=3.8.20 && PREFIX=/opt/python/cp38-cp38 && \ 149 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 150 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 151 | curl -LO 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub' && \ 152 | curl -LO 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess' && \ 153 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=loongarch64-unknown-linux-musl --target=loongarch64-unknown-linux-musl --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-linux-musl --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \ 154 | make -j4 && make -j4 install && \ 155 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 156 | # we don't need libpython*.a, and they're many megabytes 157 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 158 | # We do not need the Python test suites 159 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 160 | # We do not need precompiled .pyc and .pyo files. 161 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 162 | 163 | RUN cd /tmp && \ 164 | VERS=3.9.22 && PREFIX=/opt/python/cp39-cp39 && \ 165 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 166 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 167 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=loongarch64-unknown-linux-musl --target=loongarch64-unknown-linux-musl --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-linux-musl --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \ 168 | make -j4 && make -j4 install && \ 169 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 170 | # we don't need libpython*.a, and they're many megabytes 171 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 172 | # We do not need the Python test suites 173 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 174 | # We do not need precompiled .pyc and .pyo files. 175 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 176 | 177 | RUN cd /tmp && \ 178 | VERS=3.10.17 && PREFIX=/opt/python/cp310-cp310 && \ 179 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 180 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 181 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=loongarch64-unknown-linux-musl --target=loongarch64-unknown-linux-musl --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-linux-musl --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \ 182 | make -j4 && make -j4 install && \ 183 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 184 | # we don't need libpython*.a, and they're many megabytes 185 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 186 | # We do not need the Python test suites 187 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 188 | # We do not need precompiled .pyc and .pyo files. 189 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 190 | 191 | RUN cd /tmp && \ 192 | VERS=3.11.12 && PREFIX=/opt/python/cp311-cp311 && \ 193 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 194 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 195 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=loongarch64-unknown-linux-musl --target=loongarch64-unknown-linux-musl --prefix=$PREFIX --disable-shared --with-build-python=python3.11 --with-ensurepip=no --build=$(uname -m)-linux-musl --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \ 196 | make -j4 && make -j4 install && \ 197 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 198 | # we don't need libpython*.a, and they're many megabytes 199 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 200 | # We do not need the Python test suites 201 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 202 | # We do not need precompiled .pyc and .pyo files. 203 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 204 | 205 | RUN cd /tmp && \ 206 | VERS=3.12.10 && PREFIX=/opt/python/cp312-cp312 && \ 207 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 208 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 209 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=loongarch64-unknown-linux-musl --target=loongarch64-unknown-linux-musl --prefix=$PREFIX --disable-shared --with-build-python=python3.12 --with-ensurepip=no --build=$(uname -m)-linux-musl --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \ 210 | make -j4 && make -j4 install && \ 211 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 212 | # we don't need libpython*.a, and they're many megabytes 213 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 214 | # We do not need the Python test suites 215 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 216 | # We do not need precompiled .pyc and .pyo files. 217 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 218 | 219 | RUN cd /tmp && \ 220 | VERS=3.13.3 && PREFIX=/opt/python/cp313-cp313 && \ 221 | curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \ 222 | tar xzf Python-$VERS.tgz && cd Python-$VERS && \ 223 | ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host=loongarch64-unknown-linux-musl --target=loongarch64-unknown-linux-musl --prefix=$PREFIX --disable-shared --with-build-python=python3.13 --with-ensurepip=no --build=$(uname -m)-linux-musl --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no ac_cv_libatomic_needed=yes && \ 224 | make -j4 && make -j4 install && \ 225 | cd /tmp && rm -rf Python-$VERS.tgz Python-$VERS $PREFIX/share && \ 226 | # we don't need libpython*.a, and they're many megabytes 227 | find $PREFIX -name '*.a' -print0 | xargs -0 rm -f && \ 228 | # We do not need the Python test suites 229 | find $PREFIX -depth \( -type d -a -name test -o -name tests \) | xargs rm -rf && \ 230 | # We do not need precompiled .pyc and .pyo files. 231 | find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete 232 | RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \ 233 | case $VER in \ 234 | 3.7|3.8) \ 235 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \ 236 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \ 237 | ;; \ 238 | 3.9|3.10) \ 239 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 240 | curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \ 241 | ;; \ 242 | 3.11|3.12|3.13) \ 243 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 244 | ;; \ 245 | esac && \ 246 | "python$VER" -m pip install --no-cache-dir cffi; \ 247 | done && \ 248 | python3 -m pip --version && \ 249 | python3 -m pip install --no-cache-dir auditwheel patchelf build && \ 250 | python3 -m pip install --no-cache-dir auditwheel-symbols 251 | -------------------------------------------------------------------------------- /musllinux_1_2/x86_64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/pypa/musllinux_1_1_x86_64 as musllinux 2 | 3 | FROM messense/rust-musl-cross:x86_64-musl 4 | 5 | ENV TARGET_READELF=-readelf 6 | 7 | RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ 8 | apt-get update && \ 9 | apt-get install --no-install-recommends -y \ 10 | curl \ 11 | git \ 12 | g++ \ 13 | make \ 14 | sudo \ 15 | wget \ 16 | software-properties-common \ 17 | gpg-agent \ 18 | cmake \ 19 | llvm-dev \ 20 | libclang-dev \ 21 | clang 22 | 23 | RUN add-apt-repository -y ppa:deadsnakes/ppa && \ 24 | apt-get update && \ 25 | apt-get install -y \ 26 | python3.7 python3.7-venv python3.7-dev \ 27 | python3.8 python3.8-venv python3.8-dev \ 28 | python3.9 python3.9-venv python3.9-dev \ 29 | python3.11 python3.11-venv python3.11-dev \ 30 | python3.12 python3.12-venv python3.12-dev \ 31 | python3.13 python3.13-venv python3.13-dev \ 32 | python3 python3-venv python3-dev python-is-python3 33 | 34 | RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else export PYPY_ARCH="aarch64"; fi && \ 35 | mkdir -p /usr/local/pypy/pypy3.7 && \ 36 | curl -sqL https://downloads.python.org/pypy/pypy3.7-v7.3.9-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.7 --strip-components=1 && \ 37 | ln -s /usr/local/pypy/pypy3.7/bin/pypy /usr/local/bin/pypy3.7 && \ 38 | mkdir -p /usr/local/pypy/pypy3.8 && \ 39 | curl -sqL https://downloads.python.org/pypy/pypy3.8-v7.3.11-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.8 --strip-components=1 && \ 40 | ln -s /usr/local/pypy/pypy3.8/bin/pypy /usr/local/bin/pypy3.8 && \ 41 | mkdir -p /usr/local/pypy/pypy3.9 && \ 42 | curl -sqL https://downloads.python.org/pypy/pypy3.9-v7.3.12-$PYPY_ARCH.tar.bz2 | tar xjf - -C /usr/local/pypy/pypy3.9 --strip-components=1 && \ 43 | ln -s /usr/local/pypy/pypy3.9/bin/pypy /usr/local/bin/pypy3.9 && \ 44 | mkdir -p /usr/local/pypy/pypy3.10 && \ 45 | 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 && \ 46 | ln -s /usr/local/pypy/pypy3.10/bin/pypy /usr/local/bin/pypy3.10 47 | 48 | COPY --from=musllinux /opt/_internal /opt/_internal 49 | COPY --from=musllinux /opt/python /opt/python 50 | 51 | RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \ 52 | case $VER in \ 53 | 3.7|3.8) \ 54 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \ 55 | curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \ 56 | ;; \ 57 | 3.9|3.10) \ 58 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 59 | curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \ 60 | ;; \ 61 | 3.11|3.12|3.13) \ 62 | curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \ 63 | ;; \ 64 | esac && \ 65 | "python$VER" -m pip install --no-cache-dir cffi; \ 66 | done && \ 67 | python3 -m pip --version && \ 68 | python3 -m pip install --no-cache-dir auditwheel patchelf build && \ 69 | python3 -m pip install --no-cache-dir auditwheel-symbols 70 | -------------------------------------------------------------------------------- /pyo3-test/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "autocfg" 7 | version = "1.1.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 10 | 11 | [[package]] 12 | name = "bitflags" 13 | version = "1.3.2" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 16 | 17 | [[package]] 18 | name = "cc" 19 | version = "1.0.73" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" 22 | 23 | [[package]] 24 | name = "cfg-if" 25 | version = "1.0.0" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 28 | 29 | [[package]] 30 | name = "cmake" 31 | version = "0.1.48" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" 34 | dependencies = [ 35 | "cc", 36 | ] 37 | 38 | [[package]] 39 | name = "indoc" 40 | version = "1.0.7" 41 | source = "registry+https://github.com/rust-lang/crates.io-index" 42 | checksum = "adab1eaa3408fb7f0c777a73e7465fd5656136fc93b670eb6df3c88c2c1344e3" 43 | 44 | [[package]] 45 | name = "libc" 46 | version = "0.2.132" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" 49 | 50 | [[package]] 51 | name = "libz-sys" 52 | version = "1.1.8" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" 55 | dependencies = [ 56 | "cc", 57 | "cmake", 58 | "libc", 59 | "pkg-config", 60 | "vcpkg", 61 | ] 62 | 63 | [[package]] 64 | name = "lock_api" 65 | version = "0.4.8" 66 | source = "registry+https://github.com/rust-lang/crates.io-index" 67 | checksum = "9f80bf5aacaf25cbfc8210d1cfb718f2bf3b11c4c54e5afe36c236853a8ec390" 68 | dependencies = [ 69 | "autocfg", 70 | "scopeguard", 71 | ] 72 | 73 | [[package]] 74 | name = "memoffset" 75 | version = "0.6.5" 76 | source = "registry+https://github.com/rust-lang/crates.io-index" 77 | checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" 78 | dependencies = [ 79 | "autocfg", 80 | ] 81 | 82 | [[package]] 83 | name = "once_cell" 84 | version = "1.14.0" 85 | source = "registry+https://github.com/rust-lang/crates.io-index" 86 | checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" 87 | 88 | [[package]] 89 | name = "parking_lot" 90 | version = "0.12.1" 91 | source = "registry+https://github.com/rust-lang/crates.io-index" 92 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 93 | dependencies = [ 94 | "lock_api", 95 | "parking_lot_core", 96 | ] 97 | 98 | [[package]] 99 | name = "parking_lot_core" 100 | version = "0.9.3" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" 103 | dependencies = [ 104 | "cfg-if", 105 | "libc", 106 | "redox_syscall", 107 | "smallvec", 108 | "windows-sys", 109 | ] 110 | 111 | [[package]] 112 | name = "pkg-config" 113 | version = "0.3.25" 114 | source = "registry+https://github.com/rust-lang/crates.io-index" 115 | checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" 116 | 117 | [[package]] 118 | name = "proc-macro2" 119 | version = "1.0.43" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" 122 | dependencies = [ 123 | "unicode-ident", 124 | ] 125 | 126 | [[package]] 127 | name = "pyo3" 128 | version = "0.17.1" 129 | source = "registry+https://github.com/rust-lang/crates.io-index" 130 | checksum = "12f72538a0230791398a0986a6518ebd88abc3fded89007b506ed072acc831e1" 131 | dependencies = [ 132 | "cfg-if", 133 | "indoc", 134 | "libc", 135 | "memoffset", 136 | "parking_lot", 137 | "pyo3-build-config", 138 | "pyo3-ffi", 139 | "pyo3-macros", 140 | "unindent", 141 | ] 142 | 143 | [[package]] 144 | name = "pyo3-build-config" 145 | version = "0.17.1" 146 | source = "registry+https://github.com/rust-lang/crates.io-index" 147 | checksum = "fc4cf18c20f4f09995f3554e6bcf9b09bd5e4d6b67c562fdfaafa644526ba479" 148 | dependencies = [ 149 | "once_cell", 150 | "target-lexicon", 151 | ] 152 | 153 | [[package]] 154 | name = "pyo3-ffi" 155 | version = "0.17.1" 156 | source = "registry+https://github.com/rust-lang/crates.io-index" 157 | checksum = "a41877f28d8ebd600b6aa21a17b40c3b0fc4dfe73a27b6e81ab3d895e401b0e9" 158 | dependencies = [ 159 | "libc", 160 | "pyo3-build-config", 161 | ] 162 | 163 | [[package]] 164 | name = "pyo3-macros" 165 | version = "0.17.1" 166 | source = "registry+https://github.com/rust-lang/crates.io-index" 167 | checksum = "2e81c8d4bcc2f216dc1b665412df35e46d12ee8d3d046b381aad05f1fcf30547" 168 | dependencies = [ 169 | "proc-macro2", 170 | "pyo3-macros-backend", 171 | "quote", 172 | "syn", 173 | ] 174 | 175 | [[package]] 176 | name = "pyo3-macros-backend" 177 | version = "0.17.1" 178 | source = "registry+https://github.com/rust-lang/crates.io-index" 179 | checksum = "85752a767ee19399a78272cc2ab625cd7d373b2e112b4b13db28de71fa892784" 180 | dependencies = [ 181 | "proc-macro2", 182 | "quote", 183 | "syn", 184 | ] 185 | 186 | [[package]] 187 | name = "pyo3-test" 188 | version = "0.1.0" 189 | dependencies = [ 190 | "libz-sys", 191 | "pyo3", 192 | ] 193 | 194 | [[package]] 195 | name = "quote" 196 | version = "1.0.21" 197 | source = "registry+https://github.com/rust-lang/crates.io-index" 198 | checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" 199 | dependencies = [ 200 | "proc-macro2", 201 | ] 202 | 203 | [[package]] 204 | name = "redox_syscall" 205 | version = "0.2.16" 206 | source = "registry+https://github.com/rust-lang/crates.io-index" 207 | checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 208 | dependencies = [ 209 | "bitflags", 210 | ] 211 | 212 | [[package]] 213 | name = "scopeguard" 214 | version = "1.1.0" 215 | source = "registry+https://github.com/rust-lang/crates.io-index" 216 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 217 | 218 | [[package]] 219 | name = "smallvec" 220 | version = "1.9.0" 221 | source = "registry+https://github.com/rust-lang/crates.io-index" 222 | checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" 223 | 224 | [[package]] 225 | name = "syn" 226 | version = "1.0.99" 227 | source = "registry+https://github.com/rust-lang/crates.io-index" 228 | checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" 229 | dependencies = [ 230 | "proc-macro2", 231 | "quote", 232 | "unicode-ident", 233 | ] 234 | 235 | [[package]] 236 | name = "target-lexicon" 237 | version = "0.12.4" 238 | source = "registry+https://github.com/rust-lang/crates.io-index" 239 | checksum = "c02424087780c9b71cc96799eaeddff35af2bc513278cda5c99fc1f5d026d3c1" 240 | 241 | [[package]] 242 | name = "unicode-ident" 243 | version = "1.0.3" 244 | source = "registry+https://github.com/rust-lang/crates.io-index" 245 | checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" 246 | 247 | [[package]] 248 | name = "unindent" 249 | version = "0.1.10" 250 | source = "registry+https://github.com/rust-lang/crates.io-index" 251 | checksum = "58ee9362deb4a96cef4d437d1ad49cffc9b9e92d202b6995674e928ce684f112" 252 | 253 | [[package]] 254 | name = "vcpkg" 255 | version = "0.2.15" 256 | source = "registry+https://github.com/rust-lang/crates.io-index" 257 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 258 | 259 | [[package]] 260 | name = "windows-sys" 261 | version = "0.36.1" 262 | source = "registry+https://github.com/rust-lang/crates.io-index" 263 | checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" 264 | dependencies = [ 265 | "windows_aarch64_msvc", 266 | "windows_i686_gnu", 267 | "windows_i686_msvc", 268 | "windows_x86_64_gnu", 269 | "windows_x86_64_msvc", 270 | ] 271 | 272 | [[package]] 273 | name = "windows_aarch64_msvc" 274 | version = "0.36.1" 275 | source = "registry+https://github.com/rust-lang/crates.io-index" 276 | checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" 277 | 278 | [[package]] 279 | name = "windows_i686_gnu" 280 | version = "0.36.1" 281 | source = "registry+https://github.com/rust-lang/crates.io-index" 282 | checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" 283 | 284 | [[package]] 285 | name = "windows_i686_msvc" 286 | version = "0.36.1" 287 | source = "registry+https://github.com/rust-lang/crates.io-index" 288 | checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" 289 | 290 | [[package]] 291 | name = "windows_x86_64_gnu" 292 | version = "0.36.1" 293 | source = "registry+https://github.com/rust-lang/crates.io-index" 294 | checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" 295 | 296 | [[package]] 297 | name = "windows_x86_64_msvc" 298 | version = "0.36.1" 299 | source = "registry+https://github.com/rust-lang/crates.io-index" 300 | checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" 301 | -------------------------------------------------------------------------------- /pyo3-test/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pyo3-test" 3 | version = "0.1.0" 4 | authors = ["messense "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | pyo3 = { version = "0.17.1", features = ["extension-module"] } 11 | libz-sys = { version = "1.1.8", default-features = false, features = ["zlib-ng"], optional = true } 12 | 13 | [lib] 14 | name = "pyo3_test" 15 | crate-type = ["cdylib"] 16 | 17 | [features] 18 | default = [] 19 | test-cmake = ["libz-sys"] 20 | -------------------------------------------------------------------------------- /pyo3-test/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = [ 3 | "setuptools>=40.6.0", 4 | "wheel", 5 | "setuptools-rust" 6 | ] 7 | build-backend = "setuptools.build_meta" 8 | -------------------------------------------------------------------------------- /pyo3-test/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | from setuptools_rust import Binding, RustExtension 3 | 4 | setup( 5 | name="pyo3-test", 6 | version="0.1.0", 7 | rust_extensions=[RustExtension("pyo3_test", binding=Binding.PyO3)], 8 | zip_safe=False, 9 | ) 10 | -------------------------------------------------------------------------------- /pyo3-test/src/lib.rs: -------------------------------------------------------------------------------- 1 | #[cfg(feature = "test-cmake")] 2 | use {libz_sys::zlibVersion, std::ffi::CStr}; 3 | 4 | use pyo3::prelude::*; 5 | 6 | #[pyclass] 7 | struct DummyClass {} 8 | 9 | #[pymethods] 10 | impl DummyClass { 11 | #[staticmethod] 12 | fn get_42() -> PyResult { 13 | Ok(42) 14 | } 15 | } 16 | 17 | #[pymodule] 18 | fn pyo3_test(_py: Python, m: &PyModule) -> PyResult<()> { 19 | #[cfg(feature = "test-cmake")] 20 | { 21 | let ver = unsafe { zlibVersion() }; 22 | let ver_cstr = unsafe { CStr::from_ptr(ver) }; 23 | let version = ver_cstr.to_str().unwrap(); 24 | assert!(!version.is_empty()); 25 | } 26 | 27 | m.add_class::()?; 28 | m.add("fourtytwo", 42)?; 29 | 30 | Ok(()) 31 | } 32 | -------------------------------------------------------------------------------- /render.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | 4 | from jinja2 import Environment, DictLoader, select_autoescape 5 | 6 | 7 | MANYLINUX2014_CT_NG_VERSION = "02d1503f6769be4ad8058b393d4245febced459f" 8 | MANYLINUX2014_TOOLCHAIN_OS = "ubuntu:20.04" 9 | MANYLINUX_2_28_CT_NG_VERSION = "crosstool-ng-1.25.0" 10 | 11 | TOOLCHAIN_OS = "ubuntu:22.04" 12 | 13 | IMAGES = { 14 | "manylinux2014": [ 15 | { 16 | "arch": "aarch64", 17 | "manylinux": "quay.io/pypa/manylinux2014_aarch64", 18 | "ct_ng_version": MANYLINUX2014_CT_NG_VERSION, 19 | "toolchain_os": MANYLINUX2014_TOOLCHAIN_OS, 20 | "target": "aarch64-unknown-linux-gnu", 21 | }, 22 | { 23 | "arch": "armv7l", 24 | "cmake_arch": "armv7", 25 | "ct_ng_version": MANYLINUX2014_CT_NG_VERSION, 26 | "toolchain_os": MANYLINUX2014_TOOLCHAIN_OS, 27 | "target": "armv7-unknown-linux-gnueabihf", 28 | }, 29 | { 30 | "arch": "i686", 31 | "manylinux": "quay.io/pypa/manylinux2014_i686", 32 | "ct_ng_version": MANYLINUX2014_CT_NG_VERSION, 33 | "toolchain_os": MANYLINUX2014_TOOLCHAIN_OS, 34 | "target": "i686-unknown-linux-gnu", 35 | }, 36 | { 37 | "arch": "ppc64", 38 | "ct_ng_version": MANYLINUX2014_CT_NG_VERSION, 39 | "toolchain_os": MANYLINUX2014_TOOLCHAIN_OS, 40 | "target": "powerpc64-unknown-linux-gnu", 41 | }, 42 | { 43 | "arch": "ppc64le", 44 | "manylinux": "quay.io/pypa/manylinux2014_ppc64le", 45 | "ct_ng_version": MANYLINUX2014_CT_NG_VERSION, 46 | "toolchain_os": MANYLINUX2014_TOOLCHAIN_OS, 47 | "target": "powerpc64le-unknown-linux-gnu", 48 | }, 49 | { 50 | "arch": "s390x", 51 | "manylinux": "quay.io/pypa/manylinux2014_s390x", 52 | "ct_ng_version": MANYLINUX2014_CT_NG_VERSION, 53 | "toolchain_os": MANYLINUX2014_TOOLCHAIN_OS, 54 | "target": "s390x-ibm-linux-gnu", 55 | }, 56 | { 57 | "arch": "x86_64", 58 | "manylinux": "quay.io/pypa/manylinux2014_x86_64", 59 | "ct_ng_version": MANYLINUX2014_CT_NG_VERSION, 60 | "toolchain_os": MANYLINUX2014_TOOLCHAIN_OS, 61 | "target": "x86_64-unknown-linux-gnu", 62 | }, 63 | ], 64 | "manylinux_2_28": [ 65 | { 66 | "arch": "aarch64", 67 | "manylinux": "quay.io/pypa/manylinux_2_28_aarch64", 68 | "ct_ng_version": MANYLINUX_2_28_CT_NG_VERSION, 69 | "toolchain_os": TOOLCHAIN_OS, 70 | "target": "aarch64-unknown-linux-gnu", 71 | }, 72 | { 73 | "arch": "ppc64le", 74 | "manylinux": "quay.io/pypa/manylinux_2_28_ppc64le", 75 | "ct_ng_version": MANYLINUX_2_28_CT_NG_VERSION, 76 | "toolchain_os": TOOLCHAIN_OS, 77 | "target": "powerpc64le-unknown-linux-gnu", 78 | }, 79 | { 80 | "arch": "x86_64", 81 | "manylinux": "quay.io/pypa/manylinux_2_28_x86_64", 82 | "ct_ng_version": MANYLINUX_2_28_CT_NG_VERSION, 83 | "toolchain_os": TOOLCHAIN_OS, 84 | "target": "x86_64-unknown-linux-gnu", 85 | }, 86 | { 87 | "arch": "armv7l", 88 | "ct_ng_version": MANYLINUX_2_28_CT_NG_VERSION, 89 | "toolchain_os": TOOLCHAIN_OS, 90 | "target": "armv7-unknown-linux-gnueabihf", 91 | }, 92 | { 93 | "arch": "s390x", 94 | "ct_ng_version": MANYLINUX_2_28_CT_NG_VERSION, 95 | "toolchain_os": TOOLCHAIN_OS, 96 | "target": "s390x-ibm-linux-gnu", 97 | }, 98 | ], 99 | "manylinux_2_31": [ 100 | { 101 | "arch": "riscv64", 102 | "ct_ng_version": "crosstool-ng-1.27.0", 103 | "toolchain_os": TOOLCHAIN_OS, 104 | "target": "riscv64-unknown-linux-gnu", 105 | }, 106 | ], 107 | "manylinux_2_36": [ 108 | { 109 | "arch": "loongarch64", 110 | "ct_ng_version": "crosstool-ng-1.27.0", 111 | "toolchain_os": TOOLCHAIN_OS, 112 | "target": "loongarch64-unknown-linux-gnu", 113 | }, 114 | ], 115 | "musllinux_1_2": [ 116 | { 117 | "arch": "aarch64", 118 | "musllinux": "quay.io/pypa/musllinux_1_1_aarch64", 119 | "base": "messense/rust-musl-cross:aarch64-musl", 120 | "target": "aarch64-unknown-linux-musl", 121 | }, 122 | { 123 | "arch": "armv7l", 124 | "base": "messense/rust-musl-cross:armv7-musleabihf", 125 | "target": "armv7-unknown-linux-musleabihf", 126 | }, 127 | { 128 | "arch": "i686", 129 | "musllinux": "quay.io/pypa/musllinux_1_1_i686", 130 | "base": "messense/rust-musl-cross:i686-musl", 131 | }, 132 | { 133 | "arch": "x86_64", 134 | "musllinux": "quay.io/pypa/musllinux_1_1_x86_64", 135 | "base": "messense/rust-musl-cross:x86_64-musl", 136 | }, 137 | { 138 | "arch": "loongarch64", 139 | "ct_ng_version": "crosstool-ng-1.27.0", 140 | "toolchain_os": TOOLCHAIN_OS, 141 | "target": "loongarch64-unknown-linux-musl", 142 | }, 143 | ], 144 | } 145 | 146 | with open("Dockerfile.j2") as f: 147 | env = Environment( 148 | loader=DictLoader( 149 | { 150 | "dockerfile": f.read(), 151 | } 152 | ), 153 | autoescape=select_autoescape(), 154 | ) 155 | 156 | 157 | def main(): 158 | template = env.get_template("dockerfile") 159 | for platform, images in IMAGES.items(): 160 | for image in images: 161 | arch = image["arch"] 162 | output = template.render(platform=platform, **image) 163 | folder = os.path.join(platform, arch) 164 | os.makedirs(folder, exist_ok=True) 165 | with open(os.path.join(folder, "Dockerfile"), "w", newline='\n') as f: 166 | f.write(output) 167 | 168 | 169 | if __name__ == "__main__": 170 | main() 171 | --------------------------------------------------------------------------------