Skip to content

Commit 55b6ee6

Browse files
committed
Add missing rules_java stanza to WORKSPACE
Bazel 6.5.0 fails with (fixed in the next commit): ```txt $ bazel build //{src,jmh,test,third_party,scala_proto}/... [ ...snip... ] ERROR: test/src/main/resources/java_sources/BUILD:11:14: Building test/src/main/resources/java_sources/CompiledWithJava11_java.jar (1 source file) failed: Worker process did not return a WorkResponse: ---8<---8<--- Start of log, file at .../bazel-workers/multiplex-worker-33-Javac.log ---8<---8<--- Error thrown by worker thread, shutting down worker. java.lang.UnsupportedClassVersionError: com/google/errorprone/ErrorProneError has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0 at java.base/java.lang.ClassLoader.defineClass1(Native Method) [ ...snip... ] ERROR: test/src/main/resources/java_sources/BUILD:5:14: Building test/src/main/resources/java_sources/CompiledWithJava8_java.jar (1 source file) failed: Worker process did not return a WorkResponse: ---8<---8<--- Start of log, file at .../bazel-workers/multiplex-worker-33-Javac.log ---8<---8<--- Error thrown by worker thread, shutting down worker. java.lang.UnsupportedClassVersionError: com/google/errorprone/ErrorProneError has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0 at java.base/java.lang.ClassLoader.defineClass1(Native Method) [ ...snip... ] ``` Bazel 7.4.1 builds. Bazel 8.0.0rc6 fails as described in bazel-contrib#1652: ```txt $ USE_BAZEL_VERSION=8.0.0rc6 bazel build --enable_workspace \ //{src,jmh,test,third_party,scala_proto}/... ERROR: Traceback (most recent call last): File "scala/private/common_attributes.bzl", line 18, column 28, in <toplevel> "deps": attr.label_list( Error in label_list: Illegal argument: element in 'providers' is of unexpected type. Either all elements should be providers, or all elements should be lists of providers, but got list with an element of type NoneType. ERROR: Error computing the main repository mapping: at .../scala/scala.bzl:45:5: at .../scala/private/rules/scala_repl.bzl:5:5: initialization of module 'scala/private/common_attributes.bzl' failed ``` Bazel 8.0.0rc7 fails with a cyclic dependency error: ```txt **ERROR:** Failed to load Starlark extension '@@rules_java//toolchains:toolchain_utils.bzl'. Cycle in the workspace file detected. This indicates that a repository is used prior to being defined. The following chain of repository dependencies lead to the missing definition.  - @@rules_java ```
1 parent d35448f commit 55b6ee6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

WORKSPACE

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ load("//scala:scala.bzl", "scala_toolchains")
4343

4444
scala_toolchains(fetch_sources = True)
4545

46+
load(
47+
"@rules_java//java:repositories.bzl",
48+
"rules_java_dependencies",
49+
"rules_java_toolchains",
50+
)
51+
rules_java_dependencies()
52+
rules_java_toolchains()
53+
4654
register_toolchains(
4755
"//testing:testing_toolchain",
4856
"//scala:unused_dependency_checker_error_toolchain",

0 commit comments

Comments
 (0)