From 2ff18eebbf4f344b0033a0363fe354abac5984e2 Mon Sep 17 00:00:00 2001 From: Googler <cushon@google.com> Date: Mon, 12 Dec 2022 22:19:30 -0800 Subject: [PATCH 1/4] Disable 'IgnoredPureGetter' See https://github.com/bazelbuild/bazel/issues/16996 PiperOrigin-RevId: 494921387 Change-Id: I53dee7da0f321c50e303816b5fb85eda45949efa --- tools/jdk/default_java_toolchain.bzl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/jdk/default_java_toolchain.bzl b/tools/jdk/default_java_toolchain.bzl index c7d7642e0f7029..7736c2bb44efd6 100644 --- a/tools/jdk/default_java_toolchain.bzl +++ b/tools/jdk/default_java_toolchain.bzl @@ -49,6 +49,8 @@ DEFAULT_JAVACOPTS = [ "-parameters", # https://github.com/bazelbuild/bazel/issues/15219 "-Xep:ReturnValueIgnored:OFF", + # https://github.com/bazelbuild/bazel/issues/16996 + "-Xep:IgnoredPureGetter:OFF", "-Xep:EmptyTopLevelDeclaration:OFF", ] From 6d40ac297d55754751eb87f001bbf7105c02a360 Mon Sep 17 00:00:00 2001 From: Googler <noreply@google.com> Date: Tue, 17 Jan 2023 11:55:16 -0800 Subject: [PATCH 2/4] Make LenientFormatStringValidation a warning PiperOrigin-RevId: 502649182 Change-Id: Ia69e5be9da817d7c25e51cad5086309515bb280a --- tools/jdk/default_java_toolchain.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/jdk/default_java_toolchain.bzl b/tools/jdk/default_java_toolchain.bzl index 7736c2bb44efd6..b741faf81356f3 100644 --- a/tools/jdk/default_java_toolchain.bzl +++ b/tools/jdk/default_java_toolchain.bzl @@ -52,6 +52,7 @@ DEFAULT_JAVACOPTS = [ # https://github.com/bazelbuild/bazel/issues/16996 "-Xep:IgnoredPureGetter:OFF", "-Xep:EmptyTopLevelDeclaration:OFF", + "-Xep:LenientFormatStringValidation:OFF", ] # java_toolchain parameters without specifying javac, java.compiler, From 906baa20be8f135659e2f3e7788005015e58856f Mon Sep 17 00:00:00 2001 From: Googler <noreply@google.com> Date: Tue, 17 Jan 2023 15:49:19 -0800 Subject: [PATCH 3/4] Make ReturnMissingNullable a warning PiperOrigin-RevId: 502710013 Change-Id: I80f35a248623d293e187d481dc5ffbaff08bf25f --- tools/jdk/default_java_toolchain.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/jdk/default_java_toolchain.bzl b/tools/jdk/default_java_toolchain.bzl index b741faf81356f3..4ead06e5843e8e 100644 --- a/tools/jdk/default_java_toolchain.bzl +++ b/tools/jdk/default_java_toolchain.bzl @@ -53,6 +53,7 @@ DEFAULT_JAVACOPTS = [ "-Xep:IgnoredPureGetter:OFF", "-Xep:EmptyTopLevelDeclaration:OFF", "-Xep:LenientFormatStringValidation:OFF", + "-Xep:ReturnMissingNullable:OFF", ] # java_toolchain parameters without specifying javac, java.compiler, From 90811e33a6c278a9e42027909670a8f5070cbe38 Mon Sep 17 00:00:00 2001 From: Googler <larsrc@google.com> Date: Mon, 17 Apr 2023 06:05:41 -0700 Subject: [PATCH 4/4] Redirect JVM warnings to stderr in general. In particular this avoids problems with JVM warnings clashing with the worker protocol, but also matches Blaze's idea of where output goes better. PiperOrigin-RevId: 524826411 Change-Id: If4c78ac5f63dfd4596da924c12552f6335b8034d --- tools/jdk/default_java_toolchain.bzl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/jdk/default_java_toolchain.bzl b/tools/jdk/default_java_toolchain.bzl index 4ead06e5843e8e..0a3178358d9d47 100644 --- a/tools/jdk/default_java_toolchain.bzl +++ b/tools/jdk/default_java_toolchain.bzl @@ -38,6 +38,11 @@ BASE_JDK9_JVM_OPTS = [ # TODO(b/64485048): Disable this option in persistent worker mode only. # Disable symlinks resolution cache since symlinks in exec root change "-Dsun.io.useCanonCaches=false", + + # Since https://bugs.openjdk.org/browse/JDK-8153723, JVM logging goes to stdout. This + # makes it go to stderr instead. + "-Xlog:disable", + "-Xlog:all=warning:stderr:uptime,level,tags", ] JDK9_JVM_OPTS = BASE_JDK9_JVM_OPTS