Skip to content

Commit

Permalink
[6.2.0] Update java_tools v12.1 (bazelbuild#18197)
Browse files Browse the repository at this point in the history
* Separate prebuilt darwin java_tools for x86_64 and arm64

This is step 1 of bazelbuild#17780

Closes bazelbuild#17767.

PiperOrigin-RevId: 517115807
Change-Id: If2bb85a8a15fd126ab52e5738e3d9558da813090

* Update rules_java and remove references to "remote_java_tools_darwin"

This is the last step of bazelbuild#17780

This updates rules_java to v5.5.0 for bazel and bazel_tools and cleans up any remaining references to remote_java_tools_darwin,  remote_java_tools_test_darwin, and remote_java_tools_darwin_for_testing

Closes bazelbuild#17843.

PiperOrigin-RevId: 519059189
Change-Id: Ic04f3a2e5cc12e6b7731f6d8a3551553e172e000

* Update java_tools v12.1

bazelbuild/java_tools#69

Closes bazelbuild#18097.

PiperOrigin-RevId: 526116409
Change-Id: I4f31046d7e5b149c5035b0ede0699d74685a1eb8

---------

Co-authored-by: hvd <hvadehra@gmail.com>
  • Loading branch information
keertk and hvadehra authored Apr 24, 2023
1 parent bb37d0b commit e4682f6
Show file tree
Hide file tree
Showing 15 changed files with 113 additions and 47 deletions.
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ bazel_dep(name = "zlib", version = "1.2.13")

# The following are required when building without WORKSPACE SUFFIX
bazel_dep(name = "rules_cc", version = "0.0.2")
bazel_dep(name = "rules_java", version = "5.1.0")
bazel_dep(name = "rules_java", version = "5.5.0")
bazel_dep(name = "rules_proto", version = "4.0.0")

# TODO(pcloudy): Add remoteapis and googleapis as Bazel modules in the BCR.
Expand Down
18 changes: 16 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,14 @@ dist_http_archive(

# Used in src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE.
dist_http_archive(
name = "remote_java_tools_darwin_for_testing",
name = "remote_java_tools_darwin_x86_64_for_testing",
patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
)

# Used in src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE.
dist_http_archive(
name = "remote_java_tools_darwin_arm64_for_testing",
patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
)
Expand Down Expand Up @@ -545,7 +552,14 @@ dist_http_archive(

# Used in src/test/shell/bazel/testdata/jdk_http_archives.
dist_http_archive(
name = "remote_java_tools_test_darwin",
name = "remote_java_tools_test_darwin_x86_64",
patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
)

# Used in src/test/shell/bazel/testdata/jdk_http_archives.
dist_http_archive(
name = "remote_java_tools_test_darwin_arm64",
patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
)
Expand Down
62 changes: 39 additions & 23 deletions distdir_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -371,64 +371,80 @@ DIST_DEPS = {
"remote_java_tools_test",
"remote_java_tools_for_testing",
],
"archive": "java_tools-v11.12.zip",
"sha256": "af20366f926b1dadf8c084a51936116ef2f0db90e73e94b406c4ad8180f0788d",
"archive": "java_tools-v12.1.zip",
"sha256": "0db35ec44745fd15b77d9df954e70a4fcf74554dd5bfe3f6e6cb6bbdc1f1c649",
"urls": [
"https://mirror.bazel.build/bazel_java_tools/releases/java/v11.12/java_tools-v11.12.zip",
"https://github.com/bazelbuild/java_tools/releases/download/java_v11.12/java_tools-v11.12.zip",
"https://mirror.bazel.build/bazel_java_tools/releases/java/v12.1/java_tools-v12.1.zip",
"https://github.com/bazelbuild/java_tools/releases/download/java_v12.1/java_tools-v12.1.zip",
],
"used_in": [
"test_WORKSPACE_files",
],
"package_version": "11.12",
"package_version": "12.1",
},
"remote_java_tools_linux": {
"aliases": [
"remote_java_tools_test_linux",
"remote_java_tools_linux_for_testing",
],
"archive": "java_tools_linux-v11.12.zip",
"sha256": "37f79597f5b8c1501b9c66ded8ac68c61205ad39ef3ceda0e24fbd0afa3cd97f",
"archive": "java_tools_linux-v12.1.zip",
"sha256": "093ecac3b42fcbc3621d08edc3ae3c8b0bc2bf56a0d9a85ddcdb1e0bcf10cbc7",
"urls": [
"https://mirror.bazel.build/bazel_java_tools/releases/java/v11.12/java_tools_linux-v11.12.zip",
"https://github.com/bazelbuild/java_tools/releases/download/java_v11.12/java_tools_linux-v11.12.zip",
"https://mirror.bazel.build/bazel_java_tools/releases/java/v12.1/java_tools_linux-v12.1.zip",
"https://github.com/bazelbuild/java_tools/releases/download/java_v12.1/java_tools_linux-v12.1.zip",
],
"used_in": [
"test_WORKSPACE_files",
],
"package_version": "11.12",
"package_version": "12.1",
},
"remote_java_tools_windows": {
"aliases": [
"remote_java_tools_test_windows",
"remote_java_tools_windows_for_testing",
],
"archive": "java_tools_windows-v11.12.zip",
"sha256": "43432ce4814513d6497661b4fede691982b3bdef7a1907808b096291f56a8001",
"archive": "java_tools_windows-v12.1.zip",
"sha256": "1df7cc7fac54f437f43c24c019462e13058f394fdba5a64f566b92e8af18d0cf",
"urls": [
"https://mirror.bazel.build/bazel_java_tools/releases/java/v11.12/java_tools_windows-v11.12.zip",
"https://github.com/bazelbuild/java_tools/releases/download/java_v11.12/java_tools_windows-v11.12.zip",
"https://mirror.bazel.build/bazel_java_tools/releases/java/v12.1/java_tools_windows-v12.1.zip",
"https://github.com/bazelbuild/java_tools/releases/download/java_v12.1/java_tools_windows-v12.1.zip",
],
"used_in": [
"test_WORKSPACE_files",
],
"package_version": "11.12",
"package_version": "12.1",
},
"remote_java_tools_darwin": {
"remote_java_tools_darwin_x86_64": {
"aliases": [
"remote_java_tools_test_darwin",
"remote_java_tools_darwin_for_testing",
"remote_java_tools_test_darwin_x86_64",
"remote_java_tools_darwin_x86_64_for_testing",
],
"archive": "java_tools_darwin-v11.12.zip",
"sha256": "aed319892b638efabd08405b8f835770e13e2465d20459876c5f457f2b6426f3",
"archive": "java_tools_darwin_x86_64-v12.1.zip",
"sha256": "16ca145203a62a1fcd6ae50513c0935d938591cb309b9b1172e257c57873f60d",
"urls": [
"https://mirror.bazel.build/bazel_java_tools/releases/java/v11.12/java_tools_darwin-v11.12.zip",
"https://github.com/bazelbuild/java_tools/releases/download/java_v11.12/java_tools_darwin-v11.12.zip",
"https://mirror.bazel.build/bazel_java_tools/releases/java/v12.1/java_tools_darwin_x86_64-v12.1.zip",
"https://github.com/bazelbuild/java_tools/releases/download/java_v12.1/java_tools_darwin_x86_64-v12.1.zip",
],
"used_in": [
"test_WORKSPACE_files",
],
"package_version": "11.12",
"package_version": "12.1",
},
"remote_java_tools_darwin_arm64": {
"aliases": [
"remote_java_tools_test_darwin_arm64",
"remote_java_tools_darwin_arm64_for_testing",
],
"archive": "java_tools_darwin_arm64-v12.1.zip",
"sha256": "1d8e575e558782c2ceec0940e424f0e2df56b0df3d7fae68333eaceef2c4e41c",
"urls": [
"https://mirror.bazel.build/bazel_java_tools/releases/java/v12.1/java_tools_darwin_arm64-v12.1.zip",
"https://github.com/bazelbuild/java_tools/releases/download/java_v12.1/java_tools_darwin_arm64-v12.1.zip",
],
"used_in": [
"test_WORKSPACE_files",
],
"package_version": "12.1",
},
"remotejdk11_linux": {
"aliases": [
Expand Down
6 changes: 4 additions & 2 deletions src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -660,11 +660,13 @@ filegroup(
"@openjdk_macos_x86_64_minimal//file",
"@openjdk_win_minimal//file",
"@remote_coverage_tools//:WORKSPACE",
"@remote_java_tools_darwin_for_testing//:WORKSPACE",
"@remote_java_tools_darwin_x86_64_for_testing//:WORKSPACE",
"@remote_java_tools_darwin_arm64_for_testing//:WORKSPACE",
"@remote_java_tools_for_testing//:WORKSPACE",
"@remote_java_tools_linux_for_testing//:WORKSPACE",
"@remote_java_tools_test//:WORKSPACE",
"@remote_java_tools_test_darwin//:WORKSPACE",
"@remote_java_tools_test_darwin_x86_64//:WORKSPACE",
"@remote_java_tools_test_darwin_arm64//:WORKSPACE",
"@remote_java_tools_test_linux//:WORKSPACE",
"@remote_java_tools_test_windows//:WORKSPACE",
"@remote_java_tools_windows_for_testing//:WORKSPACE",
Expand Down
5 changes: 3 additions & 2 deletions src/MODULE.tools
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module(name = "bazel_tools")

bazel_dep(name = "rules_cc", version = "0.0.2")
bazel_dep(name = "rules_java", version = "5.3.5")
bazel_dep(name = "rules_java", version = "5.5.0")
bazel_dep(name = "rules_license", version = "0.0.3")
bazel_dep(name = "rules_proto", version = "4.0.0")
bazel_dep(name = "rules_python", version = "0.4.0")
Expand All @@ -24,7 +24,8 @@ use_repo(
"remote_java_tools",
"remote_java_tools_linux",
"remote_java_tools_windows",
"remote_java_tools_darwin",
"remote_java_tools_darwin_x86_64",
"remote_java_tools_darwin_arm64",
)

sh_configure_extension = use_extension("//tools/sh:sh_configure.bzl", "sh_configure_extension")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ gen_workspace_stanza(
"remote_java_tools",
"remote_java_tools_linux",
"remote_java_tools_windows",
"remote_java_tools_darwin",
"remote_java_tools_darwin_x86_64",
"remote_java_tools_darwin_arm64",
"rules_cc",
"rules_java",
"rules_proto",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,12 @@ maybe(

maybe(
http_archive,
{remote_java_tools_darwin}
{remote_java_tools_darwin_x86_64}
)

maybe(
http_archive,
{remote_java_tools_darwin_arm64}
)

maybe(
Expand Down
3 changes: 2 additions & 1 deletion src/test/py/bazel/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ class TestBase(unittest.TestCase):
'remotejdk18_win_for_testing',
'remotejdk18_win_arm64_for_testing',
'remote_java_tools_for_testing',
'remote_java_tools_darwin_for_testing',
'remote_java_tools_darwin_x86_64_for_testing',
'remote_java_tools_darwin_arm64_for_testing',
'remote_java_tools_linux_for_testing',
'remote_java_tools_windows_for_testing',
'remote_coverage_tools',
Expand Down
9 changes: 7 additions & 2 deletions src/test/shell/bazel/bazel_coverage_java_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ if [[ "${JAVA_TOOLS_PREBUILT_ZIP}" != "released" ]]; then
inplace-sed "/override_repository=remote_java_tools=/d" "$TEST_TMPDIR/bazelrc"
inplace-sed "/override_repository=remote_java_tools_linux=/d" "$TEST_TMPDIR/bazelrc"
inplace-sed "/override_repository=remote_java_tools_windows=/d" "$TEST_TMPDIR/bazelrc"
inplace-sed "/override_repository=remote_java_tools_darwin=/d" "$TEST_TMPDIR/bazelrc"
inplace-sed "/override_repository=remote_java_tools_darwin_x86_64=/d" "$TEST_TMPDIR/bazelrc"
inplace-sed "/override_repository=remote_java_tools_darwin_arm64=/d" "$TEST_TMPDIR/bazelrc"
fi
JAVA_TOOLS_PREBUILT_ZIP_FILE_URL=${JAVA_TOOLS_PREBUILT_ZIP_FILE_URL:-}

Expand Down Expand Up @@ -80,7 +81,11 @@ http_archive(
urls = ["${JAVA_TOOLS_PREBUILT_ZIP_FILE_URL}"]
)
http_archive(
name = "remote_java_tools_darwin",
name = "remote_java_tools_darwin_x86_64",
urls = ["${JAVA_TOOLS_PREBUILT_ZIP_FILE_URL}"]
)
http_archive(
name = "remote_java_tools_darwin_arm64",
urls = ["${JAVA_TOOLS_PREBUILT_ZIP_FILE_URL}"]
)
EOF
Expand Down
6 changes: 5 additions & 1 deletion src/test/shell/bazel/bazel_java17_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ http_archive(
urls = ["${JAVA_TOOLS_PREBUILT_ZIP_FILE_URL}"]
)
http_archive(
name = "remote_java_tools_darwin",
name = "remote_java_tools_darwin_x86_64",
urls = ["${JAVA_TOOLS_PREBUILT_ZIP_FILE_URL}"]
)
http_archive(
name = "remote_java_tools_darwin_arm64",
urls = ["${JAVA_TOOLS_PREBUILT_ZIP_FILE_URL}"]
)
EOF
Expand Down
9 changes: 7 additions & 2 deletions src/test/shell/bazel/bazel_java_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ if [[ "${JAVA_TOOLS_PREBUILT_ZIP}" != "released" ]]; then
inplace-sed "/override_repository=remote_java_tools=/d" "$TEST_TMPDIR/bazelrc"
inplace-sed "/override_repository=remote_java_tools_linux=/d" "$TEST_TMPDIR/bazelrc"
inplace-sed "/override_repository=remote_java_tools_windows=/d" "$TEST_TMPDIR/bazelrc"
inplace-sed "/override_repository=remote_java_tools_darwin=/d" "$TEST_TMPDIR/bazelrc"
inplace-sed "/override_repository=remote_java_tools_darwin_x86_64=/d" "$TEST_TMPDIR/bazelrc"
inplace-sed "/override_repository=remote_java_tools_darwin_arm64=/d" "$TEST_TMPDIR/bazelrc"
fi
JAVA_TOOLS_PREBUILT_ZIP_FILE_URL=${JAVA_TOOLS_PREBUILT_ZIP_FILE_URL:-}

Expand Down Expand Up @@ -129,7 +130,11 @@ http_archive(
urls = ["${JAVA_TOOLS_PREBUILT_ZIP_FILE_URL}"]
)
http_archive(
name = "remote_java_tools_darwin",
name = "remote_java_tools_darwin_x86_64",
urls = ["${JAVA_TOOLS_PREBUILT_ZIP_FILE_URL}"]
)
http_archive(
name = "remote_java_tools_darwin_arm64",
urls = ["${JAVA_TOOLS_PREBUILT_ZIP_FILE_URL}"]
)
EOF
Expand Down
3 changes: 2 additions & 1 deletion src/test/shell/bazel/testdata/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ gen_workspace_stanza(
"remote_java_tools_test",
"remote_java_tools_test_linux",
"remote_java_tools_test_windows",
"remote_java_tools_test_darwin",
"remote_java_tools_test_darwin_x86_64",
"remote_java_tools_test_darwin_arm64",
"openjdk11_linux_archive",
"openjdk11_darwin_archive",
"openjdk11_darwin_aarch64_archive",
Expand Down
6 changes: 5 additions & 1 deletion src/test/shell/bazel/testdata/jdk_http_archives.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ http_archive(
)

http_archive(
{remote_java_tools_test_darwin}
{remote_java_tools_test_darwin_x86_64}
)

http_archive(
{remote_java_tools_test_darwin_arm64}
)

#################################### JDK 11 ####################################
Expand Down
6 changes: 4 additions & 2 deletions src/test/shell/testenv.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,11 @@ EOF
"openjdk_win_minimal"
"remote_coverage_tools"
"remote_java_tools_for_testing"
"remote_java_tools_darwin_for_testing"
"remote_java_tools_darwin_x86_64_for_testing"
"remote_java_tools_darwin_arm64_for_testing"
"remote_java_tools_test"
"remote_java_tools_test_darwin"
"remote_java_tools_test_darwin_x86_64"
"remote_java_tools_test_darwin_arm64"
"remote_java_tools_test_linux"
"remote_java_tools_test_windows"
"remote_java_tools_linux_for_testing"
Expand Down
15 changes: 10 additions & 5 deletions tools/jdk/BUILD.tools
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ alias(
)
for OS in [
"linux",
"darwin",
"darwin_x86_64",
"darwin_arm64",
"windows",
]
]
Expand All @@ -163,7 +164,8 @@ alias(
name = "ijar_prebuilt_binary_or_cc_binary",
actual = select({
"//src/conditions:linux_x86_64": ":ijar_prebuilt_binary_linux",
"//src/conditions:darwin": ":ijar_prebuilt_binary_darwin",
"//src/conditions:darwin_x86_64": ":ijar_prebuilt_binary_darwin_x86_64",
"//src/conditions:darwin_arm64": ":ijar_prebuilt_binary_darwin_arm64",
"//src/conditions:windows": ":ijar_prebuilt_binary_windows",
"//conditions:default": "@remote_java_tools//:ijar_cc_binary",
}),
Expand All @@ -173,7 +175,8 @@ alias(
name = "ijar_prebuilt_binary",
actual = select({
"//src/conditions:linux_x86_64": ":ijar_prebuilt_binary_linux",
"//src/conditions:darwin": ":ijar_prebuilt_binary_darwin",
"//src/conditions:darwin_x86_64": ":ijar_prebuilt_binary_darwin_x86_64",
"//src/conditions:darwin_arm64": ":ijar_prebuilt_binary_darwin_arm64",
"//src/conditions:windows": ":ijar_prebuilt_binary_windows",
}),
)
Expand All @@ -193,7 +196,8 @@ alias(
name = "singlejar_prebuilt_or_cc_binary",
actual = select({
"//src/conditions:linux_x86_64": ":prebuilt_singlejar_linux",
"//src/conditions:darwin": ":prebuilt_singlejar_darwin",
"//src/conditions:darwin_x86_64": ":prebuilt_singlejar_darwin_x86_64",
"//src/conditions:darwin_arm64": ":prebuilt_singlejar_darwin_arm64",
"//src/conditions:windows": ":prebuilt_singlejar_windows",
"//conditions:default": "@remote_java_tools//:singlejar_cc_bin",
}),
Expand All @@ -203,7 +207,8 @@ alias(
name = "prebuilt_singlejar",
actual = select({
"//src/conditions:linux_x86_64": ":prebuilt_singlejar_linux",
"//src/conditions:darwin": ":prebuilt_singlejar_darwin",
"//src/conditions:darwin_x86_64": ":prebuilt_singlejar_darwin_x86_64",
"//src/conditions:darwin_arm64": ":prebuilt_singlejar_darwin_arm64",
"//src/conditions:windows": ":prebuilt_singlejar_windows",
}),
)
Expand Down

0 comments on commit e4682f6

Please sign in to comment.