)]}'
{
  "commit": "63cd33e35b964fa63d587d905bb3102818314352",
  "tree": "afdd7d83650ac7979383f89d77fdc8a784bfd875",
  "parents": [
    "db13b337f0c3f48eda1d2c728d67c0e1f483a25c"
  ],
  "author": {
    "name": "Sitaktif",
    "email": "romainchossart@gmail.com",
    "time": "Tue May 12 12:03:23 2026 +0100"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue May 12 11:03:23 2026 +0000"
  },
  "message": "fix: put GoProtocGen in its own exec group (#4605)\n\nWhen building go_proto_library with two registered execution platforms\n(e.g. linux/x86_64 RBE registered first, darwin/arm64 local fallback),\nthe GoProtocGen action would fail with \"cannot execute binary file\":\n\n- go-protoc-bin is built via `cfg \u003d \"exec\"` in _go_proto_compiler, which\nindependently selects the first registered exec platform (e.g. linux ELF\nbinary).\n- Without --incompatible_auto_exec_groups, go_proto_library\u0027s Go\ntoolchain declaration may have additional constraints (e.g. darwin\narm64) and forces ALL rule actions onto darwin, including GoProtocGen.\n\nThis may lead to e.g. a linux binary executing on a darwin platform,\nleading to a \"exec format error\" error.\n\nFix: declare an unconstrained `go_proto_gen` exec group in\ngo_proto_library and assign GoProtocGen to it via `exec_group \u003d\n\"go_proto_gen\"`. The group has no toolchain constraints, making it\nequivalent to `cfg \u003d \"exec\"`, so Bazel picks the first compatible exec\nplatform — the same one that built go-protoc-bin via `cfg \u003d \"exec\"`.\n\ngo.env already carries GOOS/GOARCH/GOROOT as concrete strings from\ngo_context(), so the generated .pb.go files remain correctly targeted to\nthe host platform. The generator itself does not need to run on the\ntarget platform.\n\nFixes #4604 \n\n-- \n\nI pushed a way to reproduce the issue in\nhttps://github.com/sitaktif/rules_go/tree/rules-go-exec-format-error-repro,\nbut I don\u0027t have an actual test in this PR to prevent future regressions\nbecause I\u0027m not sure how to test that without an overly complicated and\nslow setup. Please share any suggestions on how to do that :-)",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "eab451d0f2a9b4e011a9ff81771fbd8b6c569191",
      "old_mode": 33188,
      "old_path": "proto/compiler.bzl",
      "new_id": "86ff4928aa35c4b03f54d59ba1dbbfe61c68e288",
      "new_mode": 33188,
      "new_path": "proto/compiler.bzl"
    },
    {
      "type": "modify",
      "old_id": "9e37f7b8410431477749d61b647bec99b3c1ceb9",
      "old_mode": 33188,
      "old_path": "proto/def.bzl",
      "new_id": "513d188ddb7be446b7e9c79bea12303c24ba11e4",
      "new_mode": 33188,
      "new_path": "proto/def.bzl"
    }
  ]
}
