From 7cf2df59288855396a1b3555740f2b0a0903c113 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Thu, 17 Oct 2024 15:44:56 -0700 Subject: [PATCH] Upgrade rules_java and remove experimental_google_legacy_api flag The upgrade of rules_java also upgrades error prone and this resulted in some additional errors reported in Protobuf's tests. Set the flag to report those as warning, but they should be cleaned up eventually. PiperOrigin-RevId: 687070204 --- .bazelrc | 5 ++--- MODULE.bazel | 2 +- ci/common.bazelrc | 5 ++--- examples/.bazelrc | 4 ---- protobuf_deps.bzl | 4 ++-- 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.bazelrc b/.bazelrc index 8389f346d690..9fffb304af2f 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,8 +1,7 @@ build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 -# Needed for java_lite_proto_library, that's using ProguardSpecProvider -# Once the provider is ported to Starlark the flag may be removed. -common --experimental_google_legacy_api +# TODO: ErrorProne's SelfAssertions are violated in protobuf's test +build --javacopt=-Xep:SelfAssertion:WARN build:dbg --compilation_mode=dbg diff --git a/MODULE.bazel b/MODULE.bazel index 0df17bbb3f8f..031d01cc7dcb 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -40,7 +40,7 @@ bazel_dep( bazel_dep( name = "rules_java", - version = "7.11.1", + version = "7.12.2", ) bazel_dep( diff --git a/ci/common.bazelrc b/ci/common.bazelrc index 9b58ac21c416..04f68fcbfaa5 100644 --- a/ci/common.bazelrc +++ b/ci/common.bazelrc @@ -1,6 +1,5 @@ -# Needed for java_lite_proto_library, that's using ProguardSpecProvider -# TODO: Once the provider is ported to Starlark the flag may be removed. -common --experimental_google_legacy_api +# TODO: ErrorProne's SelfAssertions are violated in tests +build --javacopt=-Xep:SelfAssertion:WARN build:dbg --compilation_mode=dbg diff --git a/examples/.bazelrc b/examples/.bazelrc index 2c2ccfdd8cbb..f37d75bc2112 100644 --- a/examples/.bazelrc +++ b/examples/.bazelrc @@ -1,9 +1,5 @@ common --enable_platform_specific_config -# Needed for java_lite_proto_library, that's using ProguardSpecProvider -# TODO: Once the provider is ported to Starlark the flag may be removed. -common --experimental_google_legacy_api - build:linux --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 build:macos --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl index bdedeef4cf23..7e9931271716 100644 --- a/protobuf_deps.bzl +++ b/protobuf_deps.bzl @@ -100,8 +100,8 @@ def protobuf_deps(): if not native.existing_rule("rules_java"): http_archive( name = "rules_java", - url = "https://github.com/bazelbuild/rules_java/releases/download/7.11.1/rules_java-7.11.1.tar.gz", - sha256 = "6f3ce0e9fba979a844faba2d60467843fbf5191d8ca61fa3d2ea17655b56bb8c", + url = "https://github.com/bazelbuild/rules_java/releases/download/7.12.2/rules_java-7.12.2.tar.gz", + sha256 = "a9690bc00c538246880d5c83c233e4deb83fe885f54c21bb445eb8116a180b83", ) if not native.existing_rule("rules_shell"):