diff options
author | David Ostrovsky <david@ostrovsky.org> | 2023-10-17 09:47:35 +0200 |
---|---|---|
committer | David Ostrovsky <david@ostrovsky.org> | 2024-05-02 15:05:22 +0200 |
commit | 98f329e93791a49068adc0bc2f5c81234fe2d943 (patch) | |
tree | 525981d2c03892de7d96609728b88d467eafc0aa /tools | |
parent | 2b838b02dd9ce0c57da7973349e36228fb98caf4 (diff) | |
download | jgit-98f329e93791a49068adc0bc2f5c81234fe2d943.tar.gz jgit-98f329e93791a49068adc0bc2f5c81234fe2d943.zip |
Bazel: Add support for JDK 21
There are two failing tests when switching to JDK 21.
One failure is related to the changed behaviour related to the locale
providers. Adapt `GitDateFormatterTest` to changes in unicode [1].
Second failure related to changed behaviour in URL.openConnection(),
see: [2] for more details.
Before JDK 20, some of the parsing/validation performed by the JDK
built-in URLStreamHander implementations were delayed until
URL::openConnection or URLConnection::connect was called. Starting
JDK 20, some of these parsing/validations are now performed early,
i.e. within URL constructors.
IOW, the assumption made in HttpSupport.TesttestMalformedUri() isn't
met any more: providing mailformed URI to the URL ctor now throws an
exception starting with JDK 20. To rectify the problem, remove the
offending test.
Test plan:
To build with JDK 21 and run the tests locally:
$> bazel test --config=java21 //...
To build with JDK 21 and run the tests on RBE:
$> bazel test --config=remote21 --remote_instance_name=$PROJECT //...
[1] https://bugs.openjdk.org/browse/JDK-8304925
[2] https://bugs.openjdk.org/browse/JDK-8293590
Change-Id: I796de67f7945d5f1fa5e8146f4ec8cbe9ac7bd3e
Diffstat (limited to 'tools')
-rw-r--r-- | tools/BUILD | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/BUILD b/tools/BUILD index 2ad281e64a..c7ec638645 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -17,7 +17,7 @@ default_java_toolchain( default_java_toolchain( name = "error_prone_warnings_toolchain_java17", configuration = dict(), - java_runtime = "@bazel_tools//tools/jdk:remotejdk_17", + java_runtime = "@rules_java//toolchains:remotejdk_17", package_configuration = [ ":error_prone", ], @@ -26,6 +26,18 @@ default_java_toolchain( visibility = ["//visibility:public"], ) +default_java_toolchain( + name = "error_prone_warnings_toolchain_java21", + configuration = dict(), + java_runtime = "@rules_java//toolchains:remotejdk_21", + package_configuration = [ + ":error_prone", + ], + source_version = "21", + target_version = "21", + visibility = ["//visibility:public"], +) + # Error Prone errors enabled by default; see ../.bazelrc for how this is # enabled. This warnings list is originally based on: # https://github.com/bazelbuild/BUILD_file_generator/blob/master/tools/bazel_defs/java.bzl |