Skip to content

Commit dc6dfeb

Browse files
authored
Merge pull request #153 from robotpy/ci-linux-arm
Build Linux AArch64 wheels natively
2 parents 3a43da7 + c1ed35a commit dc6dfeb

File tree

2 files changed

+68
-11
lines changed

2 files changed

+68
-11
lines changed

.github/workflows/dist.yml

Lines changed: 66 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
env:
18-
SCCACHE_CACHE_MULTIARCH: "1"
1918
SCCACHE_WEBDAV_ENDPOINT: "https://frcmaven.wpi.edu/artifactory/wpilib-generic-cache-cmake-local"
2019
SCCACHE_WEBDAV_KEY_PREFIX: "sccache-robotpy"
2120

@@ -96,13 +95,18 @@ jobs:
9695
- name: Set ccache params
9796
shell: bash
9897
id: ccache
98+
env:
99+
OS: ${{ runner.os }}
99100
run: |
100-
if [[ "${{ runner.os }}" != "Linux" ]]; then
101+
if [[ "$OS" != "Linux" ]]; then
101102
echo "VARIANT=sccache" >> $GITHUB_OUTPUT
102103
else
103104
echo "VARIANT=ccache" >> $GITHUB_OUTPUT
104105
echo "MAX_SIZE=500M" >> $GITHUB_OUTPUT
105106
fi
107+
if [[ "$OS" == "macOS" ]]; then
108+
echo "SCCACHE_CACHE_MULTIARCH=1" >> $GITHUB_ENV
109+
fi
106110
107111
- name: Setup ccache
108112
if: steps.ccache.outputs.variant == 'ccache'
@@ -141,6 +145,64 @@ jobs:
141145
name: "pypi-${{ runner.os }}-${{ matrix.python_version }}"
142146
path: dist
143147

148+
build-arm:
149+
runs-on: ubuntu-22.04-arm
150+
needs: [setup_concurrency]
151+
strategy:
152+
max-parallel: ${{ fromJSON(needs.setup_concurrency.outputs.max-parallel).v }}
153+
fail-fast: true
154+
matrix:
155+
python_version:
156+
- '3.11'
157+
- '3.12'
158+
- '3.13'
159+
container: python:${{ matrix.python_version }}-bookworm
160+
161+
steps:
162+
- run: apt-get update && apt-get install -y libgl1
163+
164+
- uses: actions/checkout@v4
165+
with:
166+
fetch-depth: 0
167+
168+
#
169+
# Setup build caching
170+
#
171+
172+
- name: Setup sccache
173+
uses: mozilla-actions/[email protected]
174+
175+
# See https://github.com/pypa/setuptools_scm/issues/784
176+
- name: Set git directory as safe to allow setuptools-scm to work
177+
shell: bash
178+
run: |
179+
/usr/bin/git config --global --add safe.directory $PWD
180+
181+
- name: Install deps
182+
shell: bash
183+
run: |
184+
python -m pip --disable-pip-version-check install -r rdev_requirements.txt
185+
186+
- name: Install numpy (needed for stubgen)
187+
shell: bash
188+
run: |
189+
python -m pip --disable-pip-version-check install numpy
190+
191+
- name: Build + test wheels
192+
shell: bash
193+
run: |
194+
./rdev.sh ci run
195+
env:
196+
RPYBUILD_STRIP_LIBPYTHON: "1"
197+
RPYBUILD_CC_LAUNCHER: sccache
198+
SCCACHE_WEBDAV_USERNAME: ${{ secrets.WPI_ARTIFACTORY_USERNAME }}
199+
SCCACHE_WEBDAV_PASSWORD: ${{ secrets.WPI_ARTIFACTORY_TOKEN }}
200+
201+
- uses: actions/upload-artifact@v4
202+
with:
203+
name: "pypi-${{ runner.os }}-arm-${{ matrix.python_version }}"
204+
path: dist
205+
144206
#
145207
# Build roboRIO/raspbian wheels
146208
#
@@ -162,13 +224,6 @@ jobs:
162224
- container: wpilib/raspbian-cross-ubuntu:2025-bookworm-22.04-py313
163225
name: raspbian-py313
164226

165-
- container: wpilib/aarch64-cross-ubuntu:2025-bookworm-22.04-py311
166-
name: raspbian-aarch64-py311
167-
- container: wpilib/aarch64-cross-ubuntu:2025-bookworm-22.04-py312
168-
name: raspbian-aarch64-py312
169-
- container: wpilib/aarch64-cross-ubuntu:2025-bookworm-22.04-py313
170-
name: raspbian-aarch64-py313
171-
172227
container:
173228
image: "${{ matrix.os.container }}"
174229

@@ -228,7 +283,7 @@ jobs:
228283

229284
publish-rpyrepo:
230285
runs-on: ubuntu-latest
231-
needs: [check, build, cross-build]
286+
needs: [check, build, build-arm, cross-build]
232287
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
233288

234289
steps:
@@ -248,7 +303,7 @@ jobs:
248303

249304
publish-pypi:
250305
runs-on: ubuntu-latest
251-
needs: [check, build, cross-build]
306+
needs: [check, build, build-arm, cross-build]
252307
permissions:
253308
id-token: write
254309
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')

devtools/subproject.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ def bdist_wheel(self, *, wheel_path: pathlib.Path, install: bool):
128128

129129
_adjust_wheel_tags = {
130130
# pypi only accepts manylinux wheels, and we know we're compatible
131+
# TODO(davo): use auditwheel to fix the tags instead
131132
"linux_x86_64": "manylinux_2_35_x86_64",
133+
"linux_aarch64": "manylinux_2_36_aarch64",
132134
# needed for compatibility with python compiled with older xcode
133135
"macosx_11_0_x86_64": "macosx_10_16_x86_64",
134136
"macosx_12_0_x86_64": "macosx_10_16_x86_64",

0 commit comments

Comments
 (0)