)]}'
{
  "commit": "85007f4932e66ae67a42658235e38617f75628b5",
  "tree": "87974f2fd6d41e447b96f0b990d38f409b01553f",
  "parents": [
    "eb280facda18a776fa3340ecd49e42243d67867b"
  ],
  "author": {
    "name": "Brian Duff",
    "email": "cairndubh@gmail.com",
    "time": "Thu Apr 16 15:34:00 2026 -0500"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Thu Apr 16 20:34:00 2026 +0000"
  },
  "message": "Wire rust_objcopy into the generated sysroot action inputs (#3972)\n\n## Summary\n\n#3727 added a `rust_objcopy` attribute to `rust_toolchain`, a separate\n`rust-objcopy` filegroup, and automatic opt-in for Rust 1.84+/recent\nnightlies. But the glue to turn that attribute into a real action input\nis missing: `ctx.file.rust_objcopy` is stashed on `ToolchainInfo` and\nnever used again. It never flows through `_generate_sysroot` into\n`direct_files`, so it doesn\u0027t join `toolchain.all_files` and isn\u0027t\ndeclared as an input to the Rustc action.\n\nOn Linux/macOS with symlink-based sandboxing this is masked — rustc\nhappens to see the neighboring file in the unsandboxed `rules_rust`\nexternal repo. Under remote execution, Windows (file-copy sandbox), or\nstricter local sandboxes, rustc invokes `rust-objcopy` and fails:\n\n```\nerror: unable to run `rust-objcopy`: No such file or directory (os error 2)\n```\n\nTracking: #3307.\n\n## Fix\n\nMirror the `linker` handling in `_generate_sysroot`: symlink\n`rust_objcopy` into the sysroot at\n`lib/rustlib/\u003ctriple\u003e/bin/rust-objcopy` (where rustc looks) and append\nit to `direct_files` so it becomes a declared Rustc action input.\n\n## Verification\n\nPatched `rules_rust` via `local_path_override` in a minimal smoke\nworkspace using rustc 1.93.0 on aarch64-apple-darwin:\n\n- `bazel build -c opt //:hello` succeeds (opt-mode `process_wrapper`\nuses `-Cstrip\u003ddebuginfo`, which invokes rust-objcopy).\n- `bazel aquery \u0027mnemonic(\"Rustc\", //:hello)\u0027` now lists the sysroot\n`rust-objcopy` symlink as a declared input — it was absent before.\n\nBefore: no `rust-objcopy` entry in the Rustc action inputs.\nAfter:\n`bazel-out/.../rust_toolchain/lib/rustlib/aarch64-apple-darwin/bin/rust-objcopy`.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "34f739d4a4993f7cd7ac65bdf1f9f0f8ba8148e0",
      "old_mode": 33188,
      "old_path": "rust/toolchain.bzl",
      "new_id": "8a1408ac626f37b33d42feb554a244761a8e9a24",
      "new_mode": 33188,
      "new_path": "rust/toolchain.bzl"
    }
  ]
}
