Skip to content

fix(pypi): skip a pip.parse version with no interpreter for the host - #4184

Merged
rickeylev merged 2 commits into
bazel-contrib:mainfrom
zakinko:pypi-skip-hostless-version
Sep 27, 2026
Merged

rickeylev merged 2 commits into
bazel-contrib:mainfrom
zakinko:pypi-skip-hostless-version

Conversation

@zakinko

@zakinko zakinko commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

On Windows ARM64, evaluating the pip extension fails as soon as any
module in the graph calls pip.parse for Python 3.9 or 3.10:

Unable to find interpreter for pip hub 'grpc_python_dependencies' for python_version=3.9: ...
Expected to find python_3_9_host among registered versions:
  python_3_11_host
  python_3_12_host
  python_3_13_host

There is no CPython 3.9 or 3.10 build for aarch64-pc-windows-msvc in the
runtime manifest, so those toolchains have no host interpreter there.

_pip_parse already handles a close relative of this: a version missing
from minor_mapping is skipped with an info message, and the hub's
select fails later only if that version is actually used. This treats a
version with no host interpreter the same way, right after that check.
The python_X_Y_host name is built in one small helper, so the new check
and _detect_interpreter look at the same thing.

To check it, I ran bazel query @bazel_pip_dev_deps//:all in a plain
checkout of Bazel master (rules_python 1.9.2, grpc 1.76.0) with and
without this change back-ported to 1.9.2, on windows-11-arm and
ubuntu-latest:

                 without   with
windows-arm64    rc=7      rc=0    3.9 and 3.10 skipped for grpc, protoc-gen-validate
                                   and rules_fuzzing
linux-x86_64     rc=0      rc=0    nothing new skipped

https://github.com/zakinko/NetBSD-i386/actions/runs/36248007899

With RULES_PYTHON_REPO_DEBUG_VERBOSITY=INFO the Windows run prints the
new message once for each of the six hub and version pairs, next to the
existing "no registered toolchain" one for rules_fuzzing's 3.8.

The new test in hub_builder_tests.bzl fails without the change with the
same error, and //tests/pypi/... passes with it (254 tests, on macOS).

A pip.parse whose python_version has a toolchain but no interpreter that
runs on the host fails the whole pip extension. That takes down every
other hub with it, including the root module's own, even when nothing
in the build uses the failing one.

This shows up on Windows ARM64. grpc, protoc-gen-validate and
rules_fuzzing each call pip.parse for Python 3.9 and 3.10, and there is
no CPython 3.9 or 3.10 build for aarch64-pc-windows-msvc, so evaluating
the extension fails with "Unable to find interpreter for pip hub
'grpc_python_dependencies' for python_version=3.9" before any of it is
needed.

A version missing from minor_mapping is already skipped with an info
message, leaving the hub's select to fail later only if that version is
actually used. Treat a version with no host interpreter the same way.
Rename the news fragment to match the PR number, use Sphinx MyST {obj} cross-references, avoid internal minor_mapping terminology, and append the issue link.
@rickeylev
rickeylev added this pull request to the merge queue Sep 27, 2026
@rickeylev
rickeylev removed this pull request from the merge queue due to a manual request Sep 27, 2026
@rickeylev
rickeylev added this pull request to the merge queue Sep 27, 2026
@rickeylev

Copy link
Copy Markdown
Collaborator

Thanks for the fix!

Merged via the queue into bazel-contrib:main with commit 9d36652 Sep 27, 2026
5 checks passed
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