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

Add embedded jdk support for ppc64le #11436

Closed
wants to merge 5 commits 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
24 changes: 24 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,16 @@ http_file(
urls = ["https://mirror.bazel.build/openjdk/azul-zulu11.37.48-ca-jdk11.0.6/zulu11.37.48-ca-jdk11.0.6-linux_aarch64-minimal-b23d4e05466f2aa1fdcd72d3d3a8e962206b64bf-1581690750.tar.gz"],
)

http_file(
name = "openjdk_linux_ppc64le_vanilla",
downloaded_file_path="adoptopenjdk-ppc64le-vanilla.tar.gz",
sha256 = "a417db0295b1f4b538ecbaf7c774f3a177fab9657a665940170936c0eca4e71a",
urls = [
jayfurmanek marked this conversation as resolved.
Show resolved Hide resolved
"https://mirror.bazel.build/openjdk/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.7%2B10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.7_10.tar.gz",
"/~https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.7%2B10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.7_10.tar.gz",
],
)

http_file(
name = "openjdk_macos",
downloaded_file_path = "zulu-macos.tar.gz",
Expand Down Expand Up @@ -681,6 +691,20 @@ http_archive(
urls = ["https://mirror.bazel.build/openjdk/azul-zulu11.37.48-ca-jdk11.0.6/zulu11.37.48-ca-jdk11.0.6-linux_aarch64.tar.gz"],
)

# This must be kept in sync with src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE.
http_archive(
name = "remotejdk11_linux_ppc64le_for_testing",
build_file = "@local_jdk//:BUILD.bazel",
patch_cmds = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE,
patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_BAZEL_FILE_WIN,
sha256 = "a417db0295b1f4b538ecbaf7c774f3a177fab9657a665940170936c0eca4e71a",
strip_prefix = "jdk-11.0.7+10",
urls = [
"https://mirror.bazel.build/openjdk/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.7%2B10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.7_10.tar.gz",
"/~https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.7%2B10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.7_10.tar.gz",
],
)

# This must be kept in sync with src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE.
http_archive(
name = "remotejdk11_macos_for_testing",
Expand Down
4 changes: 4 additions & 0 deletions src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ filegroup(
"//src/conditions:linux_aarch64": [
"@openjdk_linux_aarch64_vanilla//file",
],
"//src/conditions:linux_ppc64le": [
"@openjdk_linux_ppc64le_vanilla//file",
],
"//conditions:default": [
"@openjdk_linux_vanilla//file",
],
Expand Down Expand Up @@ -757,6 +760,7 @@ filegroup(
"@remote_java_tools_linux_for_testing//:WORKSPACE",
"@remote_java_tools_windows_for_testing//:WORKSPACE",
"@remotejdk11_linux_aarch64_for_testing//:WORKSPACE",
"@remotejdk11_linux_ppc64le_for_testing//:WORKSPACE",
"@remotejdk11_linux_for_testing//:WORKSPACE",
"@remotejdk11_macos_for_testing//:WORKSPACE",
"@remotejdk11_win_for_testing//:WORKSPACE",
Expand Down
6 changes: 6 additions & 0 deletions src/conditions/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ config_setting(
visibility = ["//visibility:public"],
)

config_setting(
name = "linux_ppc64le",
values = {"cpu": "ppc"},
visibility = ["//visibility:public"],
)

config_setting(
name = "linux_s390x",
values = {"cpu": "s390x"},
Expand Down
6 changes: 6 additions & 0 deletions src/conditions/BUILD.tools
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ config_setting(
visibility = ["//visibility:public"],
)

config_setting(
name = "linux_ppc64le",
values = {"cpu": "ppc"},
visibility = ["//visibility:public"],
)

config_setting(
name = "linux_s390x",
values = {"cpu": "s390x"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,19 @@ maybe(
],
)

# This must be kept in sync with the top-level WORKSPACE file.
maybe(
http_archive,
name = "remotejdk11_linux_ppc64le",
build_file = "@local_jdk//:BUILD.bazel",
sha256 = "a417db0295b1f4b538ecbaf7c774f3a177fab9657a665940170936c0eca4e71a",
strip_prefix = "jdk-11.0.7+10",
jayfurmanek marked this conversation as resolved.
Show resolved Hide resolved
urls = [
"https://mirror.bazel.com/openjdk/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.7%2B10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.7_10.tar.gz",
"/~https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.7%2B10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.7_10.tar.gz",
],
)

# This must be kept in sync with the top-level WORKSPACE file.
maybe(
http_archive,
Expand Down
16 changes: 12 additions & 4 deletions src/minimize_jdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ else
fi
fulljdk=$1
out=$3
ARCH=`uname -p`
if [[ "${ARCH}" == 'ppc64le' ]]; then
FULL_JDK_DIR="jdk*"
DOCS=""
else
FULL_JDK_DIR="zulu*"
DOCS="DISCLAIMER readme.txt"
fi

UNAME=$(uname -s | tr 'A-Z' 'a-z')

Expand All @@ -38,11 +46,11 @@ if [[ "$UNAME" =~ msys_nt* ]]; then
mkdir "tmp.$$"
cd "tmp.$$"
unzip "../$fulljdk"
cd zulu*
cd $FULL_JDK_DIR
./bin/jlink --module-path ./jmods/ --add-modules "$modules" \
--vm=server --strip-debug --no-man-pages \
--output reduced
cp DISCLAIMER readme.txt legal/java.base/ASSEMBLY_EXCEPTION \
cp $DOCS legal/java.base/ASSEMBLY_EXCEPTION \
reduced/
# These are necessary for --host_jvm_debug to work.
cp bin/dt_socket.dll bin/jdwp.dll reduced/bin
Expand All @@ -55,11 +63,11 @@ else
# to the owner stored in the archive - it will try to do that when running as
# root, but fail when running inside Docker, so we explicitly disable it.
tar xf "$fulljdk" --no-same-owner
cd zulu*
cd $FULL_JDK_DIR
./bin/jlink --module-path ./jmods/ --add-modules "$modules" \
--vm=server --strip-debug --no-man-pages \
--output reduced
cp DISCLAIMER readme.txt legal/java.base/ASSEMBLY_EXCEPTION \
cp $DOCS legal/java.base/ASSEMBLY_EXCEPTION \
reduced/
# These are necessary for --host_jvm_debug to work.
if [[ "$UNAME" =~ darwin ]]; then
Expand Down
1 change: 1 addition & 0 deletions src/test/py/bazel/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class TestBase(unittest.TestCase):
'rules_proto',
'remotejdk11_linux_for_testing',
'remotejdk11_linux_aarch64_for_testing',
'remotejdk11_linux_ppc64le_for_testing',
'remotejdk11_macos_for_testing',
'remotejdk11_win_for_testing',
'remote_java_tools_darwin_for_testing',
Expand Down
1 change: 1 addition & 0 deletions src/test/shell/testenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ EOF
"remote_java_tools_windows_for_testing"
"remotejdk11_linux_for_testing"
"remotejdk11_linux_aarch64_for_testing"
"remotejdk11_linux_ppc64le_for_testing"
"remotejdk11_macos_for_testing"
"remotejdk11_win_for_testing"
"rules_cc"
Expand Down
1 change: 1 addition & 0 deletions tools/jdk/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ alias(
"//src/conditions:windows": "@remotejdk11_win//:jdk",
"//src/conditions:linux_aarch64": "@remotejdk11_linux_aarch64//:jdk",
"//src/conditions:linux_x86_64": "@remotejdk11_linux//:jdk",
"//src/conditions:linux_ppc64le": "@remotejdk11_linux_ppc64le//:jdk",
},
no_match_error = "Could not find a JDK for host execution environment, please explicitly" +
" provide one using `--host_javabase.`",
Expand Down