From 4dbcc7b64cdc5605a7cf9f5ed09a36e11c02e3e4 Mon Sep 17 00:00:00 2001 From: Mike Bland Date: Thu, 5 Dec 2024 13:27:29 -0500 Subject: [PATCH] Bump to `rules_java` 7.12.2 Bazel 6.5.0 builds. Bazel 7.4.1 fails with the same error mentioned in #1619. See the notes under "Bump to rules_java 7.9.0 for Bazel 7 compatibility" from commit cd22d8896f209c37be8622f1dcc9770c2dc18f48: ```txt $ USE_BAZEL_VERSION=7.4.1 bazel build \ //{src,jmh,test,third_party,scala_proto}/... ERROR: .../external/rules_java_builtin/toolchains/BUILD:254:14: While resolving toolchains for target @@rules_java_builtin//toolchains:platformclasspath (096dcc8): No matching toolchains found for types @@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type. ERROR: Analysis of target '//test/toolchains:java21_toolchain' failed; build aborted: Analysis failed ``` Bazel 8.0.0rc6 and 8.0.0rc7 fail as described in the previous commit. --- Without the `WORKSPACE` updates from earlier, Bazel 6.5.0 fails with a similar error to 7.4.1 with the `WORKSPACE` update: ```txt $ bazel build //{src,jmh,test,third_party,scala_proto}/... [ ...snip... ] ERROR: .../rules_java/toolchains/BUILD:285:14: While resolving toolchains for target @rules_java//toolchains:platformclasspath: No matching toolchains found for types @rules_java//toolchains:bootstrap_runtime_toolchain_type. ERROR: Analysis of target '//test:CheckBytecodeMajorVersion' failed; build aborted: ``` Bazel 7.4.1 fails with a different error: ```txt $ bazel build //{src,jmh,test,third_party,scala_proto}/... ERROR: .../external/remote_java_tools_darwin_arm64/BUILD: no such target '@@remote_java_tools_darwin_arm64//:prebuilt_one_version': target 'prebuilt_one_version' not declared in package '' defined by .../external/remote_java_tools_darwin_arm64/BUILD ERROR: .../external/rules_java/toolchains/BUILD:163:14: no such target '@@remote_java_tools_darwin_arm64//:prebuilt_one_version': target 'prebuilt_one_version' not declared in package '' defined by .../external/remote_java_tools_darwin_arm64/BUILD and referenced by '@@rules_java//toolchains:prebuilt_one_version_darwin_arm64' ERROR: Analysis of target '//test/src/main/resources/java_sources:CompiledWithJava8' failed; build aborted: Analysis failed ``` --- scala/private/macros/scala_repositories.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scala/private/macros/scala_repositories.bzl b/scala/private/macros/scala_repositories.bzl index 8e02640ef..3af5481b3 100644 --- a/scala/private/macros/scala_repositories.bzl +++ b/scala/private/macros/scala_repositories.bzl @@ -157,9 +157,9 @@ def load_rules_dependencies(): http_archive( name = "rules_java", urls = [ - "https://github.com/bazelbuild/rules_java/releases/download/7.9.0/rules_java-7.9.0.tar.gz", + "https://github.com/bazelbuild/rules_java/releases/download/7.12.2/rules_java-7.12.2.tar.gz", ], - sha256 = "41131de4417de70b9597e6ebd515168ed0ba843a325dc54a81b92d7af9a7b3ea", + sha256 = "a9690bc00c538246880d5c83c233e4deb83fe885f54c21bb445eb8116a180b83", ) if not native.existing_rule("rules_proto"):