diff --git a/WORKSPACE b/WORKSPACE index 15559ce235222f..2902e2483b25dc 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -435,6 +435,20 @@ dist_http_archive( 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_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, +) + # Used in src/test/shell/bazel/testdata/jdk_http_archives. dist_http_archive( name = "remote_java_tools_test", @@ -463,6 +477,20 @@ dist_http_archive( 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_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, +) + dist_http_archive( name = "openjdk11_linux_archive", build_file_content = """ diff --git a/distdir_deps.bzl b/distdir_deps.bzl index 06e80b515b990a..02ba4e36659be1 100644 --- a/distdir_deps.bzl +++ b/distdir_deps.bzl @@ -434,12 +434,31 @@ DIST_DEPS = { ], "package_version": "11.12", }, - "remote_java_tools_darwin": { + "remote_java_tools_darwin_x86_64": { "aliases": [ + "remote_java_tools_darwin", "remote_java_tools_test_darwin", + "remote_java_tools_test_darwin_x86_64", "remote_java_tools_darwin_for_testing", + "remote_java_tools_darwin_x86_64_for_testing", ], - "archive": "java_tools_darwin-v11.12.zip", + "archive": "java_tools_darwin_x86_64-v11.12.zip", + "sha256": "aed319892b638efabd08405b8f835770e13e2465d20459876c5f457f2b6426f3", + "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", + ], + "used_in": [ + "test_WORKSPACE_files", + ], + "package_version": "11.12", + }, + "remote_java_tools_darwin_arm64": { + "aliases": [ + "remote_java_tools_test_darwin_arm64", + "remote_java_tools_darwin_arm64_for_testing", + ], + "archive": "java_tools_darwin_arm64-v11.12.zip", "sha256": "aed319892b638efabd08405b8f835770e13e2465d20459876c5f457f2b6426f3", "urls": [ "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.12/java_tools_darwin-v11.12.zip", diff --git a/src/BUILD b/src/BUILD index 6350c2780ab744..a8b9e4dd29eb20 100644 --- a/src/BUILD +++ b/src/BUILD @@ -566,10 +566,14 @@ filegroup( "@com_google_protobuf//:WORKSPACE", "@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", diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BUILD b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BUILD index cdd94cb5fba6d9..654f1dc2f84e02 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BUILD +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BUILD @@ -93,6 +93,8 @@ gen_workspace_stanza( "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", diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE.tmpl b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE.tmpl index 29bd3a80af5033..65ae7a39e281ac 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE.tmpl +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE.tmpl @@ -267,6 +267,16 @@ maybe( {remote_java_tools_darwin} ) +maybe( + http_archive, +{remote_java_tools_darwin_x86_64} +) + +maybe( + http_archive, +{remote_java_tools_darwin_arm64} +) + maybe( http_archive, {rules_java} diff --git a/src/test/py/bazel/test_base.py b/src/test/py/bazel/test_base.py index d0057a1fa25e4d..a183c9d8b184ab 100644 --- a/src/test/py/bazel/test_base.py +++ b/src/test/py/bazel/test_base.py @@ -80,6 +80,8 @@ class TestBase(unittest.TestCase): 'remotejdk19_win_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', diff --git a/src/test/shell/bazel/testdata/BUILD b/src/test/shell/bazel/testdata/BUILD index a36a9e5cc2d386..9d79c9b8669233 100644 --- a/src/test/shell/bazel/testdata/BUILD +++ b/src/test/shell/bazel/testdata/BUILD @@ -50,6 +50,8 @@ gen_workspace_stanza( "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_linux_s390x_archive", "openjdk11_darwin_archive", diff --git a/src/test/shell/bazel/testdata/jdk_http_archives.tmpl b/src/test/shell/bazel/testdata/jdk_http_archives.tmpl index 11a38bb435fe61..9d390b3b6baa94 100644 --- a/src/test/shell/bazel/testdata/jdk_http_archives.tmpl +++ b/src/test/shell/bazel/testdata/jdk_http_archives.tmpl @@ -15,6 +15,14 @@ http_archive( {remote_java_tools_test_darwin} ) +http_archive( + {remote_java_tools_test_darwin_x86_64} +) + +http_archive( + {remote_java_tools_test_darwin_arm64} +) + #################################### JDK 11 #################################### # This must be kept in sync with the top-level WORKSPACE file. http_archive( diff --git a/src/test/shell/testenv.sh.tmpl b/src/test/shell/testenv.sh.tmpl index 1677d338e8233a..118be84448168b 100755 --- a/src/test/shell/testenv.sh.tmpl +++ b/src/test/shell/testenv.sh.tmpl @@ -296,8 +296,12 @@ EOF "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" diff --git a/tools/jdk/BUILD.tools b/tools/jdk/BUILD.tools index 5dc0d6c17da84d..4802a9103f5cac 100644 --- a/tools/jdk/BUILD.tools +++ b/tools/jdk/BUILD.tools @@ -146,7 +146,8 @@ alias( ) for OS in [ "linux", - "darwin", + "darwin_x86_64", + "darwin_arm64", "windows", ] ] @@ -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", }), @@ -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", }), ) @@ -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", }), @@ -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", }), )