Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ build --enable_runfiles
build --flag_alias=pin_browsers=//common:pin_browsers
build --flag_alias=headless=//common:headless

# Set the default java toolchain
# Set the default java toolchain.
# When bumping these, also update java_runtime in //common/remote-build/java to match.
build --java_language_version=25
build --java_runtime_version=remotejdk_25
build --tool_java_language_version=25
build --tool_java_runtime_version=remotejdk_25

# Silence protobuf sun.misc.Unsafe warnings from the JDK 25 Java compile workers.
build --extra_toolchains=//common/remote-build/java:java-toolchain_definition

# We target java 11 by default
build --javacopt="--release 11"

Expand Down
23 changes: 23 additions & 0 deletions common/remote-build/java/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
load("@rules_java//toolchains:default_java_toolchain.bzl", "DEFAULT_TOOLCHAIN_CONFIGURATION", "default_java_toolchain")

package(default_visibility = ["//visibility:public"])

# Quiet protobuf's sun.misc.Unsafe warnings spammed by the JDK 25 compile workers.
_SILENCE_UNSAFE_WARNING = ["--sun-misc-unsafe-memory-access=allow"]

default_java_toolchain(
name = "java-toolchain",
configuration = DEFAULT_TOOLCHAIN_CONFIGURATION | {
"java_runtime": "@rules_java//toolchains:remotejdk_25",
"jvm_opts": DEFAULT_TOOLCHAIN_CONFIGURATION["jvm_opts"] + _SILENCE_UNSAFE_WARNING,
"turbine_jvm_opts": DEFAULT_TOOLCHAIN_CONFIGURATION["turbine_jvm_opts"] + _SILENCE_UNSAFE_WARNING,
},
toolchain_definition = False,
)

# No version target_setting, so it applies regardless of --java_language_version.
toolchain(
name = "java-toolchain_definition",
toolchain = ":java-toolchain",
toolchain_type = "@bazel_tools//tools/jdk:toolchain_type",
)
Loading