)]}'
{
  "commit": "b223efd0c09f874ce85437f0329f40f4c46bf090",
  "tree": "539d30c151bcf0d01c5bec64b8683671bd2ff4af",
  "parents": [
    "cba7a8e32331245bc0f1c0567a7c669badad80ad"
  ],
  "author": {
    "name": "Titus Fortner",
    "email": "titusfortner@users.noreply.github.com",
    "time": "Thu Jul 16 13:44:58 2026 -0500"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Thu Jul 16 11:44:58 2026 -0700"
  },
  "message": "fix: detect execroot when output_base path contains a bazel-out segment (#2919)\n\nThe `js_binary` launcher infers the Bazel execroot by scanning `$PWD`\nfor the substring `/bazel-out/`. If `--output_base` (or any ancestor\ndirectory) is named `bazel-out`, that substring matches the output-base\ndirectory instead of the real output tree, so the launcher computes the\nexecroot too shallow. For a `js_binary` used as the tool of a\n`js_run_binary` this fails with `entry_point \u0027\u003c...\u003e\u0027 not found`, and\nbecause the wrong branch also skips `cd \"$BAZEL_BINDIR\"`, tools that\nrely on being in `$(BINDIR)` then fail to read their inputs.\n\nDetect a fresh build-action execroot structurally instead: `$PWD` is the\nexecroot when the bindir hangs off it (`-d \"$PWD/$BAZEL_BINDIR\"`), even\nwhen its path contains a `bazel-out` segment. Otherwise scan the output\ntree for the execroot — the runfiles case (e.g. `js_test`), or a nested\n`js_binary` whose parent already `cd`\u0027d into the bindir. A nested child\ninherits `BAZEL_BINDIR` but runs from the bindir, so keying off\n`BAZEL_BINDIR` alone is not enough; the directory check distinguishes\nthe two. The runfiles scan also strips from the last `bazel-out` segment\nrather than the first, so a `bazel-out` component in the output base is\nnot mistaken for the output tree. None of this changes behavior under\nthe default output base.\n\nReproduce with any `js_run_binary` and an output base whose path\ncontains a `bazel-out` segment:\n\n```sh\nbazel --output_base\u003d/tmp/demo/bazel-out build //path/to:some_js_run_binary_target\n```\n\n### Changes are visible to end-users: yes\n\n- Searched for relevant documentation and updated as needed: yes (no\ndocs describe this behavior)\n- Breaking change (forces users to change their own code or config): no\n- Suggested release notes appear below: yes\n\nFix `js_binary`/`js_run_binary` failing to find the entry point when\n`--output_base` points at a path containing a `bazel-out` segment.\n\n### Test plan\n\n- Covered by existing test cases (launcher snapshot, `js_binary_sh`,\n`js_test` toolchain tests, and nested-execution coverage in\n`examples/runfiles`)\n- New e2e case: `e2e/js_binary_workspace` now runs under an output base\nwhose path contains a `bazel-out` segment (via a relative\n`--output_base` in its `.bazelrc`), reproducing the bug without the fix",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e9ed58f77ba2630248f43d179f47c733080c4fb1",
      "old_mode": 33188,
      "old_path": "e2e/js_binary_workspace/.bazelignore",
      "new_id": "4f1e8c45219aada2918c0c0434284344ee6bc6bb",
      "new_mode": 33188,
      "new_path": "e2e/js_binary_workspace/.bazelignore"
    },
    {
      "type": "modify",
      "old_id": "58d7130238c19dc1f89fffac4b43575db0309cd6",
      "old_mode": 33188,
      "old_path": "e2e/js_binary_workspace/.bazelrc",
      "new_id": "f5f675fd8f8c68c624eb23c8554b1f064bd4dafd",
      "new_mode": 33188,
      "new_path": "e2e/js_binary_workspace/.bazelrc"
    },
    {
      "type": "modify",
      "old_id": "5d0234cb5c1abaaf3728741f5065fc31e728bdbf",
      "old_mode": 33188,
      "old_path": "js/private/js_binary.sh.tpl",
      "new_id": "932e4cc4dd19cea571365a6740a04a7f9bbbd20f",
      "new_mode": 33188,
      "new_path": "js/private/js_binary.sh.tpl"
    },
    {
      "type": "modify",
      "old_id": "501c8bae044b01f05015d0b7e6a6c23d74dcde52",
      "old_mode": 33188,
      "old_path": "js/private/test/snapshots/launcher.sh",
      "new_id": "e50f7a4178ccf74e6e8e31b5617ee5a8e18f6424",
      "new_mode": 33188,
      "new_path": "js/private/test/snapshots/launcher.sh"
    }
  ]
}
