Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate prebuilt darwin java_tools for x86_64 and arm64 #17767

Closed
wants to merge 1 commit into from
Closed
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
28 changes: 28 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 = """
Expand Down
23 changes: 21 additions & 2 deletions distdir_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 2 additions & 0 deletions src/test/py/bazel/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions src/test/shell/bazel/testdata/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 8 additions & 0 deletions src/test/shell/bazel/testdata/jdk_http_archives.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 4 additions & 0 deletions src/test/shell/testenv.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
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