Skip to content

Enable cross-platform pip wheel selection for aarch64 cross-compilation#620

Merged
mvukov merged 2 commits into
mvukov:mainfrom
linzhp:pip_cross
May 31, 2026
Merged

Enable cross-platform pip wheel selection for aarch64 cross-compilation#620
mvukov merged 2 commits into
mvukov:mainfrom
linzhp:pip_cross

Conversation

@linzhp

@linzhp linzhp commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Add experimental_index_url and experimental_target_platforms to pip.parse so that rules_python selects the correct architecture wheel (e.g. aarch64) based on the Bazel target platform, instead of always resolving to the host (x86_64) wheel.

Without this, cross-compiling a Python binary that depends on numpy would produce a runfiles tree containing x86_64 .so files regardless of the --platforms flag.

This is an alternative to #619

Add experimental_index_url and experimental_target_platforms to pip.parse
so that rules_python selects the correct architecture wheel (e.g. aarch64)
based on the Bazel target platform, instead of always resolving to the
host (x86_64) wheel.

Without this, cross-compiling a Python binary that depends on numpy would
produce a runfiles tree containing x86_64 .so files regardless of the
--platforms flag.
@mvukov mvukov merged commit a6cc2f7 into mvukov:main May 31, 2026
10 checks passed
@linzhp linzhp deleted the pip_cross branch June 1, 2026 04:42
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.

2 participants