From 82ab01cf51add17ff070cdd858625069c158ad3e Mon Sep 17 00:00:00 2001 From: Farid Zakaria Date: Thu, 24 Apr 2025 14:41:00 -0700 Subject: [PATCH 1/2] Increase maxwarns to -1 Please see https://github.com/bazelbuild/bazel/issues/25927#issuecomment-2825206105 It's important not to filter out any warnings otherwise the lint warnings are not surfaced and then any attempt to do `-Werror` can fail with what may be observed as spurious (affect other parts of the codebase). This is maybe a "breaking change" only if someone has enabled `-Werror` and may now see additional errors -- although that was in fact their intention... --- toolchains/default_java_toolchain.bzl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/toolchains/default_java_toolchain.bzl b/toolchains/default_java_toolchain.bzl index 4ec8961a..aeb0b8ce 100644 --- a/toolchains/default_java_toolchain.bzl +++ b/toolchains/default_java_toolchain.bzl @@ -49,6 +49,10 @@ BASE_JDK9_JVM_OPTS = [ # makes it go to stderr instead. "-Xlog:disable", "-Xlog:all=warning:stderr:uptime,level,tags", + + # Please see https://github.com/bazelbuild/bazel/issues/25927#issuecomment-2825206105 + # we need to make sure not to filter any warnings so that Bazel can trigger them as errors. + "-Xmaxwarns -1", ] JDK9_JVM_OPTS = BASE_JDK9_JVM_OPTS From 6938d218c5d8c3640f9c1d98cbf48e55b7f2639d Mon Sep 17 00:00:00 2001 From: Farid Zakaria Date: Thu, 24 Apr 2025 14:50:38 -0700 Subject: [PATCH 2/2] Move to DEFAULT_JAVACOPTS --- toolchains/default_java_toolchain.bzl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/toolchains/default_java_toolchain.bzl b/toolchains/default_java_toolchain.bzl index aeb0b8ce..7e075cd9 100644 --- a/toolchains/default_java_toolchain.bzl +++ b/toolchains/default_java_toolchain.bzl @@ -49,10 +49,6 @@ BASE_JDK9_JVM_OPTS = [ # makes it go to stderr instead. "-Xlog:disable", "-Xlog:all=warning:stderr:uptime,level,tags", - - # Please see https://github.com/bazelbuild/bazel/issues/25927#issuecomment-2825206105 - # we need to make sure not to filter any warnings so that Bazel can trigger them as errors. - "-Xmaxwarns -1", ] JDK9_JVM_OPTS = BASE_JDK9_JVM_OPTS @@ -71,6 +67,9 @@ DEFAULT_JAVACOPTS = [ "-Xep:LenientFormatStringValidation:OFF", "-Xep:ReturnMissingNullable:OFF", "-Xep:UseCorrectAssertInTests:OFF", + # Please see https://github.com/bazelbuild/bazel/issues/25927#issuecomment-2825206105 + # we need to make sure not to filter any warnings so that Bazel can trigger them as errors. + "-Xmaxwarns -1", ] # If this is changed, the docs for "{,tool_}java_language_version" also