Skip to content

Add loongarch64 musllinux_1_2 #109

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ jobs:
manylinux: musllinux_1_2
- arch: armv7l
manylinux: musllinux_1_2
- arch: loongarch64
manylinux: musllinux_1_2

build:
name: Build - ${{ matrix.os.arch }} - ${{ matrix.platform.manylinux }}_${{ matrix.platform.arch }}
Expand Down
65 changes: 46 additions & 19 deletions Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ RUN apt-get update && \
libncurses-dev \
libssl-dev \
libtool-bin \
lzip \
make \
ninja-build \
patch \
pkg-config \
python3 \
rsync \
sudo \
texinfo \
unzip \
Expand All @@ -50,6 +52,11 @@ RUN apt-get update && \
# Install crosstool-ng
RUN curl -Lf https://github.com/crosstool-ng/crosstool-ng/archive/{{ ct_ng_version }}.tar.gz | tar xzf - && \
cd crosstool-ng-{{ ct_ng_version }} && \
{% if target.startswith('riscv64-') -%}
# Backport https://github.com/crosstool-ng/crosstool-ng/pull/{2315,2316} to fix build
curl -Lf https://github.com/crosstool-ng/crosstool-ng/pull/2315.patch | patch -Np1 && \
curl -Lf https://github.com/crosstool-ng/crosstool-ng/pull/2316.patch | patch -Np1 && \
{% endif -%}
./bootstrap && \
./configure --prefix=/usr/local && \
make -j4 && \
Expand Down Expand Up @@ -87,8 +94,8 @@ ENV TARGET_CC={{ target }}-gcc \
TARGET_SYSROOT=/usr/{{ target }}/{{ target }}/sysroot/ \
TARGET_C_INCLUDE_PATH=/usr/{{ target }}/{{ target }}/sysroot/usr/include/

ENV CARGO_BUILD_TARGET={{ target | replace('ibm', 'unknown') }}
ENV CARGO_TARGET_{{ target | replace('ibm', 'unknown') | replace('-', '_') | upper }}_LINKER={{ target }}-gcc
ENV CARGO_BUILD_TARGET={{ target | replace('ibm', 'unknown') | replace('riscv64', 'riscv64gc') }}
ENV CARGO_TARGET_{{ target | replace('ibm', 'unknown') | replace('-', '_') | replace('riscv64', 'riscv64gc') | upper }}_LINKER={{ target }}-gcc
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
ENV TARGET_CMAKE_TOOLCHAIN_FILE_PATH=/usr/{{ target }}/cmake-toolchain.cmake
{% endif %}
Expand Down Expand Up @@ -150,7 +157,11 @@ RUN cd /tmp && \
VERS=3.7.17 && PREFIX=/opt/python/cp37-cp37m && \
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --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 && \
{% if target.startswith('loongarch64-') -%}
curl -LO 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub' && \
curl -LO 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess' && \
{% endif -%}
./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 && \
{% if target.startswith('armv7-') -%}
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
{% endif -%}
Expand All @@ -167,7 +178,11 @@ RUN cd /tmp && \
VERS=3.8.20 && PREFIX=/opt/python/cp38-cp38 && \
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --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 && \
{% if target.startswith('loongarch64-') -%}
curl -LO 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub' && \
curl -LO 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess' && \
{% endif -%}
./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 && \
{% if target.startswith('armv7-') -%}
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
{% endif -%}
Expand All @@ -181,10 +196,10 @@ RUN cd /tmp && \
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete

RUN cd /tmp && \
VERS=3.9.20 && PREFIX=/opt/python/cp39-cp39 && \
VERS=3.9.22 && PREFIX=/opt/python/cp39-cp39 && \
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --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 && \
./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 && \
{% if target.startswith('armv7-') -%}
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
{% endif -%}
Expand All @@ -198,10 +213,10 @@ RUN cd /tmp && \
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete

