)]}'
{
  "commit": "4b4e74be3721812da5f025b51e7987d772f4d3e2",
  "tree": "e1d2051d43e2cdf456865254e0b26af125aee7de",
  "parents": [
    "6e580312f0dc77cc4a7a4abd2064d6a1da59b58c"
  ],
  "author": {
    "name": "Ian (Hee) Cha",
    "email": "heec@google.com",
    "time": "Wed Aug 05 19:16:22 2026 +0000"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Aug 05 19:16:22 2026 +0000"
  },
  "message": "[8.8.0] Reland: Bootstrap the distfile test with a hermetic JDK 21 (https://g… (#30533)\n\n…ithub.com/bazelbuild/bazel/pull/30494)\n\nRelands c143d206f6220f6501c07aa83390e68bf5b7657c (#30473), which was\nrolled back in 8fd8ead59547c686ebccc418b1dc6409ed03ba96 because it broke\nthe macOS postsubmit.\n\nThe bootstrap prerequisites documented at\nhttps://bazel.build/install/compile-source#bootstrap-unix-prereq require\na JDK 21, but `bazel_bootstrap_distfile_test` bootstrapped with\nwhichever JDK `scripts/bootstrap/buildenv.sh` happened to discover on\nthe machine running the test: `JAVA_HOME` if it is set, otherwise\n`/usr/libexec/java_home -v 21+` on macOS or the `javac` on `PATH` on\nLinux.\n\nThis adds `@rules_java//toolchains:remotejdk_21` to the runfiles of both\ndistfile tests and points `JAVA_HOME` at it via `setup_javabase`.\n`compile.sh` runs the entire bootstrap as `\"${JAVA_HOME}/bin/java\" ...\n--default_system_javabase\u003d\"${JAVA_HOME}\"`, so this single export makes\nboth the JVM running the bootstrapping Bazel and `@local_jdk` hermetic\nand the host JDK discovery in `buildenv.sh` is never reached. The test\nadditionally asserts that the runtime is a JDK 21, so that it keeps\nverifying the documented prerequisite instead of silently passing on a\nnewer host JDK.\n\nThe macOS CI machines have `JAVA_TOOL_OPTIONS` set, which makes the JVM\nprint an extra line in front of the `javac -version` output, so the new\nJDK 21 assertion rejected a perfectly good JDK 21:\n\n```\nERROR[bazel_bootstrap_distfile_test] expected a JDK 21 in JAVA_HOME, but got \u0027Picked up JAVA_TOOL_OPTIONS: -Djava.net.preferIPv6Addresses\u003dtrue\njavac 21.0.9\u0027\n```\n\n`JAVA_TOOL_OPTIONS` and `_JAVA_OPTIONS` are now unset for that check,\njust like `scripts/bootstrap/compile.sh` already does for the bootstrap\nitself. Nothing else differs from the original commit.\n\nOn a CI machine whose default `javac` is 17, the test fails up front\nwith `ERROR: JDK version (1.17) is lower than 21, please set\n$JAVA_HOME.`, which has nothing to do with the change under test. On a\nmachine with a JDK newer than 21 it instead exercises a configuration\nthat the installation instructions do not describe.\n\nNo\n\n- [ ] I have added tests for the new use cases (if any). — N/A, this is\na test-only change.\n- [ ] I have updated the documentation (if applicable). — N/A.\n\nRELNOTES: None\n\nCloses #30494.\n\nPiperOrigin-RevId: 955890390\nChange-Id: Ie5c0a30115f63a80009a7270d47f94b0168fc6e2\n\n\u003c!--\nThank you for contributing to Bazel!\nPlease read the contribution guidelines:\nhttps://bazel.build/contribute.html\n--\u003e\n\n### Description\n\u003c!--\nPlease provide a brief summary of the changes in this PR.\n--\u003e\n\n### Motivation\n\u003c!--\nWhy is this change important? Does it fix a specific bug or add a new\nfeature?\nIf this PR fixes an existing issue, please link it here (e.g. \"Fixes\n#1234\").\n--\u003e\n\n### Build API Changes\n\u003c!--\nDoes this PR affect the Build API? (e.g. Starlark API, providers,\ncommand-line flags, native rules)\nIf yes, please answer the following:\n1. Has this been discussed in a design doc or issue? (Please link it)\n2. Is the change backward compatible?\n3. If it\u0027s a breaking change, what is the migration plan?\n--\u003e\n\nNo\n\n### Checklist\n\n- [ ] I have added tests for the new use cases (if any).\n- [ ] I have updated the documentation (if applicable).\n\n### Release Notes\n\n\u003c!--\nIf this is a new feature, please add \u0027RELNOTES[NEW]: \u003cdescription\u003e\u0027\nhere.\nIf this is a breaking change, please add \u0027RELNOTES[INC]: \u003creason\u003e\u0027 here.\nIf this change should be mentioned in release notes, please add\n\u0027RELNOTES: \u003creason\u003e\u0027 here.\n--\u003e\n\nRELNOTES: None\n\nCommit\nhttps://github.com/bazelbuild/bazel/commit/ec3c34a7e9a0223d135330d1edab4e2d1280329b\nand\nhttps://github.com/bazelbuild/bazel/pull/30533/commits/3a710fdb69c937152b12663ba578b44b4ad664df\n\n---------\n\nCo-authored-by: Xdng Yng \u003cwyverald@gmail.com\u003e\nCo-authored-by: hvd \u003chvd@google.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "aed4bd02fb52c87793296272ba92eb7b2e5c8641",
      "old_mode": 33188,
      "old_path": "src/test/shell/bazel/BUILD",
      "new_id": "bcd42db6bd7b5d7ba96813f17436920debe76a2f",
      "new_mode": 33188,
      "new_path": "src/test/shell/bazel/BUILD"
    },
    {
      "type": "modify",
      "old_id": "84af4a3d8b85ce42c0f0dfb88f66db932c6c6590",
      "old_mode": 33261,
      "old_path": "src/test/shell/bazel/bazel_bootstrap_distfile_test.sh",
      "new_id": "6780d3a456ad02685d40df0f2d01900b71cd12d5",
      "new_mode": 33261,
      "new_path": "src/test/shell/bazel/bazel_bootstrap_distfile_test.sh"
    },
    {
      "type": "modify",
      "old_id": "dad16bbe989dc4ad9bef2356a630261f9c2ae8c4",
      "old_mode": 33261,
      "old_path": "src/test/shell/bazel/bazel_windows_example_test.sh",
      "new_id": "580884a6d7f04721fba3619de58742eaffdaf2de",
      "new_mode": 33261,
      "new_path": "src/test/shell/bazel/bazel_windows_example_test.sh"
    },
    {
      "type": "modify",
      "old_id": "d4ac780aa5829f30ffc230c122ad803cd7daf5d0",
      "old_mode": 33188,
      "old_path": "src/test/shell/bazel/remote/BUILD",
      "new_id": "e5c808f21504cf5f247ef088d3833b313d300e63",
      "new_mode": 33188,
      "new_path": "src/test/shell/bazel/remote/BUILD"
    },
    {
      "type": "modify",
      "old_id": "ec17569ab9da7585b6c7819a191c3b217916c1df",
      "old_mode": 33261,
      "old_path": "src/test/shell/bazel/remote_helpers.sh",
      "new_id": "3db92185bdfea9a0cdf45213bbb9c0a5332596f5",
      "new_mode": 33261,
      "new_path": "src/test/shell/bazel/remote_helpers.sh"
    },
    {
      "type": "modify",
      "old_id": "56e8eefb61c733690928b2e986c683cafd6dd9d3",
      "old_mode": 33261,
      "old_path": "src/test/shell/testenv.sh",
      "new_id": "8c7d9da531c95e74f0e376864f66e07b06093e03",
      "new_mode": 33261,
      "new_path": "src/test/shell/testenv.sh"
    },
    {
      "type": "modify",
      "old_id": "7043e27b348936b1aad41833387db13a304033aa",
      "old_mode": 33188,
      "old_path": "src/tools/singlejar/BUILD",
      "new_id": "0cf8cd84fbfc9cacfabef418c84f75154749a2db",
      "new_mode": 33188,
      "new_path": "src/tools/singlejar/BUILD"
    },
    {
      "type": "modify",
      "old_id": "d5bfb088947158977b2b48150a389d190c507d2c",
      "old_mode": 33188,
      "old_path": "src/tools/singlejar/output_jar_simple_test.cc",
      "new_id": "f95180adb10e5790247625da3f0ae2c1b69b3790",
      "new_mode": 33188,
      "new_path": "src/tools/singlejar/output_jar_simple_test.cc"
    }
  ]
}
