)]}'
{
  "commit": "fd7af9ef10d795f930255a73fb77dd99630595c4",
  "tree": "17d31a63a66d41568ab303d25ab6b17e2a03c35a",
  "parents": [
    "20ee051fb143246057e8afa1a61f3350d80a0d5d"
  ],
  "author": {
    "name": "Dmitry Spikhalsky",
    "email": "dmitry@spikhalskiy.com",
    "time": "Wed Oct 28 08:48:20 2026 -0700"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Wed Oct 28 08:49:30 2026 -0700"
  },
  "message": "Fail when `--experimental_use_hermetic_linux_sandbox` is set but `linux-sandbox` is unsupported (#32164)\n\n### Description\n\nOn Linux, `SandboxModule` now fails the command if `--experimental_use_hermetic_linux_sandbox` is set and `linux-sandbox` does not pass its support check. The error includes the reason the check failed, which now carries the `linux-sandbox` stderr instead of discarding it.\n\n### Motivation\n\nFixes #32161.\n\nWhen the `linux-sandbox` check fails (for example, without user namespaces), `sandboxed` resolves to `processwrapper-sandbox` and the hermetic flag is silently ignored. Actions then see the host filesystem and the build still succeeds. We hit this as a build tool loading the host\u0027s `libstdc++` instead of the one we provide. This mirrors `--experimental_use_windows_sandbox\u003dyes`, which already fails when `windows-sandbox` is unavailable.\n\nA machine that sets the flag but cannot run `linux-sandbox` will now fail instead of silently degrading. Those users can drop the flag.\n\n### Build API Changes\n\nNo\n\n### Checklist\n\n- [x] I have added tests for the new use cases (if any).\n- [x] I have updated the documentation (if applicable).\n\n### Release Notes\n\nRELNOTES: `--experimental_use_hermetic_linux_sandbox` now fails the build on Linux when `linux-sandbox` is not supported, instead of silently falling back to `processwrapper-sandbox`; making it consistent with experimental_use_windows_sandbox.\n\nCloses #32164\n\nCOPYBARA_INTEGRATE_REVIEW\u003dhttps://github.com/bazelbuild/bazel/pull/32164 from Spikhalskiy:hermetic-sandbox-fail-closed 4c9feb3589893f55c3632f26ccd47bb3eb254bc1\nPiperOrigin-RevId: 1008942158\nChange-Id: I73343a045ba963157b72f4854e692bccfaeb3463\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "74a72b8c579761a72dc85f0bab4c94cbedf5153c",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedSpawnRunner.java",
      "new_id": "dd27145b45914e4c92442005cd9fb4a43dbe6fe0",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedSpawnRunner.java"
    },
    {
      "type": "modify",
      "old_id": "f33a805c7ca97056bff3f49a5df92f202b3bde84",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/sandbox/SandboxModule.java",
      "new_id": "4824bfc0d52b9ac3dd05406957b9f2467e11ffd9",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/sandbox/SandboxModule.java"
    },
    {
      "type": "modify",
      "old_id": "094ea60be872802892be069b9f5cfcaceec55f59",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/sandbox/SandboxOptions.java",
      "new_id": "14ee568993ccf81bf435bd283a8ae9f2d3620ede",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/sandbox/SandboxOptions.java"
    },
    {
      "type": "modify",
      "old_id": "72ad0869709d2da8523763fe6a574825f78c1a6d",
      "old_mode": 33261,
      "old_path": "src/test/shell/bazel/bazel_hermetic_sandboxing_test.sh",
      "new_id": "c4655f56a3e0b3f137d13eae2ebf394f7ad490ce",
      "new_mode": 33261,
      "new_path": "src/test/shell/bazel/bazel_hermetic_sandboxing_test.sh"
    }
  ]
}
