Skip to content

Commit 61fe7bd

Browse files
Add loongarch64-linux support
Signed-off-by: 吴小白 <[email protected]>
1 parent a376f32 commit 61fe7bd

23 files changed

+231
-407
lines changed

.github/workflows/linux.yml

Lines changed: 0 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -279,103 +279,3 @@ jobs:
279279
fi
280280
281281
build/pythonbuild validate-distribution ${EXTRA_ARGS} dist/*.tar.zst
282-
283-
build-1:
284-
needs:
285-
- generate-matrix
286-
- crate-build
287-
- image
288-
# Permissions used for actions/attest-build-provenance
289-
permissions:
290-
id-token: write
291-
attestations: write
292-
runs-on: ${{ matrix.runner }}
293-
strategy:
294-
matrix: ${{ fromJson(needs.generate-matrix.outputs.python-build-matrix-1) }}
295-
fail-fast: false
296-
name: ${{ matrix.target_triple }} / ${{ matrix.python }} / ${{ matrix.build_options }}
297-
steps:
298-
- uses: actions/checkout@v4
299-
with:
300-
fetch-depth: 0
301-
302-
- name: Install Python
303-
uses: actions/setup-python@v5
304-
with:
305-
python-version: '3.11'
306-
307-
- name: Download pythonbuild
308-
uses: actions/download-artifact@v4
309-
with:
310-
name: ${{ matrix.crate_artifact_name }}
311-
path: build
312-
313-
- name: Download images
314-
uses: actions/download-artifact@v4
315-
with:
316-
pattern: image-*
317-
path: build
318-
merge-multiple: true
319-
320-
- name: Cache downloads
321-
uses: actions/cache@v4
322-
with:
323-
path: build/downloads
324-
key: ${{ matrix.target_triple }}-${{ hashFiles('pythonbuild/downloads.py')}}
325-
restore-keys: |
326-
${{ matrix.target_triple }}-${{ hashFiles('pythonbuild/downloads.py')}}
327-
${{ matrix.target_triple }}-
328-
329-
- name: Load Docker Images
330-
run: |
331-
for f in build/image-*.tar.zst; do
332-
echo "decompressing $f"
333-
zstd -d --rm ${f}
334-
done
335-
336-
for f in build/image-*.tar; do
337-
echo "loading $f"
338-
docker load --input $f
339-
done
340-
341-
- name: Build
342-
if: ${{ ! matrix.dry-run }}
343-
run: |
344-
# Do empty target so all generated files are touched.
345-
./build-linux.py --make-target empty
346-
347-
# Touch mtimes of all images so they are newer than autogenerated files above.
348-
touch build/image-*
349-
350-
./build-linux.py --target-triple ${{ matrix.target_triple }} --python cpython-${{ matrix.python }} --options ${{ matrix.build_options }}
351-
352-
- name: Generate attestations
353-
uses: actions/attest-build-provenance@v2
354-
if: ${{ github.ref == 'refs/heads/main' }}
355-
with:
356-
subject-path: dist/*
357-
358-
- name: Upload Distribution
359-
if: ${{ ! matrix.dry-run }}
360-
uses: actions/upload-artifact@v4
361-
with:
362-
name: cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }}
363-
path: dist/*
364-
365-
- name: Validate Distribution
366-
if: ${{ ! matrix.dry-run }}
367-
run: |
368-
chmod +x build/pythonbuild
369-
370-
if [ "${{ matrix.run }}" == "true" ]; then
371-
if [ "${{ matrix.libc }}" == "musl" ]; then
372-
sudo apt install musl-dev
373-
374-
# GitHub's setup-python action sets `LD_LIBRARY_PATH` which overrides `RPATH`
375-
# as used in the musl builds.
376-
unset LD_LIBRARY_PATH
377-
fi
378-
EXTRA_ARGS="--run"
379-
fi
380-
381-
build/pythonbuild validate-distribution ${EXTRA_ARGS} dist/*.tar.zst

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)