Commit 0aa4795
authored
Fix last_green w/bazel_worker_api rules_java 8.15 (#1756)
* Fix last_green w/bazel_worker_java rules_java 8.15
Uses the `bazel_worker_java` module and a legacy `WORKSPACE` shim to
replace `@bazel_tools//src/main/protobuf:worker_protocol_java_proto`.
This, and bumping `rules_java` to 8.14.0, fixes breakages in the latest
`last_green` Bazel from commit 00b48b27aa216befc419e540919a1f1df4cda337.
Note, though, that this change bumps `rules_java` to 8.15.0, since it's
now available. This change also updates:
- `gazelle`: 0.44.0 => 0.45.0
- `rules_go`: 0.55.1 => 0.56.1
- `rules_shell`: 0.5.0 => 0.5.1
Also:
- Removes the `--incompatible_autoload_externally` flag from `.bazelrc`.
- Removes the Bazel 9.0.0-pre.20250710.1 CI job added by #1755, since
it's no longer necessary given the fix from this change.
- Fixes `_get_compiler_srcjar` to return empty `compiler_srcjar_objects`
instead of returning a valid object. `test_compiler_srcjar_error
2.12.11` from `dt_patches/dt_patch_test.sh` caught this under
`WORKSPACE`. Added `test_fail_if_compiler_srcjar_object_is_empty` to
`test/shell/test_compiler_sources_integrity.sh` to catch the specific
problem sooner.
- Fixed regex in `target_file_location` from `test_helper.sh` to work
with Bazel 6.5.0, and fixed unbound variable in `fail` message.
- Added logic to `teardown_suite` in `test_bzlmod_macros.sh` to avoid
unbound variable breakage when running under Bazel 6.5.0.
- Added logic to skip `test_check_module_bazel_template` under Bazel 6
in `test_version.sh`.
- Removed restriction to use `protobuf` v29 or lower with Bazel 6 from
`README.md`.
- Added `scala_compiler_source.*` to the regular expressions for "canonical
reproducible" messages in `dt_patches/dt_patch_test.sh`. This resolved
a test breakage when `rules_python` began to emit a "canonical
reproducible" message. (Also changed `--expunge` to
`--expunge_async`.)
---
bazelbuild/bazel#26477, which also landed in the 9.0.0-pre.20250714.1
rolling release, broke the `last_green` build:
```
$ USE_BAZEL_VERSION=9.0.0-pre.20250714.1 bazel test //src/... //test/...
ERROR: error loading package '@@bazel_tools//src/main/protobuf':
Unable to find package for
@@[unknown repo 'grpc-java' requested from @@bazel_tools]//:java_grpc_library.bzl:
The repository '@@[unknown repo 'grpc-java' requested from @@bazel_tools]'
could not be resolved:
No repository visible as '@grpc-java' from repository '@@bazel_tools'.
```
The failing target, and several others, depended upon
`@bazel_tools//src/main/protobuf:worker_protocol_java_proto`. Nothing
else depends on any other target from that package. So upon @Wyverald's
advice, I attempted to use the `bazel_worker_java` module to replace
this specific dependency:
- bazelbuild/bazel#26579 (comment)
The next failure was due to `rules_scala` overriding `rules_java` to be
8.12.0, whereas `last_green` now requires 8.14.0:
```txt
$ USE_BAZEL_VERSION=last_green bazel build //src/... //test/...
ERROR: src/java/io/bazel/rulesscala/jar/BUILD:3:13:
in java_library rule //src/java/io/bazel/rulesscala/jar:jar:
Traceback (most recent call last):
File ".../external/rules_java+/java/bazel/rules/bazel_java_library.bzl",
line 26, column 35, in _proxy
return bazel_java_library_rule(
File ".../external/rules_java+/java/common/rules/impl/bazel_java_library_impl.bzl",
line 68, column 43, in bazel_java_library_rule
target, base_info = basic_java_library(
File ".../external/rules_java+/java/common/rules/impl/basic_java_library_impl.bzl",
line 127, column 49, in basic_java_library
java_info, compilation_info = compile_action(
File ".../external/rules_java+/java/common/rules/impl/compile_action.bzl",
line 139, column 46, in compile_action
java_info = _compile_private_for_builtins(
File ".../external/rules_java+/java/private/java_common_internal.bzl",
line 217, column 68, in compile
get_internal_java_common().create_header_compilation_action(
Error in create_header_compilation_action:
create_header_compilation_action() missing 2 required positional
arguments: header_compilation_jar, header_compilation_direct_deps
ERROR: src/java/io/bazel/rulesscala/jar/BUILD:3:13:
Analysis of target '//src/java/io/bazel/rulesscala/jar:jar' failed
```
Bumping `rules_java` to 8.14.0 in the `single_version_override` fixed
that.
Finally, since there's no legacy `WORKSPACE` API in
bazelbuild/bazel-worker-api, I had to roll my own new
`workspace_compat()` macro. This macro creates
`@bazel_worker_{api,java}` repos from the `bazel-worker-api` archive
using @Wyverald's `http_archive` and `strip_prefix` suggestion
from #1756.
Regarding `--incompatible_autoload_externally`, I'd added it in #1748
when fixing problems with `WORKSPACE` builds under Bazel 8.2.1. However,
it's not really necessary, so I removed it.
* Update Maven artifact versions
- Scalafmt: 3.9.8 => 3.9.9
- `grpc`: 1.73.0 => 1.74.0
- `proto-google-common-protos`: 2.59.2 => 2.60.0
- `sbt-util-interface`: 1.11.3 => 1.11.41 parent f7bacdf commit 0aa4795
File tree
33 files changed
+445
-430
lines changed- .bazelci
- deps/latest
- dt_patches
- scala
- private/macros
- test
- scripts
- src/java/io/bazel/rulesscala
- coverage/instrumenter
- scalac
- worker
- test_cross_build/scalafmt
- test_version
- test
- scalafmt
- shell
- third_party/repositories
33 files changed
+445
-430
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | 40 | | |
51 | 41 | | |
52 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
254 | 256 | | |
255 | 257 | | |
256 | 258 | | |
257 | | - | |
| 259 | + | |
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
261 | | - | |
| 263 | + | |
262 | 264 | | |
263 | 265 | | |
264 | 266 | | |
| |||
284 | 286 | | |
285 | 287 | | |
286 | 288 | | |
287 | | - | |
| 289 | + | |
288 | 290 | | |
289 | 291 | | |
290 | 292 | | |
| |||
302 | 304 | | |
303 | 305 | | |
304 | 306 | | |
305 | | - | |
| 307 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1318 | 1318 | | |
1319 | 1319 | | |
1320 | 1320 | | |
1321 | | - | |
| 1321 | + | |
1322 | 1322 | | |
1323 | 1323 | | |
1324 | 1324 | | |
1325 | 1325 | | |
1326 | | - | |
1327 | | - | |
1328 | | - | |
1329 | | - | |
1330 | | - | |
1331 | | - | |
1332 | | - | |
1333 | | - | |
1334 | | - | |
1335 | | - | |
1336 | | - | |
1337 | | - | |
1338 | | - | |
1339 | | - | |
1340 | | - | |
1341 | | - | |
1342 | | - | |
1343 | | - | |
1344 | | - | |
1345 | | - | |
1346 | | - | |
1347 | | - | |
1348 | | - | |
1349 | | - | |
1350 | | - | |
| 1326 | + | |
1351 | 1327 | | |
1352 | 1328 | | |
1353 | 1329 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | | - | |
111 | | - | |
| 110 | + | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| 68 | + | |
| 69 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
| 33 | + | |
33 | 34 | | |
34 | | - | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
| 76 | + | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
88 | | - | |
89 | | - | |
90 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
91 | 93 | | |
| 94 | + | |
| 95 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
0 commit comments