Skip to content

fix(ci): set PYO3_CROSS_PYTHON_VERSION for aarch64 Linux cross-compilation#58

Merged
polaz merged 1 commit intomainfrom
fix/#57-aarch64-pyo3-cross-python
May 3, 2026
Merged

fix(ci): set PYO3_CROSS_PYTHON_VERSION for aarch64 Linux cross-compilation#58
polaz merged 1 commit intomainfrom
fix/#57-aarch64-pyo3-cross-python

Conversation

@polaz
Copy link
Copy Markdown
Member

@polaz polaz commented May 3, 2026

Problem

Build embedded / aarch64 (ubuntu-latest) fails with:

💥 maturin failed
  Caused by: Couldn't find any python interpreters. Please specify at least one with -i

maturin-action v1.47.0 with manylinux_2_28 + target: aarch64 on an x86_64 runner uses ghcr.io/rust-cross/manylinux_2_28-cross:aarch64 — a Debian-based cross-compilation container with no Python interpreters.

Fix

Set PYO3_CROSS_PYTHON_VERSION=3.11 for the aarch64 Linux matrix entry. This tells PyO3 to generate bindings for Python 3.11 without needing a Python binary in the container — the standard approach for cross-compilation without QEMU emulation.

The env var is only set for the aarch64 Linux matrix entry; other entries have it empty/unset. PyO3 ignores it on native builds where Python is available.

rust-cross/manylinux_2_28-cross:aarch64 has no Python interpreter, so
maturin fails with "Couldn't find any python interpreters". Setting
PYO3_CROSS_PYTHON_VERSION=3.11 lets PyO3 generate bindings without
requiring a Python binary in the cross-compilation container.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a8c4d5dd-de0a-4b53-b61c-d6ada893570f

📥 Commits

Reviewing files that changed from the base of the PR and between 73bf4db and 269805e.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Improved cross-compilation support for ARM64 architecture builds, enabling proper Python version targeting during the wheel build process on non-native platforms.

Walkthrough

The PR updates the .github/workflows/release.yml file to add explicit Python version configuration for PyO3 cross-compilation. A pyo3_cross_python_version: "3.11" matrix variable is added for Linux aarch64 builds and passed to the maturin build step via PYO3_CROSS_PYTHON_VERSION environment variable.

Changes

CI Cross-Compilation Configuration

Layer / File(s) Summary
Matrix Setup
.github/workflows/release.yml (lines 76–82)
build-embedded job's aarch64 Linux matrix entry adds pyo3_cross_python_version: "3.11" to specify the target Python version for cross-compilation.
Build Environment
.github/workflows/release.yml (lines 138–139)
PyO3/maturin-action step now sets PYO3_CROSS_PYTHON_VERSION environment variable from the matrix value, enabling PyO3 to target the specified Python version during aarch64 cross-builds.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

  • #40: Modifies the same build-embedded job for aarch64 Python version and cross-compilation setup control.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: setting PYO3_CROSS_PYTHON_VERSION for aarch64 cross-compilation in CI.
Description check ✅ Passed The description is directly related to the changeset, explaining both the problem and the solution implemented in the CI workflow file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/#57-aarch64-pyo3-cross-python

Review rate limit: 4/5 reviews remaining, refill in 12 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 3, 2026

@polaz polaz merged commit 899bf4a into main May 3, 2026
8 checks passed
@polaz polaz deleted the fix/#57-aarch64-pyo3-cross-python branch May 3, 2026 06:04
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.

1 participant