Skip to content

feat: introduce riscv64 to linux and musllinux builds#620

Merged
bdraco merged 2 commits into
Bluetooth-Devices:mainfrom
eshattow:riscv64
May 17, 2026
Merged

feat: introduce riscv64 to linux and musllinux builds#620
bdraco merged 2 commits into
Bluetooth-Devices:mainfrom
eshattow:riscv64

Conversation

@eshattow

Copy link
Copy Markdown
Contributor

Adding RISC-V to build and publish, depends on (#619 tracking issue) use of https://riseproject-dev.github.io/riscv-runner/

@eshattow eshattow mentioned this pull request Apr 29, 2026
@codecov

codecov Bot commented Apr 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.84%. Comparing base (e93c3e0) to head (249443b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #620      +/-   ##
==========================================
- Coverage   89.90%   89.84%   -0.06%     
==========================================
  Files          29       29              
  Lines        3527     3527              
  Branches      606      606              
==========================================
- Hits         3171     3169       -2     
- Misses        211      212       +1     
- Partials      145      146       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq

codspeed-hq Bot commented Apr 29, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 6 untouched benchmarks


Comparing eshattow:riscv64 (249443b) with main (e93c3e0)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (fdd89a8) during the generation of this report, so e93c3e0 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a RISC-V (riscv64) build target into the wheel build workflow so Linux and musllinux wheels can be produced for that architecture.

Changes:

  • Add ubuntu-24.04-riscv to the build_wheels job matrix.
  • Configure CIBW_ARCHS_LINUX to select riscv64 when running on the RISC-V runner.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml
@bdraco

bdraco commented May 17, 2026

Copy link
Copy Markdown
Member

@bluetoothbot review

@bluetoothbot

bluetoothbot commented May 17, 2026

Copy link
Copy Markdown
Contributor

PR Review — feat: introduce riscv64 to linux and musllinux builds

Solid PR overall. The QEMU + per-Python-version split is the right approach for slow emulated riscv64 builds, action versions are SHA-pinned (including the explicit tonistiigi/binfmt:qemu-v8.1.5 workaround for the documented binfmt issues), and the rewritten CIBW_ARCHS_LINUX expression (arm && 'aarch64') || matrix.qemu || 'auto' correctly resolves for all three branches. The artifact name now includes qemu/pyver, so 12 new riscv64 rows produce distinct artifacts. build_wheels is gated on a successful release, so the extra ~30min × 12 QEMU runs only land on release runs, not every PR.

The one real concern is cp314t-riscv64 — free-threaded Python under QEMU on a recently-supported architecture is fragile and could break a release if cibuildwheel can't find a working image. Recommend confirming that lane works before merging, or omitting cp314t initially. The other two items are purely cosmetic (trailing dashes/spaces in artifact and job names).

Note: this PR can't validate itself — build_wheels only runs post-release, so the first riscv64 build will happen on the next release after merge. Worth keeping an eye on that release run.


🟡 Important

1. cp314t-riscv64 may not have a working manylinux/musllinux image (`.github/workflows/ci.yml`, L236)

Free-threaded Python 3.14 (cp314t) support across architectures is still maturing — pypa/manylinux currently lists manylinux_2_39_riscv64 as the riscv64 image, but its cp314t free-threaded wheel build under QEMU is not as well-exercised as the other arches. If cibuildwheel can't find a cp314t-riscv64 image (or build fails under QEMU), these two matrix cells (musllinux + "") will fail and block the release artifact aggregation step.

Since build_wheels runs only after release succeeds, a failure here means a published PyPI release with missing riscv64 cp314t wheels (or worse, a failed upload_pypi if the job is required). Consider either: (a) omitting cp314t initially and adding it once upstream support is confirmed, or (b) confirming locally with docker run --platform linux/riscv64 quay.io/pypa/musllinux_1_2_riscv64 … that a free-threaded cpython is present before merging. Worth verifying since you can't actually exercise these matrix rows from this PR — build_wheels is gated on needs.release.outputs.released == 'true'.

          - {
              os: ubuntu-latest,
              qemu: riscv64,
              musl: "musllinux",
              pyver: cp314t,
            }

🟢 Suggestions

1. Artifact names gain stray empty fields for non-QEMU rows (`.github/workflows/ci.yml`, L283)

For the original (non-riscv64) matrix entries — where matrix.qemu and matrix.pyver are "" — the artifact name now expands to e.g. wheels-ubuntu-24.04-arm-musllinux-- (two trailing dashes) rather than the previous wheels-ubuntu-24.04-arm-musllinux. This is purely cosmetic and the upload_pypi step uses pattern: wheels-* with merge-multiple: true, so functionality is unaffected. If you want clean artifact names, you could conditionally suffix only when set, e.g. wheels-${{ matrix.os }}-${{ matrix.musl }}${{ matrix.qemu && format('-{0}', matrix.qemu) || '' }}${{ matrix.pyver && format('-{0}', matrix.pyver) || '' }}. Not blocking — feel free to leave as-is.

          name: wheels-${{ matrix.os }}-${{ matrix.musl }}-${{ matrix.qemu }}-${{ matrix.pyver }}
2. Job display name has trailing empty placeholders (`.github/workflows/ci.yml`, L196)

For non-riscv64 rows, the name renders as e.g. Build wheels on ubuntu-24.04-arm musllinux (two trailing spaces). Same fix idea as the artifact name — conditional formatting — but again purely cosmetic. As a side benefit, this PR removes the stale with arch ${{ matrix.arch }} placeholder that was never bound to a matrix dimension, which was flagged by Copilot in an earlier review pass.

    name: Build wheels on ${{ matrix.os }} ${{ matrix.musl }} ${{ matrix.qemu }} ${{ matrix.pyver }}

Checklist

  • No hardcoded secrets or credentials
  • Action versions pinned to SHAs
  • QEMU image pinned to a known-good version
  • CIBW_ARCHS_LINUX expression covers all matrix branches
  • Artifact names disambiguate across new matrix cells
  • Free-threaded (cp314t) riscv64 build viability confirmed — warning #1
  • No regression in existing aarch64/x86_64/macOS rows
  • Build cost contained (gated on release)

Summary

Solid PR overall. The QEMU + per-Python-version split is the right approach for slow emulated riscv64 builds, action versions are SHA-pinned (including the explicit tonistiigi/binfmt:qemu-v8.1.5 workaround for the documented binfmt issues), and the rewritten CIBW_ARCHS_LINUX expression (arm && 'aarch64') || matrix.qemu || 'auto' correctly resolves for all three branches. The artifact name now includes qemu/pyver, so 12 new riscv64 rows produce distinct artifacts. build_wheels is gated on a successful release, so the extra ~30min × 12 QEMU runs only land on release runs, not every PR.

The one real concern is cp314t-riscv64 — free-threaded Python under QEMU on a recently-supported architecture is fragile and could break a release if cibuildwheel can't find a working image. Recommend confirming that lane works before merging, or omitting cp314t initially. The other two items are purely cosmetic (trailing dashes/spaces in artifact and job names).

Note: this PR can't validate itself — build_wheels only runs post-release, so the first riscv64 build will happen on the next release after merge. Worth keeping an eye on that release run.


Automated review by Kōan82ad3bf
249443b

@eshattow

Copy link
Copy Markdown
Contributor Author

rebased on the CI fix and force pushed

@bdraco

bdraco commented May 17, 2026

Copy link
Copy Markdown
Member

@bluetoothbot review

@bdraco

bdraco commented May 17, 2026

Copy link
Copy Markdown
Member

wheels work on zeroconf, already proven. no need to gate 3.14t

@bdraco bdraco merged commit 8e112c1 into Bluetooth-Devices:main May 17, 2026
23 of 24 checks passed
@eshattow eshattow deleted the riscv64 branch May 17, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build for RISC-V

4 participants