Skip to content

Commit d1d6262

Browse files
Add loongarch64 musllinux_1_2 (#109)
* Add loongarch64 musllinux_1_2 Signed-off-by: 吴小白 <296015668@qq.com> * Update python versions Signed-off-by: 吴小白 <296015668@qq.com> * Update render.py Signed-off-by: 吴小白 <296015668@qq.com> --------- Signed-off-by: 吴小白 <296015668@qq.com>
1 parent 0a1b6f7 commit d1d6262

File tree

23 files changed

+1604
-176
lines changed

23 files changed

+1604
-176
lines changed

.github/workflows/Build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ jobs:
177177
manylinux: musllinux_1_2
178178
- arch: armv7l
179179
manylinux: musllinux_1_2
180+
- arch: loongarch64
181+
manylinux: musllinux_1_2
180182
181183
build:
182184
name: Build - ${{ matrix.os.arch }} - ${{ matrix.platform.manylinux }}_${{ matrix.platform.arch }}

Dockerfile.j2

Lines changed: 46 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ RUN apt-get update && \
3434
libncurses-dev \
3535
libssl-dev \
3636
libtool-bin \
37+
lzip \
3738
make \
3839
ninja-build \
3940
patch \
4041
pkg-config \
4142
python3 \
43+
rsync \
4244
sudo \
4345
texinfo \
4446
unzip \
@@ -50,6 +52,11 @@ RUN apt-get update && \
5052
# Install crosstool-ng
5153
RUN curl -Lf https://github.com/crosstool-ng/crosstool-ng/archive/{{ ct_ng_version }}.tar.gz | tar xzf - && \
5254
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 -%}
5360
./bootstrap && \
5461
./configure --prefix=/usr/local && \
5562
make -j4 && \
@@ -87,8 +94,8 @@ ENV TARGET_CC={{ target }}-gcc \
8794
TARGET_SYSROOT=/usr/{{ target }}/{{ target }}/sysroot/ \
8895
TARGET_C_INCLUDE_PATH=/usr/{{ target }}/{{ target }}/sysroot/usr/include/
8996

90-
ENV CARGO_BUILD_TARGET={{ target | replace('ibm', 'unknown') }}
91-
ENV CARGO_TARGET_{{ target | replace('ibm', 'unknown') | replace('-', '_') | upper }}_LINKER={{ target }}-gcc
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
9299
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
93100
ENV TARGET_CMAKE_TOOLCHAIN_FILE_PATH=/usr/{{ target }}/cmake-toolchain.cmake
94101
{% endif %}
@@ -150,7 +157,11 @@ RUN cd /tmp && \
150157
VERS=3.7.17 && PREFIX=/opt/python/cp37-cp37m && \
151158
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
152159
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
153-
./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 && \
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 && \
154165
{% if target.startswith('armv7-') -%}
155166
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
156167
{% endif -%}
@@ -167,7 +178,11 @@ RUN cd /tmp && \
167178
VERS=3.8.20 && PREFIX=/opt/python/cp38-cp38 && \
168179
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
169180
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
170-
./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 && \
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 && \
171186
{% if target.startswith('armv7-') -%}
172187
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
173188
{% endif -%}
@@ -181,10 +196,10 @@ RUN cd /tmp && \
181196
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete
182197

183198
RUN cd /tmp && \
184-
VERS=3.9.20 && PREFIX=/opt/python/cp39-cp39 && \
199+
VERS=3.9.22 && PREFIX=/opt/python/cp39-cp39 && \
185200
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
186201
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
187-
./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 && \
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 && \
188203
{% if target.startswith('armv7-') -%}
189204
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
190205
{% endif -%}
@@ -198,10 +213,10 @@ RUN cd /tmp && \
198213
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete
199214

200215
RUN cd /tmp && \
201-
VERS=3.10.15 && PREFIX=/opt/python/cp310-cp310 && \
216+
VERS=3.10.17 && PREFIX=/opt/python/cp310-cp310 && \
202217
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
203218
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
204-
./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 && \
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 && \
205220
{% if target.startswith('armv7-') -%}
206221
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
207222
{% endif -%}
@@ -215,10 +230,10 @@ RUN cd /tmp && \
215230
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete
216231

217232
RUN cd /tmp && \
218-
VERS=3.11.10 && PREFIX=/opt/python/cp311-cp311 && \
233+
VERS=3.11.12 && PREFIX=/opt/python/cp311-cp311 && \
219234
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
220235
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
221-
./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 && \
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 && \
222237
{% if target.startswith('armv7-') -%}
223238
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
224239
{% endif -%}
@@ -232,10 +247,10 @@ RUN cd /tmp && \
232247
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete
233248

234249
RUN cd /tmp && \
235-
VERS=3.12.7 && PREFIX=/opt/python/cp312-cp312 && \
250+
VERS=3.12.10 && PREFIX=/opt/python/cp312-cp312 && \
236251
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
237252
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
238-
./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 && \
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 && \
239254
{% if target.startswith('armv7-') -%}
240255
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
241256
{% endif -%}
@@ -249,10 +264,10 @@ RUN cd /tmp && \
249264
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete
250265

251266
RUN cd /tmp && \
252-
VERS=3.13.0 && PREFIX=/opt/python/cp313-cp313 && \
267+
VERS=3.13.3 && PREFIX=/opt/python/cp313-cp313 && \
253268
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
254269
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
255-
./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 && \
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 }} && \
256271
{% if target.startswith('armv7-') -%}
257272
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
258273
{% endif -%}
@@ -265,11 +280,23 @@ RUN cd /tmp && \
265280
# We do not need precompiled .pyc and .pyo files.
266281
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete
267282
{%- endif %}
268-
RUN curl -sS https://bootstrap.pypa.io/pip/3.7/get-pip.py | "python3.7" && \
269-
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 && \
270-
curl -sS https://bootstrap.pypa.io/pip/3.7/get-pip.py | "pypy3.7" && \
271-
for VER in 3.8 3.9 3.10; do curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; done && \
272-
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 && \
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 && \
273299
python3 -m pip --version && \
274300
python3 -m pip install --no-cache-dir auditwheel patchelf build && \
275301
python3 -m pip install --no-cache-dir auditwheel-symbols
302+

manylinux2014/aarch64/Dockerfile

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ RUN apt-get update && \
2323
libncurses-dev \
2424
libssl-dev \
2525
libtool-bin \
26+
lzip \
2627
make \
2728
ninja-build \
2829
patch \
2930
pkg-config \
3031
python3 \
32+
rsync \
3133
sudo \
3234
texinfo \
3335
unzip \
@@ -127,11 +129,22 @@ RUN if [ "$(uname -m)" = "x86_64" ]; then export PYPY_ARCH="linux64"; else expor
127129
COPY --from=manylinux /opt/_internal /opt/_internal
128130
COPY --from=manylinux /opt/python /opt/python
129131

130-
RUN curl -sS https://bootstrap.pypa.io/pip/3.7/get-pip.py | "python3.7" && \
131-
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 && \
132-
curl -sS https://bootstrap.pypa.io/pip/3.7/get-pip.py | "pypy3.7" && \
133-
for VER in 3.8 3.9 3.10; do curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; done && \
134-
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 && \
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 && \
135148
python3 -m pip --version && \
136149
python3 -m pip install --no-cache-dir auditwheel patchelf build && \
137-
python3 -m pip install --no-cache-dir auditwheel-symbols
150+
python3 -m pip install --no-cache-dir auditwheel-symbols

0 commit comments

Comments
 (0)