From 1a3aa80fcc5e1cea91ffd275b1d880fdaf80a8f6 Mon Sep 17 00:00:00 2001 From: Googler Date: Fri, 22 Nov 2024 08:05:38 -0800 Subject: [PATCH] Update `@rules_java` `v8.5.1` Fixes https://github.com/bazelbuild/bazel/issues/24455 Closes #24458. PiperOrigin-RevId: 699174983 Change-Id: Ib23a007cdb2ddc8fb5ae042c4bc2d10e9cd094e9 --- MODULE.bazel | 2 +- MODULE.bazel.lock | 8 ++++---- src/MODULE.tools | 2 +- src/main/starlark/docgen/BUILD | 1 + .../build/lib/analysis/util/AbstractMockJavaSupport.java | 9 +++++++++ src/test/tools/bzlmod/MODULE.bazel.lock | 8 ++++---- workspace_deps.bzl | 6 +++--- 7 files changed, 23 insertions(+), 13 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index ddba81bdc23d24..8fdba07e5f9df2 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -25,7 +25,7 @@ bazel_dep(name = "zstd-jni", version = "1.5.2-3.bcr.1") bazel_dep(name = "blake3", version = "1.5.1.bcr.1") bazel_dep(name = "zlib", version = "1.3.1.bcr.3") bazel_dep(name = "rules_cc", version = "0.0.17") -bazel_dep(name = "rules_java", version = "8.5.0") +bazel_dep(name = "rules_java", version = "8.5.1") bazel_dep(name = "rules_graalvm", version = "0.11.1") bazel_dep(name = "rules_proto", version = "7.0.2") bazel_dep(name = "rules_jvm_external", version = "6.0") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 7548e4f06427e6..3ece5d0cf89945 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -165,8 +165,8 @@ "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe", "https://bcr.bazel.build/modules/rules_java/7.6.5/MODULE.bazel": "481164be5e02e4cab6e77a36927683263be56b7e36fef918b458d7a8a1ebadb1", "https://bcr.bazel.build/modules/rules_java/8.3.2/MODULE.bazel": "7336d5511ad5af0b8615fdc7477535a2e4e723a357b6713af439fe8cf0195017", - "https://bcr.bazel.build/modules/rules_java/8.5.0/MODULE.bazel": "c081eda83625b6d97144f2da9dd5f074ecd56ba10f238257e7a90f56ee8a9c3c", - "https://bcr.bazel.build/modules/rules_java/8.5.0/source.json": "8aa0f3979d4c41e8575581e877eb2073a922c8f056fe74a67ca12eabf9e58715", + "https://bcr.bazel.build/modules/rules_java/8.5.1/MODULE.bazel": "d8a9e38cc5228881f7055a6079f6f7821a073df3744d441978e7a43e20226939", + "https://bcr.bazel.build/modules/rules_java/8.5.1/source.json": "db1a77d81b059e0f84985db67a22f3f579a529a86b7997605be3d214a0abe38e", "https://bcr.bazel.build/modules/rules_jvm_external/6.0/MODULE.bazel": "37c93a5a78d32e895d52f86a8d0416176e915daabd029ccb5594db422e87c495", "https://bcr.bazel.build/modules/rules_jvm_external/6.0/source.json": "73cc8818203a182e7374adf137f428d276190b2e2bef3022c231990cf0e594aa", "https://bcr.bazel.build/modules/rules_kotlin/1.9.0/MODULE.bazel": "ef85697305025e5a61f395d4eaede272a5393cee479ace6686dba707de804d59", @@ -1322,8 +1322,8 @@ }, "@@rules_java+//java:rules_java_deps.bzl%compatibility_proxy": { "general": { - "bzlTransitiveDigest": "lUVy7PIyFpaJ2wPiT8duNgICcHp6qxghhds+CZ5ViXI=", - "usagesDigest": "gTu8Srf8G7tL645OdQBCe0C/Rg1drH4YKoQ4L8eL3K4=", + "bzlTransitiveDigest": "KIX40nDfygEWbU+rq3nYpt3tVgTK/iO8PKh5VMBlN7M=", + "usagesDigest": "gM/FwIdP1Q+EdWC5GA5gZ4vG+2Aour7mNqKZU3J7RYM=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, diff --git a/src/MODULE.tools b/src/MODULE.tools index fab13653cc3fb4..105a153dae557f 100644 --- a/src/MODULE.tools +++ b/src/MODULE.tools @@ -39,7 +39,7 @@ use_repo(buildozer_binary, "buildozer_binary") # Dependencies used to auto-load removed symbols and rules from Bazel (due to Starlarkification) # See also: --incompatible_autoload_externally, AutoloadSymbols bazel_dep(name = "protobuf", version = "29.0-rc3", repo_name = "com_google_protobuf") -bazel_dep(name = "rules_java", version = "8.5.0") +bazel_dep(name = "rules_java", version = "8.5.1") bazel_dep(name = "rules_cc", version = "0.0.17") bazel_dep(name = "rules_python", version = "0.40.0") bazel_dep(name = "rules_shell", version = "0.2.0") diff --git a/src/main/starlark/docgen/BUILD b/src/main/starlark/docgen/BUILD index a637c0db81103f..a0b59baa92e490 100644 --- a/src/main/starlark/docgen/BUILD +++ b/src/main/starlark/docgen/BUILD @@ -17,6 +17,7 @@ starlark_doc_extract( "@com_google_protobuf//bazel/toolchains:proto_toolchain_bzl", "@rules_cc//cc/common", "@rules_cc//cc/toolchains:toolchain_rules", + "@rules_java//java/common:proguard_spec_info_bzl", "@rules_java//java/private:proto_support", ], ) diff --git a/src/test/java/com/google/devtools/build/lib/analysis/util/AbstractMockJavaSupport.java b/src/test/java/com/google/devtools/build/lib/analysis/util/AbstractMockJavaSupport.java index 2c20beff6164cb..432bedb33e33c4 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/util/AbstractMockJavaSupport.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/util/AbstractMockJavaSupport.java @@ -110,6 +110,15 @@ public void setupRulesJava( load("@rules_java//java/private:java_info.bzl", _JavaPluginInfo = "JavaPluginInfo") JavaPluginInfo = _JavaPluginInfo """); + config.overwrite( + "rules_java_workspace/java/private/proto_support.bzl", + """ +load("@rules_java//java/private:java_common.bzl", "java_common") +def compile(*, injecting_rule_kind, enable_jspecify, include_compilation_info, **kwargs): + return java_common.compile(**kwargs) +def merge(providers, *, merge_java_outputs = True, merge_source_jars = True): + return java_common.merge(providers) +"""); // mocks config.create("rules_java_workspace/toolchains/BUILD"); config.create( diff --git a/src/test/tools/bzlmod/MODULE.bazel.lock b/src/test/tools/bzlmod/MODULE.bazel.lock index 0ea69e78c03dd1..633cfc4fc8b751 100644 --- a/src/test/tools/bzlmod/MODULE.bazel.lock +++ b/src/test/tools/bzlmod/MODULE.bazel.lock @@ -87,8 +87,8 @@ "https://bcr.bazel.build/modules/rules_java/7.3.2/MODULE.bazel": "50dece891cfdf1741ea230d001aa9c14398062f2b7c066470accace78e412bc2", "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe", "https://bcr.bazel.build/modules/rules_java/8.3.2/MODULE.bazel": "7336d5511ad5af0b8615fdc7477535a2e4e723a357b6713af439fe8cf0195017", - "https://bcr.bazel.build/modules/rules_java/8.5.0/MODULE.bazel": "c081eda83625b6d97144f2da9dd5f074ecd56ba10f238257e7a90f56ee8a9c3c", - "https://bcr.bazel.build/modules/rules_java/8.5.0/source.json": "8aa0f3979d4c41e8575581e877eb2073a922c8f056fe74a67ca12eabf9e58715", + "https://bcr.bazel.build/modules/rules_java/8.5.1/MODULE.bazel": "d8a9e38cc5228881f7055a6079f6f7821a073df3744d441978e7a43e20226939", + "https://bcr.bazel.build/modules/rules_java/8.5.1/source.json": "db1a77d81b059e0f84985db67a22f3f579a529a86b7997605be3d214a0abe38e", "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", "https://bcr.bazel.build/modules/rules_jvm_external/5.1/MODULE.bazel": "33f6f999e03183f7d088c9be518a63467dfd0be94a11d0055fe2d210f89aa909", "https://bcr.bazel.build/modules/rules_jvm_external/5.2/MODULE.bazel": "d9351ba35217ad0de03816ef3ed63f89d411349353077348a45348b096615036", @@ -270,8 +270,8 @@ }, "@@rules_java+//java:rules_java_deps.bzl%compatibility_proxy": { "general": { - "bzlTransitiveDigest": "zi0g4MCRTtdxFR1jEVNAqwRGXNnndRScC15/9SvDd+o=", - "usagesDigest": "gTu8Srf8G7tL645OdQBCe0C/Rg1drH4YKoQ4L8eL3K4=", + "bzlTransitiveDigest": "sdM/EDgU7GAUVkvPMHTjZEsJWzl9n4KqCYYiDsnIwlw=", + "usagesDigest": "gM/FwIdP1Q+EdWC5GA5gZ4vG+2Aour7mNqKZU3J7RYM=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, diff --git a/workspace_deps.bzl b/workspace_deps.bzl index b9d2de6bd7f686..463d029859fb28 100644 --- a/workspace_deps.bzl +++ b/workspace_deps.bzl @@ -31,9 +31,9 @@ WORKSPACE_REPOS = { "strip_prefix": "protobuf-29.0-rc3", }, "rules_java": { - "archive": "rules_java-8.5.0.tar.gz", - "sha256": "5c215757b9a6c3dd5312a3cdc4896cef3f0c5b31db31baa8da0d988685d42ae4", - "urls": ["https://github.com/bazelbuild/rules_java/releases/download/8.5.0/rules_java-8.5.0.tar.gz"], + "archive": "rules_java-8.5.1.tar.gz", + "sha256": "1389206b2208c5f33a05dd96e51715b0855c480c082b7bb4889a8e07fcff536c", + "urls": ["https://github.com/bazelbuild/rules_java/releases/download/8.5.1/rules_java-8.5.1.tar.gz"], }, "bazel_skylib": { "archive": "bazel-skylib-1.6.1.tar.gz",