Skip to content

Commit 2852b69

Browse files
committed
chore: update runtime JDK to 21.0.8
... from the rules_java provided JDK 21.0.6. This seems to be a pre-requesite for upgrading protobuf to > 26.0.
1 parent d8125c4 commit 2852b69

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed

MODULE.bazel

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,29 @@ REMOTE_JDK8 = [
420420
for jdk in REMOTE_JDK8
421421
]
422422

423+
# Use a more recent JDK 21 than is made available by rules_java.
424+
# This works around a test failure in the StressTest when updating protobuf to a
425+
# version > 26.0.
426+
# Remove after https://github.com/bazelbuild/rules_java/pull/328 has been merged/released.
427+
remote_jdk21_repos = use_extension("//third_party:jdk_21.bzl", "remote_jdk21_repos")
428+
429+
REMOTE_JDK21 = [
430+
"remote_jdk21_linux",
431+
"remote_jdk21_macos",
432+
"remote_jdk21_macos_aarch64",
433+
"remote_jdk21_windows",
434+
]
435+
436+
[
437+
use_repo(remote_jdk21_repos, "{}_toolchain_config_repo".format(jdk))
438+
for jdk in REMOTE_JDK21
439+
]
440+
441+
[
442+
register_toolchains("@{}_toolchain_config_repo//:all".format(jdk))
443+
for jdk in REMOTE_JDK21
444+
]
445+
423446
register_toolchains("//bazel/toolchains:kotlin_toolchain")
424447

425448
# Used in CI.

third_party/jdk_21.bzl

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#
2+
# Copyright 2024 Code Intelligence GmbH
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
load("@rules_java//toolchains:remote_java_repository.bzl", "remote_java_repository")
18+
19+
def _remote_jdk21_repos(_):
20+
remote_java_repository(
21+
name = "remote_jdk21_linux",
22+
target_compatible_with = [
23+
"@platforms//os:linux",
24+
"@platforms//cpu:x86_64",
25+
],
26+
sha256 = "63f56bbb46958cf57352fba08f2755e0953799195e5545acc0c8a92920beff1e",
27+
strip_prefix = "zulu21.44.17-ca-jdk21.0.8-linux_x64",
28+
urls = [
29+
"https://cdn.azul.com/zulu/bin/zulu21.44.17-ca-jdk21.0.8-linux_x64.tar.gz",
30+
],
31+
version = "21",
32+
)
33+
remote_java_repository(
34+
name = "remote_jdk21_linux_aarch64",
35+
target_compatible_with = [
36+
"@platforms//os:linux",
37+
"@platforms//cpu:aarch64",
38+
],
39+
sha256 = "ff7f2edd1d5c153cb6cb493a3aa3523453e29a05ec513b25c24aa1477ec0c722",
40+
strip_prefix = "zulu21.44.17-ca-jdk21.0.8-linux_aarch64",
41+
urls = [
42+
"https://cdn.azul.com/zulu/bin/zulu21.44.17-ca-jdk21.0.8-linux_aarch64.tar.gz",
43+
],
44+
version = "21",
45+
)
46+
remote_java_repository(
47+
name = "remote_jdk21_macos_aarch64",
48+
target_compatible_with = [
49+
"@platforms//os:macos",
50+
"@platforms//cpu:aarch64",
51+
],
52+
sha256 = "d22ce05fea3e3f28c8c59f2c348bc78ee967bf1289a4fb28796cc0177ff6c8db",
53+
strip_prefix = "zulu21.44.17-ca-jdk21.0.8-macosx_aarch64",
54+
urls = [
55+
"https://cdn.azul.com/zulu/bin/zulu21.44.17-ca-jdk21.0.8-macosx_aarch64.tar.gz",
56+
],
57+
version = "21",
58+
)
59+
remote_java_repository(
60+
name = "remote_jdk21_macos",
61+
target_compatible_with = [
62+
"@platforms//os:macos",
63+
"@platforms//cpu:x86_64",
64+
],
65+
sha256 = "2af080500b5cc286a6353187c7c59b5aafcb3edc29c1c87d1fd71ba2d6a523f1",
66+
strip_prefix = "zulu21.44.17-ca-jdk21.0.8-macosx_x64",
67+
urls = [
68+
"https://cdn.azul.com/zulu/bin/zulu21.44.17-ca-jdk21.0.8-macosx_x64.tar.gz",
69+
],
70+
version = "21",
71+
)
72+
remote_java_repository(
73+
name = "remote_jdk21_windows",
74+
target_compatible_with = [
75+
"@platforms//os:windows",
76+
"@platforms//cpu:x86_64",
77+
],
78+
sha256 = "f47dbd00384cb759f86a066be7545e467e5764f4653a237c32c07da96dc1c43b",
79+
strip_prefix = "zulu21.44.17-ca-jdk21.0.8-win_x64",
80+
urls = [
81+
"https://cdn.azul.com/zulu/bin/zulu21.44.17-ca-jdk21.0.8-win_x64.zip",
82+
],
83+
version = "21",
84+
)
85+
86+
remote_jdk21_repos = module_extension(_remote_jdk21_repos)

0 commit comments

Comments
 (0)