Skip to content

Commit e8c869a

Browse files
Add loongarch64-linux support
Signed-off-by: 吴小白 <[email protected]>
1 parent 4ec8e29 commit e8c869a

23 files changed

+237
-536
lines changed

.github/workflows/linux.yml

Lines changed: 0 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -307,111 +307,3 @@ jobs:
307307
env:
308308
MATRIX_RUN: ${{ matrix.run }}
309309
MATRIX_LIBC: ${{ matrix.libc }}
310-
311-
build-1:
312-
needs:
313-
- generate-matrix
314-
- crate-build
315-
- image
316-
# Permissions used for actions/attest-build-provenance
317-
permissions:
318-
id-token: write
319-
attestations: write
320-
runs-on: ${{ matrix.runner }}
321-
strategy:
322-
matrix: ${{ fromJson(needs.generate-matrix.outputs.python-build-matrix-1) }}
323-
fail-fast: false
324-
name: ${{ matrix.target_triple }} / ${{ matrix.python }} / ${{ matrix.build_options }}
325-
steps:
326-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
327-
with:
328-
fetch-depth: 0
329-
persist-credentials: false
330-
331-
- name: Install Python
332-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
333-
with:
334-
python-version: "3.11"
335-
336-
- name: Download pythonbuild
337-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
338-
with:
339-
name: ${{ matrix.crate_artifact_name }}
340-
path: build
341-
342-
- name: Download images
343-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
344-
with:
345-
pattern: image-*
346-
path: build
347-
merge-multiple: true
348-
349-
- name: Cache downloads
350-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
351-
with:
352-
path: build/downloads
353-
key: ${{ matrix.target_triple }}-${{ hashFiles('pythonbuild/downloads.py')}}
354-
restore-keys: |
355-
${{ matrix.target_triple }}-${{ hashFiles('pythonbuild/downloads.py')}}
356-
${{ matrix.target_triple }}-
357-
358-
- name: Load Docker Images
359-
run: |
360-
for f in build/image-*.tar.zst; do
361-
echo "decompressing $f"
362-
zstd -d --rm ${f}
363-
done
364-
365-
for f in build/image-*.tar; do
366-
echo "loading $f"
367-
docker load --input $f
368-
done
369-
370-
- name: Build
371-
if: ${{ ! matrix.dry-run }}
372-
run: |
373-
# Do empty target so all generated files are touched.
374-
./build-linux.py --make-target empty
375-
376-
# Touch mtimes of all images so they are newer than autogenerated files above.
377-
touch build/image-*
378-
379-
./build-linux.py --target-triple ${MATRIX_TARGET_TRIPLE} --python cpython-${MATRIX_PYTHON} --options ${MATRIX_BUILD_OPTIONS}
380-
env:
381-
MATRIX_TARGET_TRIPLE: ${{ matrix.target_triple }}
382-
MATRIX_PYTHON: ${{ matrix.python }}
383-
MATRIX_BUILD_OPTIONS: ${{ matrix.build_options }}
384-
385-
- name: Generate attestations
386-
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0
387-
if: ${{ github.ref == 'refs/heads/main' }}
388-
with:
389-
subject-path: dist/*
390-
391-
- name: Upload Distribution
392-
if: ${{ ! matrix.dry-run }}
393-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
394-
with:
395-
name: cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }}
396-
path: dist/*
397-
398-
- name: Validate Distribution
399-
if: ${{ ! matrix.dry-run }}
400-
run: |
401-
chmod +x build/pythonbuild
402-
403-
if [ "${MATRIX_RUN}" == "true" ]; then
404-
if [ "${MATRIX_LIBC}" == "musl" ]; then
405-
sudo apt install musl-dev
406-
407-
# GitHub's setup-python action sets `LD_LIBRARY_PATH` which overrides `RPATH`
408-
# as used in the musl builds.
409-
unset LD_LIBRARY_PATH
410-
fi
411-
EXTRA_ARGS="--run"
412-
fi
413-
414-
build/pythonbuild validate-distribution ${EXTRA_ARGS} dist/*.tar.zst
415-
env:
416-
MATRIX_RUN: ${{ matrix.run }}
417-
MATRIX_LIBC: ${{ matrix.libc }}

Justfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ release-download-distributions token commit:
3232

3333
# Upload release artifacts to a GitHub release.
3434
release-upload-distributions token datetime tag:
35-
cargo run --release -- upload-release-distributions --token {{token}} --datetime {{datetime}} --tag {{tag}} --dist dist
35+
cargo run --release -- upload-release-distributions --token {{token}} --datetime {{datetime}} --tag {{tag}} --dist dist --ignore-missing
3636

3737
# "Upload" release artifacts to a GitHub release in dry-run mode (skip upload).
3838
release-upload-distributions-dry-run token datetime tag:
@@ -96,7 +96,7 @@ release-run token commit tag:
9696

9797
rm -rf dist
9898
just release-download-distributions {{token}} {{commit}}
99-
datetime=$(ls dist/cpython-3.10.*-x86_64-unknown-linux-gnu-install_only-*.tar.gz | awk -F- '{print $8}' | awk -F. '{print $1}')
99+
datetime=$(ls dist/cpython-3.10.*-loongarch64-unknown-linux-gnu-install_only-*.tar.gz | awk -F- '{print $8}' | awk -F. '{print $1}')
100100
just release-upload-distributions {{token}} ${datetime} {{tag}}
101101
just release-set-latest-release {{tag}}
102102

@@ -107,7 +107,7 @@ release-dry-run token commit tag:
107107

108108
rm -rf dist
109109
just release-download-distributions {{token}} {{commit}}
110-
datetime=$(ls dist/cpython-3.10.*-x86_64-unknown-linux-gnu-install_only-*.tar.gz | awk -F- '{print $8}' | awk -F. '{print $1}')
110+
datetime=$(ls dist/cpython-3.10.*-loongarch64-unknown-linux-gnu-install_only-*.tar.gz | awk -F- '{print $8}' | awk -F. '{print $1}')
111111
just release-upload-distributions-dry-run {{token}} ${datetime} {{tag}}
112112

113113
_download-stats mode:

ci-matrix.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
{"name": "build", "arch": "x86_64"},
2626
{"name": "build.cross", "arch": "x86_64"},
2727
{"name": "build.cross-riscv64", "arch": "x86_64"},
28+
{"name": "build.cross-loongarch64", "arch": "loongarch64"},
2829
{"name": "build.debian9", "arch": "aarch64"},
2930
{"name": "gcc", "arch": "x86_64"},
3031
{"name": "gcc.debian9", "arch": "aarch64"},

ci-runners.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Describes the runners that the CI system can use
22

3-
depot-ubuntu-22.04:
3+
ubuntu-22.04:
44
arch: x86_64
55
platform: linux
66
free: false
77

8-
depot-ubuntu-22.04-arm:
8+
ubuntu-22.04-arm:
99
arch: aarch64
1010
platform: linux
1111
free: false

0 commit comments

Comments
 (0)