RUN cd /tmp && \
VERS=3.10.15 && PREFIX=/opt/python/cp310-cp310 && \
VERS=3.10.17 && PREFIX=/opt/python/cp310-cp310 && \
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --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 && \
./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 && \
{% if target.startswith('armv7-') -%}
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
{% endif -%}
Expand All @@ -215,10 +230,10 @@ RUN cd /tmp && \
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete

RUN cd /tmp && \
VERS=3.11.10 && PREFIX=/opt/python/cp311-cp311 && \
VERS=3.11.12 && PREFIX=/opt/python/cp311-cp311 && \
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --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 && \
./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 && \
{% if target.startswith('armv7-') -%}
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
{% endif -%}
Expand All @@ -232,10 +247,10 @@ RUN cd /tmp && \
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete

RUN cd /tmp && \
VERS=3.12.7 && PREFIX=/opt/python/cp312-cp312 && \
VERS=3.12.10 && PREFIX=/opt/python/cp312-cp312 && \
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --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 && \
./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 && \
{% if target.startswith('armv7-') -%}
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
{% endif -%}
Expand All @@ -249,10 +264,10 @@ RUN cd /tmp && \
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete

RUN cd /tmp && \
VERS=3.13.0 && PREFIX=/opt/python/cp313-cp313 && \
VERS=3.13.3 && PREFIX=/opt/python/cp313-cp313 && \
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --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 && \
./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 }} && \
{% if target.startswith('armv7-') -%}
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
{% endif -%}
Expand All @@ -265,11 +280,23 @@ RUN cd /tmp && \
# We do not need precompiled .pyc and .pyo files.
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete
{%- endif %}
RUN curl -sS https://bootstrap.pypa.io/pip/3.7/get-pip.py | "python3.7" && \
for VER in 3.13 3.12 3.11 3.8 3.9 3.10; do curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; done && \
curl -sS https://bootstrap.pypa.io/pip/3.7/get-pip.py | "pypy3.7" && \
for VER in 3.8 3.9 3.10; do curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; done && \
for VER in 3.13 3.12 3.11 3.7 3.8 3.9 3.10; do "python$VER" -m pip install --no-cache-dir cffi; done && \
RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \
case $VER in \
3.7|3.8) \
curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \
curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \
;; \
3.9|3.10) \
curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \
curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \
;; \
3.11|3.12|3.13) \
curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \
;; \
esac && \
"python$VER" -m pip install --no-cache-dir cffi; \
done && \
python3 -m pip --version && \
python3 -m pip install --no-cache-dir auditwheel patchelf build && \
python3 -m pip install --no-cache-dir auditwheel-symbols

25 changes: 19 additions & 6 deletions manylinux2014/aarch64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ RUN apt-get update && \
libncurses-dev \
libssl-dev \
libtool-bin \
lzip \
make \
ninja-build \
patch \
pkg-config \
python3 \
rsync \
sudo \
texinfo \
unzip \
Expand Down Expand Up @@ -127,11 +129,22 @@ RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else expor
COPY --from=manylinux /opt/_internal /opt/_internal
COPY --from=manylinux /opt/python /opt/python

RUN curl -sS https://bootstrap.pypa.io/pip/3.7/get-pip.py | "python3.7" && \
for VER in 3.13 3.12 3.11 3.8 3.9 3.10; do curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; done && \
curl -sS https://bootstrap.pypa.io/pip/3.7/get-pip.py | "pypy3.7" && \
for VER in 3.8 3.9 3.10; do curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; done && \
for VER in 3.13 3.12 3.11 3.7 3.8 3.9 3.10; do "python$VER" -m pip install --no-cache-dir cffi; done && \
RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \
case $VER in \
3.7|3.8) \
curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \
curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \
;; \
3.9|3.10) \
curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \
curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \
;; \
3.11|3.12|3.13) \
curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \
;; \
esac && \
"python$VER" -m pip install --no-cache-dir cffi; \
done && \
python3 -m pip --version && \
python3 -m pip install --no-cache-dir auditwheel patchelf build && \
python3 -m pip install --no-cache-dir auditwheel-symbols
python3 -m pip install --no-cache-dir auditwheel-symbols
Loading