[7.7.3] Update the embedded JDK to 21.0.13.1. (#32791) Updates the embedded Azul Zulu 21 JDK archives on Linux (`x64`, `aarch64`), macOS (`x64`, `aarch64`), and Windows (`x64`, `arm64`) to `21.0.13.1` (`zulu21.54.201`) to address `CVE-2026-114938`. Non-x86 Adoptium Temurin 21 archives (`ppc64le`, `s390x`) are unaffected by the `x86-64` AVX-512 intrinsic bug and remain unchanged. Also includes #29003 so `src/minimize_jdk.sh` handles the `Contents/Home` archive layout in `zulu21.54.201` macOS archives. RELNOTES: Updated the bundled JDK to 21.0.13.1. (cherry picked from commit 535d6331d6f6378d791e633905e60a909789948b) (cherry picked from commit 30789d19b83025d021dabece6d17565d9baec582)
diff --git a/repositories.bzl b/repositories.bzl index dffa917..11a4a64 100644 --- a/repositories.bzl +++ b/repositories.bzl
@@ -71,15 +71,15 @@ """OpenJDK distributions used to create a version of Bazel bundled with the OpenJDK.""" http_file( name = "openjdk_linux_vanilla", - integrity = "sha256-UyCjNxT1jAEEGR0kR1napqbUaBnURzR7qQAxMuVInZI=", + integrity = "sha256-UQaW99p5Xgi0hDImgXOwYKSaajsFQwaQ53a1893srF4=", downloaded_file_path = "zulu-linux-vanilla.tar.gz", - url = "https://cdn.azul.com/zulu/bin/zulu21.38.21-ca-jdk21.0.5-linux_x64.tar.gz", + url = "https://cdn.azul.com/zulu/bin/zulu21.54.201-ca-jdk21.0.13.1-linux_x64.tar.gz", ) http_file( name = "openjdk_linux_aarch64_vanilla", - integrity = "sha256-i9OHMVYgu2aoSUWlG867kBY1S1V8dH6U1IN+aOpAd+w=", + integrity = "sha256-ekaDQS9e7ukCYax+2o16lgdteUZWy1B42PD7OL8ttVQ=", downloaded_file_path = "zulu-linux-aarch64-vanilla.tar.gz", - url = "https://cdn.azul.com/zulu/bin/zulu21.38.21-ca-jdk21.0.5-linux_aarch64.tar.gz", + url = "https://cdn.azul.com/zulu/bin/zulu21.54.201-ca-jdk21.0.13.1-linux_aarch64.tar.gz", ) http_file( name = "openjdk_linux_s390x_vanilla", @@ -95,27 +95,27 @@ ) http_file( name = "openjdk_macos_x86_64_vanilla", - integrity = "sha256-zXTl63OMkUWdS45eEOrJGK4qBdIan8fKXcLaZOZbzr0=", + integrity = "sha256-GnC7osXB1HdSz/+0FJ1CYAmUTe5r7OrBv9bVwT+JqC8=", downloaded_file_path = "zulu-macos-vanilla.tar.gz", - url = "https://cdn.azul.com/zulu/bin/zulu21.38.21-ca-jdk21.0.5-macosx_x64.tar.gz", + url = "https://cdn.azul.com/zulu/bin/zulu21.54.201-ca-jdk21.0.13.1-macosx_x64.tar.gz", ) http_file( name = "openjdk_macos_aarch64_vanilla", - integrity = "sha256-gP/CXfeblVZTGNv8gwnFFXJv9C6b21MwYe3HrSbxPfI=", + integrity = "sha256-9kIglesNIbbZdMta+FwSFyjf5LvaAQixQgl455NXWtw=", downloaded_file_path = "zulu-macos-aarch64-vanilla.tar.gz", - url = "https://cdn.azul.com/zulu/bin/zulu21.38.21-ca-jdk21.0.5-macosx_aarch64.tar.gz", + url = "https://cdn.azul.com/zulu/bin/zulu21.54.201-ca-jdk21.0.13.1-macosx_aarch64.tar.gz", ) http_file( name = "openjdk_win_vanilla", - integrity = "sha256-jepE/TpvetD0LzirwTcQdXELWL7ZvY8JPC7y1FDdJnI=", + integrity = "sha256-FOegOV308JtQjVCqZahYZQ1Z640iId9XtHQtCDDzo6A=", downloaded_file_path = "zulu-win-vanilla.zip", - url = "https://cdn.azul.com/zulu/bin/zulu21.38.21-ca-jdk21.0.5-win_x64.zip", + url = "https://cdn.azul.com/zulu/bin/zulu21.54.201-ca-jdk21.0.13.1-win_x64.zip", ) http_file( name = "openjdk_win_arm64_vanilla", - integrity = "sha256-9a1/U5900StiSMD9n0tBZFXc9oA5ALKOjRkFTz3Mbpg=", + integrity = "sha256-kE6UXINidka0TgCnpxUuX+UNM90Ad19g5hZ+mRb42kA=", downloaded_file_path = "zulu-win-arm64.zip", - url = "https://cdn.azul.com/zulu/bin/zulu21.38.21-ca-jdk21.0.5-win_aarch64.zip", + url = "https://cdn.azul.com/zulu/bin/zulu21.54.201-ca-jdk21.0.13.1-win_aarch64.zip", ) def bazelci_rules_repo():
diff --git a/src/main/starlark/tests/builtins_bzl/cc_builtin_tests.sh b/src/main/starlark/tests/builtins_bzl/cc_builtin_tests.sh index 0adbd9b..82f1025 100755 --- a/src/main/starlark/tests/builtins_bzl/cc_builtin_tests.sh +++ b/src/main/starlark/tests/builtins_bzl/cc_builtin_tests.sh
@@ -213,7 +213,9 @@ ) EOF - bazel build --experimental_cc_static_library //pkg:protobuf \ + bazel build --experimental_cc_static_library \ + --cxxopt=-Wno-deprecated-builtins --host_cxxopt=-Wno-deprecated-builtins \ + //pkg:protobuf \ &> $TEST_log || fail "Expected build to fail" }
diff --git a/src/minimize_jdk.sh b/src/minimize_jdk.sh index 82fecd7..1073e38 100755 --- a/src/minimize_jdk.sh +++ b/src/minimize_jdk.sh
@@ -32,10 +32,8 @@ out=$3 ARCH=`uname -p` if [[ "${ARCH}" == 'ppc64le' ]] || [[ "${ARCH}" == 's390x' ]]; then - FULL_JDK_DIR="jdk*" DOCS="" else - FULL_JDK_DIR="zulu*" DOCS="DISCLAIMER readme.txt" fi @@ -70,12 +68,34 @@ done } +# Strips an extracted JDK archive to its home directory. +# Some JDK archives (e.g., macOS .jdk bundles) nest the JDK home inside +# additional directories like Contents/Home/. This function detects the +# actual JDK home by locating the 'release' file and moves it to the +# expected top-level directory. +strip_to_jdk_home() { + local dir=$1 + local release + release=$(find "$dir" -name release -maxdepth 4 -print -quit) + if [[ -z "$release" ]]; then + echo "ERROR: could not find 'release' file in $dir" >&2 + exit 1 + fi + local jdk_home + jdk_home=$(dirname "$release") + if [[ "$jdk_home" != "$dir" ]]; then + local tmp="${dir}_tmp" + mv "$jdk_home" "$tmp" + rm -rf "$dir" + mv "$tmp" "$dir" + fi +} + if [[ "$UNAME" =~ msys_nt* ]]; then set -x - mkdir "tmp.$$" + unzip -q "$fulljdk" -d "tmp.$$" + strip_to_jdk_home "tmp.$$" cd "tmp.$$" - unzip -q "../$fulljdk" - cd $FULL_JDK_DIR # We have to add this module explicitly because it is windows specific, it allows # the usage of the Windows truststore # e.g. -Djavax.net.ssl.trustStoreType=WINDOWS-ROOT @@ -89,15 +109,17 @@ # These are necessary for --host_jvm_debug to work. cp bin/dt_socket.dll bin/jdwp.dll reduced/bin zip -q -X -r ../reduced.zip reduced/ - cd ../.. - mv "tmp.$$/reduced.zip" "$out" + cd .. + mv reduced.zip "$out" rm -rf "tmp.$$" else # The --no-same-owner flag instructs tar to not try to chown extracted files # 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 $FULL_JDK_DIR + mkdir "target_jdk.$$" + tar xf "$fulljdk" --no-same-owner -C "target_jdk.$$" + strip_to_jdk_home "target_jdk.$$" + cd "target_jdk.$$" ./bin/jlink --module-path ./jmods/ --add-modules "$modules" \ --vm=server --strip-debug --no-man-pages \ --output reduced @@ -114,4 +136,5 @@ zip -q -X -r ../reduced.zip reduced/ cd .. mv reduced.zip "$out" + rm -rf "target_jdk.$$" fi
diff --git a/src/test/shell/bazel/path_mapping_test.sh b/src/test/shell/bazel/path_mapping_test.sh index 0495d46..01c0968 100755 --- a/src/test/shell/bazel/path_mapping_test.sh +++ b/src/test/shell/bazel/path_mapping_test.sh
@@ -385,6 +385,11 @@ # Verifies that path mapping results in cache hits for CppCompile actions # subject to transitions that don't affect their inputs. function test_path_stripping_cc_remote() { + if [[ "$(uname -s)" == "Darwin" ]]; then + # apple_support 1.15.1 (pinned below by #27113) links wrapped_clang_pp with + # -Wl,-no_uuid, which macOS 26 dyld rejects ("missing LC_UUID load command"). + return 0 + fi local -r pkg="${FUNCNAME[0]}" cat > MODULE.bazel <<EOF