-
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
Make Bazel itself depend on @rules_python
#9029
Comments
This replaces all direct uses of the native Python rules underneath the third_party/ directory with load()s of the internal wrapper macros. These macros are needed for compatibility with `--incompatible_load_python_rules_from_bzl`. Some of the uses are replaced by the file under the tools/ dir, which is already used elsewhere in Bazel. A few uses have to use a new @rules_python repo (see also bazelbuild#9029). Work toward bazelbuild#9006. RELNOTES: None
This replaces all direct uses of the native Python rules underneath the third_party/ directory with load()s of the internal wrapper macros. These macros are needed for compatibility with `--incompatible_load_python_rules_from_bzl`. Some of the uses are replaced by the file under the tools/ dir, which is already used elsewhere in Bazel. A few uses have to use a new @rules_python repo (see also bazelbuild#9029). Work toward bazelbuild#9006. RELNOTES: None
This replaces all direct uses of the native Python rules underneath the third_party/ directory with load()s of the internal wrapper macros. These macros are needed for compatibility with `--incompatible_load_python_rules_from_bzl`. Some of the uses are replaced by the file under the tools/ dir, which is already used elsewhere in Bazel. A few uses have to use a new @rules_python repo (see also bazelbuild#9029). Work toward bazelbuild#9006. RELNOTES: None
This replaces all direct uses of the native Python rules underneath the third_party/ directory with load()s of the internal wrapper macros. These macros are needed for compatibility with `--incompatible_load_python_rules_from_bzl`. Some of the uses are replaced by the file under the tools/ dir, which is already used elsewhere in Bazel. A few uses have to use a new @rules_python repo (see also #9029). Work toward #9006. RELNOTES: None
This replaces all direct uses of the native Python rules underneath the third_party/ directory with load()s of the internal wrapper macros. These macros are needed for compatibility with `--incompatible_load_python_rules_from_bzl`. Some of the uses are replaced by the file under the tools/ dir, which is already used elsewhere in Bazel. A few uses have to use a new @rules_python repo (see also #9029). Work toward #9006. RELNOTES: None
This replaces all direct uses of the native Python rules underneath the third_party/ directory with load()s of the internal wrapper macros. These macros are needed for compatibility with `--incompatible_load_python_rules_from_bzl`. Some of the uses are replaced by the file under the tools/ dir, which is already used elsewhere in Bazel. A few uses have to use a new @rules_python repo (see also bazelbuild#9029). Work toward bazelbuild#9006. RELNOTES: None
This replaces all direct uses of the native Python rules underneath the third_party/ directory with load()s of the internal wrapper macros. These macros are needed for compatibility with `--incompatible_load_python_rules_from_bzl`. Some of the uses are replaced by the file under the tools/ dir, which is already used elsewhere in Bazel. A few uses have to use a new @rules_python repo (see also bazelbuild#9029). Work toward bazelbuild#9006. RELNOTES: None
This replaces all direct uses of the native Python rules underneath the third_party/ directory with load()s of the internal wrapper macros. These macros are needed for compatibility with `--incompatible_load_python_rules_from_bzl`. Some of the uses are replaced by the file under the tools/ dir, which is already used elsewhere in Bazel. A few uses have to use a new @rules_python repo (see also #9029). Work toward #9006. Closes #9019. RELNOTES: None
Bumping this up. This is interfering with tests that depend on rules that, in turn, depend on rules_python behind a maybe(). I'm seeing errors like:
|
But maybe not. Still investigating. Bazel overall may have just been using an old version of the rules_pkg and getting the built-in rules. |
The error indicates that the offending target is underneath |
Yes. rules_pkg was behind. I pulled this into #11191 At first, I just update rules_pkg, which has this as its repositories rule:
My first attempt was to just update rules _pkg. That fails in an unexpected way
https://buildkite.com/bazel/google-bazel-presubmit/builds/33474#ff750ae9-44ae-4924-9ca4-7cba5da20462 The drilldown was not informative. The current version of the PR also tries to use real rules_pkg. That fails horribly, because protobufs don't build. :-( I don't have the cycles to deal with that problem. |
Proposed switch for python migration: #1120 |
Hi there! We're doing a clean up of old issues and will be closing this one. Please reopen if you’d like to discuss anything further. We’ll respond as soon as we have the bandwidth/resources to do so. |
Initial motivation was to use py_proto_library from rules_python, but then a yak came along. Fixes: bazelbuild#9029 Closes bazelbuild#17545. PiperOrigin-RevId: 513834100 Change-Id: I11a99381e1169a9fb7a7a3eaa733ddd348ebac2b
As part of the work for #9006, we're migrating Bazel's own use of native Python rules to load these rules from a bzl file. Ideally, the load statements should reference the macros in
@rules_python//python:defs.bzl
just like user code should. However, this isn't possible for the@bazel_tools
repository, which is not allowed to have any external dependencies. Therefore, we fake it by creating//tools/python:private/defs.bzl
, which implements the same magic@rules_python
does, for use by Bazel only.Of course, there are other uses of Python rules in Bazel's source tree besides those that appear in
@bazel_tools
. Currently some of these also reference the same//tools/python:private/defs.bzl
file, while others reference a stub@rules_python
repository (defined in Bazel's own WORKSPACE) that only contains a stub version of@rules_python//python:defs.bzl
; see #9019.This issue tracks potentially replacing the stub
@rules_python
with the real thing, and avoiding non-@bazel_tools
uses of the//tools/python:private/defs.bzl
path.Counterarguments for doing the former: The stub shouldn't be hard to keep in sync with the real rules_python, and using a stub avoids extra build overhead (and finagling with the WORKSPACE). Counterarguments for doing the latter: It's not particularly harmful to refer directly to the workspace-relative path, and it allows us to easily have a path that works both in
@io_bazel
and@bazel_tools
(in the case of thesix
dependency).The text was updated successfully, but these errors were encountered: