Commit fb08327
authored
Fix last_green build after disable_autoloads flip (#1738)
* Fix last_green build after disable_autoloads flip
Explicitly loads all symbols affected by
`--incompatible_disable_autoloads_in_main_repo` to fix `last_green`
Bazel builds. Adds `rules_shell` as a dev dependency and updates files
to fix `test_bzlmod_macros.sh` and `test_dependency_versions.sh`.
As a result of using Buildifier to add the missing `load` statements,
Buildifier reordered the `load` statements as well.
Fixes the following breakage when using the `last_green` build from
bazelbuild/bazel@f08d561 (and other
breakages blocked by this one):
```sh
$ bazel run //tools:lint_check
ERROR: scala/private/rules/scala_test.bzl:130:21:
name 'JavaInfo' is not defined
ERROR: .../external/+dev_deps+com_github_bazelbuild_buildtools/buildifier/BUILD.bazel:3:10:
While resolving toolchains for target
@@+dev_deps+com_github_bazelbuild_buildtools//buildifier:buildifier
(b5bbebe): invalid registered toolchain
'//test/proto:scalapb_toolchain':
error loading package 'test/proto':
at /Users/mbland/src/bazel-contrib/rules_scala/scala/scala.bzl:35:5:
compilation of module 'scala/private/rules/scala_test.bzl' failed
ERROR: Analysis of target '//tools:lint_check' failed; build aborted:
Analysis failed
```
Fixed using Buildifier 8.2.0 by first running the following to get the
list of appropriate warnings:
```txt
buildifier --lint=warn -r . 2>&1 | grep -- native- |
awk '{print $2}' | sort | uniq
```
then running:
```txt
buildifier --lint=fix \
--warnings=native-java-common,native-java-info,native-sh-test,native-sh-binary \
-r .
```
I also ran it separately on the changed files in `deps/test` and
`scala/private/macros/test`, since Buildifier didn't automatically find
them.
---
bazelbuild/bazel@d87eaf5 from
2025-05-08 at 8:03am EDT flipped
`--incompatible_disable_autoloads_in_main_repo` to `true` to prepare for
Bazel 9. I did confirm that setting
`--noincompatible_disable_autoloads_in_main_repo` resolved the breakage
before using Buildifier to add the necessary `load` statements.
Pull request #1735 was the last to pass the `last_green` CI build using
bazelbuild/bazel@94e0b44 from
2025-05-08 at 7:39am EDT. This was two commits before the commit that
flipped `--incompatible_disable_autoloads_in_main_repo`:
- https://buildkite.com/bazel/rules-scala-scala/builds/5596#0196afc2-4af3-4202-8232-d5f5fe113349
Pull request #1736 failed the `last_green` CI build using
bazelbuild/bazel@cac54c4 from
2025-05-09 at 6:14am EDT. That job ran on 2025-05-09 at 6:47am EDT. The
`last_green` configuration in `.bazelci/presubmit.yml` emits a warning
if the build fails. This warning was present on the build page, but
we've overlooked it until now:
- https://buildkite.com/bazel/rules-scala-scala/builds/5598#0196b4a8-e593-431a-ab4c-8d8471d9b08b
Part of this change copies more files from `test/jmh` into the
`test_dependency_versions.sh` test directory. It also replicates targets
from `//test/jmh` in `deps/test/BUILD.bazel.test` to replace
the previous dependency on `@rules_scala//test/jmh:add_numbers`.
This is because `//test/jmh` now has a `load` dependency on
`@rules_shell`, which is a `dev_dependency` of `@rules_scala`. Since
`@rules_shell` isn't visible to `@rules_scala` when it isn't the root
module, this broke the build within `test_dependency_versions.sh`.
* Bump Buildkite to resolve transient error
The following build experienced this seemingly transient error in
`./test_coverage on macOS` (all other jobs in the same build passed):
- https://buildkite.com/bazel/rules-scala-scala/builds/5608#0196dfd9-3da9-4fbd-b284-e63e849f9d0a/89-128
```txt
WARNING: Download from
https://github.com/protocolbuffers/protobuf/releases/download/v30.2/protoc-30.2-osx-x86_64.zip
failed: class java.io.IOException GET returned 500 Internal Server Error
```1 parent 9f9883e commit fb08327
File tree
88 files changed
+225
-109
lines changed- deps/test
- examples/semanticdb
- jmh
- toolchain
- manual_test
- scala_test_jacocorunner
- scala_test_jvm_flags
- scalac_jvm_opts
- protoc/private
- scala_proto
- default
- private
- scala
- extensions
- private
- extensions
- macros
- test
- phases
- rules
- toolchain_deps
- scalafmt
- toolchain
- test_expect_failure
- diagnostics_reporter
- missing_direct_deps
- internal_deps
- scala_proto_deps
- scala_test_jacocorunner
- scala_test_jvm_flags
- scalac_jvm_opts
- scalacopts_from_toolchain
- scaladoc
- unused_dependency_checker
- test_version
- test_reporter
- version_specific_tests_dir
- src/main/scala/scalarules/test/twitter_scrooge
- twitter_scrooge
- testing
- toolchain
- test
- aspect
- diagnostics_reporter
- jmh
- proto3
- proto
- custom_generator
- semanticdb
- src/main/scala/scalarules/test
- scala_import
- nl
- srcjars
- twitter_scrooge
- toolchains
- third_party
- dependency_analyzer/src/test
- repositories
- twitter_scrooge
- toolchain
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
88 files changed
+225
-109
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| 305 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
92 | 119 | | |
93 | 120 | | |
94 | 121 | | |
95 | 122 | | |
96 | | - | |
| 123 | + | |
97 | 124 | | |
98 | 125 | | |
99 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments