Skip to content

Commit 268610a

Browse files
Enable loongarch64-linux support
Signed-off-by: 吴小白 <296015668@qq.com>
1 parent c210ac6 commit 268610a

File tree

17 files changed

+62
-542
lines changed

17 files changed

+62
-542
lines changed

.github/workflows/linux.yml

Lines changed: 8 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -219,114 +219,16 @@ jobs:
219219
fail-fast: false
220220
name: ${{ matrix.target_triple }} / ${{ matrix.python }} / ${{ matrix.build_options }}
221221
steps:
222-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
223-
with:
224-
fetch-depth: 0
225-
persist-credentials: false
226-
227-
- name: Set up uv
228-
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
229-
with:
230-
enable-cache: false
231-
232-
- name: Download pythonbuild
233-
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
234-
with:
235-
name: ${{ matrix.crate_artifact_name }}
236-
path: build
237-
238-
- name: Download images
239-
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
240-
with:
241-
pattern: image-*
242-
path: build
243-
merge-multiple: true
244-
245-
- name: Cache downloads
246-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
247-
with:
248-
path: build/downloads
249-
key: ${{ matrix.target_triple }}-${{ hashFiles('pythonbuild/downloads.py')}}
250-
restore-keys: |
251-
${{ matrix.target_triple }}-${{ hashFiles('pythonbuild/downloads.py')}}
252-
${{ matrix.target_triple }}-
253-
254-
- name: Load Docker Images
255-
run: |
256-
for f in build/image-*.tar.zst; do
257-
echo "decompressing $f"
258-
zstd -d --rm ${f}
259-
done
260-
261-
for f in build/image-*.tar; do
262-
echo "loading $f"
263-
docker load --input $f
264-
done
265-
266-
- name: Build
267-
if: ${{ ! matrix.dry-run }}
268-
run: |
269-
# Do empty target so all generated files are touched.
270-
./build.py --make-target empty
271-
272-
# Touch mtimes of all images so they are newer than autogenerated files above.
273-
touch build/image-*
274-
275-
./build.py --target-triple ${MATRIX_TARGET_TRIPLE} --python cpython-${MATRIX_PYTHON} --options ${MATRIX_BUILD_OPTIONS}
276-
env:
277-
MATRIX_TARGET_TRIPLE: ${{ matrix.target_triple }}
278-
MATRIX_PYTHON: ${{ matrix.python }}
279-
MATRIX_BUILD_OPTIONS: ${{ matrix.build_options }}
280-
281-
- name: Generate attestations
282-
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
283-
if: ${{ github.ref == 'refs/heads/main' }}
284-
with:
285-
subject-path: dist/*
286-
287-
- name: Upload Distribution
288-
if: ${{ ! matrix.dry-run }}
289-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
222+
- uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # main
290223
with:
291-
name: cpython-${{ matrix.python }}-${{ matrix.target_triple }}-${{ matrix.build_options }}
292-
path: dist/*
293-
294-
- name: Validate Distribution
295-
if: ${{ ! matrix.dry-run }}
296-
run: |
297-
chmod +x build/pythonbuild
298-
299-
if [ "${MATRIX_RUN}" == "true" ]; then
300-
if [ "${MATRIX_LIBC}" == "musl" ]; then
301-
sudo apt install musl-dev
302-
303-
# GitHub's setup-python action sets `LD_LIBRARY_PATH` which overrides `RPATH`
304-
# as used in the musl builds.
305-
unset LD_LIBRARY_PATH
306-
fi
307-
EXTRA_ARGS="--run"
308-
fi
309-
310-
build/pythonbuild validate-distribution ${EXTRA_ARGS} dist/*.tar.zst
311-
env:
312-
MATRIX_RUN: ${{ matrix.run }}
313-
MATRIX_LIBC: ${{ matrix.libc }}
224+
tool-cache: false
225+
android: true
226+
dotnet: true
227+
haskell: true
228+
large-packages: false
229+
docker-images: false
230+
swap-storage: false
314231

315-
build-1:
316-
needs:
317-
- generate-matrix
318-
- crate-build
319-
- image
320-
# Permissions used for actions/attest-build-provenance
321-
permissions:
322-
id-token: write
323-
attestations: write
324-
runs-on: ${{ matrix.runner }}
325-
strategy:
326-
matrix: ${{ fromJson(needs.generate-matrix.outputs.python-build-matrix-1) }}
327-
fail-fast: false
328-
name: ${{ matrix.target_triple }} / ${{ matrix.python }} / ${{ matrix.build_options }}
329-
steps:
330232
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
331233
with:
332234
fetch-depth: 0

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
name: Release
2626
env:
2727
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28-
runs-on: depot-ubuntu-24.04-8
28+
runs-on: ubuntu-latest
2929

3030
permissions:
3131
contents: write

Justfile

Lines changed: 5 additions & 5 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:
@@ -51,8 +51,8 @@ release-set-latest-release tag:
5151
{
5252
"version": 1,
5353
"tag": "{{tag}}",
54-
"release_url": "https://github.com/astral-sh/python-build-standalone/releases/tag/{{tag}}",
55-
"asset_url_prefix": "https://github.com/astral-sh/python-build-standalone/releases/download/{{tag}}"
54+
"release_url": "https://github.com/loong64/python-build-standalone/releases/tag/{{tag}}",
55+
"asset_url_prefix": "https://github.com/loong64/python-build-standalone/releases/download/{{tag}}"
5656
}
5757
EOF
5858

@@ -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": "x86_64"},
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)