Skip to content

ci: add riscv64 manylinux wheels - #227

Merged
mattip merged 1 commit into
python-cffi:mainfrom
justeph:ci-add-riscv64-wheels
Sep 9, 2026
Merged

ci: add riscv64 manylinux wheels#227
mattip merged 1 commit into
python-cffi:mainfrom
justeph:ci-add-riscv64-wheels

Conversation

@justeph

@justeph justeph commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Now that cibuildwheel and PyPI support riscv64, we can start building riscv64 wheels.

Integrated in the same way as the s390x platform.

Now that cibuildwheel and PyPI support riscv64, we can start building riscv64 wheels.

Integrated in the same way as the s390x platform.

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
@justeph

justeph commented Mar 3, 2026

Copy link
Copy Markdown
Contributor Author

Hi, just checking in on this issue. Are you open to add riscv64 architecture? Is there anything I can help with to move it forward?

@gounthar

gounthar commented Mar 19, 2026

Copy link
Copy Markdown

+1 for this. I've verified that cffi 2.0.0 builds successfully on native riscv64 hardware (BananaPi F3, SpacemiT K1, rv64gc, GCC 14.2.0).

One suggestion: the current PR runs riscv64 on ubuntu-24.04 via QEMU (same as s390x/ppc64le). Native riscv64 runners are now available through RISE for free; this would make the builds significantly faster. I'll open a follow-up PR building on your work with native runner support.

Thanks @justeph for getting this started!

gounthar added a commit to gounthar/cffi that referenced this pull request Mar 19, 2026
Add riscv64 matrix entries (cp39-cp314t) following the s390x pattern,
with native RISE riscv64 runners instead of QEMU emulation.

Based on the work by @justeph in python-cffi#227, with the addition of:
- Native runner support (ubuntu-24.04-riscv) for faster builds
- Skip QEMU setup for riscv64 (not needed on native hardware)

Verified on native riscv64 hardware (BananaPi F3, SpacemiT K1).
Native RISE runners provided by the RISE project.

Signed-off-by: Bruno Verachten <gounthar@gmail.com>
@mattip

mattip commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Why didn't CI run here, or did it run and the results are no longer around?

@mattip

mattip commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Close open to trigger CI

@mattip mattip closed this Sep 8, 2026
@mattip mattip reopened this Sep 8, 2026
gounthar added a commit to gounthar/cffi that referenced this pull request Sep 8, 2026
riscv64 is the last mainstream Linux architecture without cffi wheels on
PyPI, so anything downstream of it has to compile from sdist. That bites
hardest in the maturin/Rust-to-Python toolchain, where cffi and patchelf
are the two remaining source builds.

The matrix entries follow the x86_64/aarch64 shape rather than the
s390x/ppc64le one: no test_args trimming and gated on
skip_ci_redundant_jobs instead of skip_slow_jobs, because these run on
real hardware and are not slow. Note that anything gated on
skip_slow_jobs never runs on a pull_request or push at all, since
ci.yaml sets that variable true for both events and dynamatrix drops the
entry.

Two riscv64-specific wrinkles in the linux job:

  - docker/setup-qemu-action is skipped, since the host is already
    riscv64 and there is nothing to emulate.
  - actions/setup-python publishes no riscv64 builds, so cibuildwheel is
    driven by an interpreter that uv fetches instead. The alternative,
    apt-installing a system python, ties the tool interpreter to
    whatever the runner image ships.

manylinux_2_39 is the first manylinux spec with riscv64 images, hence
the differing default for CIBW_MANYLINUX_RISCV64_IMAGE.

The runner label ubuntu-24.04-riscv comes from the RISE runners GitHub
App (https://github.com/apps/rise-risc-v-runners), which the
organisation would need installed before these jobs can pick up a
machine. Builds on the riscv64 matrix entries proposed by @justeph in
python-cffi#227.

Signed-off-by: Bruno Verachten <gounthar@gmail.com>
gounthar added a commit to gounthar/cffi that referenced this pull request Sep 8, 2026
riscv64 is the last mainstream Linux architecture without cffi wheels on
PyPI, so anything downstream of it has to compile from sdist. That bites
hardest in the maturin/Rust-to-Python toolchain, where cffi and patchelf
are the two remaining source builds.

The matrix entries follow the x86_64/aarch64 shape rather than the
s390x/ppc64le one: no test_args trimming and gated on
skip_ci_redundant_jobs instead of skip_slow_jobs, because these run on
real hardware and are not slow. Note that anything gated on
skip_slow_jobs never runs on a pull_request or push at all, since
ci.yaml sets that variable true for both events and dynamatrix drops the
entry.

Two riscv64-specific wrinkles in the linux job:

  - docker/setup-qemu-action is skipped, since the host is already
    riscv64 and there is nothing to emulate.
  - actions/setup-python publishes no riscv64 builds, so cibuildwheel is
    driven by an interpreter that uv fetches instead. The alternative,
    apt-installing a system python, ties the tool interpreter to
    whatever the runner image ships.

manylinux_2_39 is the first manylinux spec with riscv64 images, hence
the differing default for CIBW_MANYLINUX_RISCV64_IMAGE.

The runner label ubuntu-24.04-riscv comes from the RISE runners GitHub
App (https://github.com/apps/rise-risc-v-runners), which the
organisation would need installed before these jobs can pick up a
machine. Builds on the riscv64 matrix entries proposed by @justeph in
python-cffi#227.

Signed-off-by: Bruno Verachten <gounthar@gmail.com>
@mattip mattip mentioned this pull request Sep 9, 2026
@mattip
mattip merged commit a852067 into python-cffi:main Sep 9, 2026
38 checks passed
@mattip

mattip commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Thanks @justeph, @ffgan.

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.

3 participants