Building with `bazel>=9.0.0` needs `pip` hub for each Python version
Try to build with bazel last_rc (currently 9.0.0rc1)
Used pip extension with: for version in ("3.10", "3.11", "3.12", "3.13")
ERROR: /data/user/.cache/587b883489018fe3ed627bf1f5976039/external/rules_python+/python/private/pypi/extension.bzl:172:17: Traceback (most recent call last):
File "/data/user/.cache/587b883489018fe3ed627bf1f5976039/external/rules_python+/python/private/pypi/extension.bzl", line 873, column 25, in _pip_impl
mods = parse_modules(module_ctx, enable_pipstar = rp_config.enable_pipstar)
File "/data/user/.cache/587b883489018fe3ed627bf1f5976039/external/rules_python+/python/private/pypi/extension.bzl", line 723, column 36, in parse_modules
out = _create_whl_repos(
File "/data/user/.cache/587b883489018fe3ed627bf1f5976039/external/rules_python+/python/private/pypi/extension.bzl", line 172, column 17, in _create_whl_repos
fail((
Error in fail: Unable to find interpreter for pip hub 'pre-commit-3.10' for python_version=3.10: Make sure a corresponding `python.toolchain(python_version="3.10")` call exists.Expected to find python_3_10_host among registered versions:
python_3_11_host
python_3_13_host
ERROR: error evaluating module extension @@rules_python+//python/extensions:pip.bzl%pip
<root> (pre-commit@_)
ERROR: Results may be incomplete as 1 extension failed.
Fetching module extension @@rules_python+//python/extensions:pip.bzl%pip; starting
There are only:
-
python_3_11_host- registered byrules_python -
python_3_13_host- registered by module itself
To make it work need to add:
python.toolchain(
# TODO: remove this when `ignore_root_user_error` is hermetic
# https://github.com/bazelbuild/rules_python/issues/2016
ignore_root_user_error = True,
python_version = "3.10",
)
python.toolchain(
# TODO: remove this when `ignore_root_user_error` is hermetic
# https://github.com/bazelbuild/rules_python/issues/2016
ignore_root_user_error = True,
python_version = "3.12",
)