-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bazel 7 internally uses a too old version of rules_python #20315
Comments
The internally-used version is specified here: Line 11 in 8947322
The first version of that introduces py_proto_library is 0.17.0. See bazelbuild/rules_python@0d3c4f7. |
@bazel-io flag |
@bazel-io fork 7.0.0 |
Huh. bazel_tools loads rules_python? TIL. Oh I see, it looks like these are protos for Bazel's protocols? Ok, yeah that makes sense. In any case, yeah, this sounds like the version needs to be raised in MODULE.bazel |
@rickeylev Do you remember in which version hermetic python toolchain was introduced by default? I tried to upgrade rules_python in MODULE.tools in #20042 (comment), but the default hermetic python toolchain broke running our integration tests without network. I can try to upgprade to 0.17 and see if it works. |
And in the long term, I think users should not depend on anything in To workaround this issue, users can define a newer bazel version in their MODULE.bazel file ( |
What would the plan be for letting people access these protos?
The issue with that is it forces the repo to use bzlmod for rules_python, since this takes precedence over a WORKSPACE-defined rules_python. It's not the end of the world, but does make the migration more of a hassle. |
I think they should be published as a separate Bazel module in the BCR. Then Bazel or any other projects can depend on it, but it won't be a default dependency for every Bazel project. @comius @lberki WDYT?
I see, but in generally, you should not have two different rules_python in your dependency graph. It may cause incompatibility somewhere later. But in this case, maybe |
As https://buildkite.com/bazel/google-bazel-presubmit/builds/74291 shows, upgrading the default rules_python version in @cameron-martin @brentleyjones Are you fine with removing this issue as a release blocker since there is a workaround? So that we don't block Bazel 7 further and once we figure out a fix, we can backport it to 7.1. |
Sounds good to me. |
In our case we don't actually use any of the python-related rules from Using |
+1 for removing these protos from |
I have a pending change that updates to rules_python 0.22.0. For posterity:
Anyways, my point here is two fold:
|
Raise rules_python version to 0.22.0 so that py_proto_library is available. The py_proto_library rule was introduced in 0.17.0, but there's been a variety of fixes since then, so using a newer version is more advisable. Note: A difference between 0.4.0 and 0.22.0 is that 0.4.0 calls `register_toolchains("@bazel_tools//tools/python:autodetecting_toolchain")` to provide an extremely minimal, though incomplete, Python toolchain. 0.22.0 does not do that, and does not provide any Python toolchain by default. Fixes #20315 Commit 48eb023 PiperOrigin-RevId: 586758674 Change-Id: Ia479f4475d3bbbf048642470a3e33f272c2eba2e --------- Co-authored-by: Richard Levasseur <rlevasseur@google.com>
A fix for this issue has been included in Bazel 7.1.0 RC1. Please test out the release candidate and report any issues as soon as possible. Thanks! |
Description of the bug:
If no version of rules_python is specified via bzlmod, bazel internally uses the oldest version, 0.4.0. However, this version is too old to support some features used by
@bazel_tools
, causing this to error.Which category does this issue belong to?
No response
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
In a new directory:
This should then output an error:
Which operating system are you running Bazel on?
Ubuntu 22.04
What is the output of
bazel info release
?release 7.0.0rc4
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: