Commit dfecb4e
committed
Add rules_python 0.37.2 for Bazel 7
Adding a newer `rules_python` to `rules_magic_deps` _before_
`rules_proto` fixes the missing `rules_python` file error from the
previous commit.
rules_python 0.37.2 is the last version that doesn't pull in its own
`protobuf`. `rules_python` 0.38.0 pulls in protobuf v27 unconditionally.
0.37.2 allows us to keep using rules_proto-5.3.0-21.7 for now.
Also, `rules_python` 0.40.0 and later require newer `rules_cc` versions
that may not play nice with `protobuf` v21.7. After we upgrade
`protobuf` to a more recent version, we can upgrade to more recent
`rules_python` version. For details:
- bazel-contrib/rules_scala#1660 (comment)
The build now produces the following failure:
```txt
ERROR: external/remote_java_tools_darwin_arm64/BUILD:
no such target
'@@remote_java_tools_darwin_arm64//:turbine_direct_graal':
target 'turbine_direct_graal' not declared in package ''
defined by external/remote_java_tools_darwin_arm64/BUILD
ERROR: external/rules_java_builtin/toolchains/BUILD:163:14:
no such target
'@@remote_java_tools_darwin_arm64//:turbine_direct_graal':
target 'turbine_direct_graal' not declared in package ''
defined by external/remote_java_tools_darwin_arm64/BUILD
and referenced by
'@@rules_java_builtin//toolchains:turbine_direct_graal_darwin_arm64'
ERROR: Analysis of target '//:default-values' failed; build aborted:
Analysis failed
```
Another `rules_java_builtin` and user-declared `rules_java` conflict due
to the legacy `WORKSPACE` model:
- `rules_java` 7.3.0 introduced the `turbine_direct_graal` target into its
`//toolchains` package via:
bazelbuild/rules_java#151: Use Turbine native image as
`header_compiler_direct`
bazelbuild/rules_java@d5b3ecf
- As noted in "Bump to Bazel 7.7.0", the legacy `WORKSPACE` prefix
creates `@rules_java_builtin`, which is actually `rules_java` 7.6.5.
This version depends on `remote_java_tools` v13.6.1, whose repos
contain `//:turbine_direct_graal`. Its `README.md` shows that it
comes from bazelbuild/bazel@40ec2cd.
https://github.com/bazelbuild/rules_java/blob/7.6.5/java/repositories.bzl#L25
https://github.com/bazelbuild/java_tools/releases/download/java_13.6.1/java_tools_darwin_arm64-v13.6.1.zip
https://github.com/bazelbuild/bazel/blob/40ec2cd1a15d73473945475552ad1d0cb6d77927/tools/jdk/BUILD.java_tools_prebuilt#L26-L32
- The legacy `bootcamp/WORKSPACE` file invokes `rules_java_dependencies`
from `rules_java` 6.5.2, instantiating `remote_java_tools` v12.6,
whose repos do _not_ contain `//:turbine_direct_graal`. It comes from
bazelbuild/bazel@bd91cb1.
https://github.com/bazelbuild/rules_java/blob/6.5.2/java/repositories.bzl#L31
https://github.com/bazelbuild/java_tools/releases/download/java_v12.6/java_tools_darwin_arm64-v12.6.zip
https://github.com/bazelbuild/bazel/blob/bd91cb131785a6693d45c7840a229d345e48d40b/tools/jdk/BUILD.java_tools_prebuilt
- The legacy `WORKSPACE` suffix invokes `rules_java_dependencies` from
`rules_java` 7.6.5. Since it wraps the `http_archive` repo rules
instantiating `remote_java_tools` repos with `maybe`, nothing happens,
because the repos already exist.
- The legacy `WORKSPACE` suffix then invokes `rules_java_toolchains`
from `rules_java` 7.6.5, which registers `//toolchains:all`.
- That version of the `//toolchains` package aliases
`"turbine_direct_graal_%s" % OS` to
`"@remote_java_tools_%s//:turbine_direct_graal" % OS`.
https://github.com/bazelbuild/rules_java/blob/7.6.5/toolchains/BUILD#L163-L166
- Since the `"@remote_java_tools_%s" % OS` repo doesn't contain a
`turbine_direct_graal` target, analysis of `//toolchains:all` breaks.
---
Another solution would've been to remove `rules_proto` as a dependency
and to rely directly upon `com_google_protobuf`. However, we'll keep
`rules_proto` for now to illustrate a different upgrade path prior to
depending on `com_google_protobuf` directly.1 parent 1077c13 commit dfecb4e
3 files changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
0 commit comments