)]}'
{
  "commit": "1fa9a54177de7ad59fc5e39e3fd52a3340a82fa2",
  "tree": "c5dc5b7fc26f7847c54698ffea271e4cc3577091",
  "parents": [
    "fb5f09191c968817d149ddf296c526289dd15219"
  ],
  "author": {
    "name": "Jacob Oaks",
    "email": "joaks@uber.com",
    "time": "Tue Sep 10 19:19:07 2024 -0400"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Sep 10 16:19:07 2024 -0700"
  },
  "message": "Use -gcflags\u003d--pgoprofile instead of -pgo when building stdlib (#4097)\n\n**What type of PR is this?**\r\n\r\nBug fix\r\n\r\n**What does this PR do? Why is it needed?**\r\n\r\nGo 1.23 introduces `go tool preprofile` (ref:\r\nhttps://github.com/golang/go/commit/e069587c8d530ec912614d138bbf59a1d1788fb9).\r\nThis tool allows folks to do the heavy lifting of processing their CPU\r\nprofile ahead of time, resulting in a pre-processed profile that leads\r\nto quicker PGO builds later.\r\n\r\nThe `--pgo` flag to the `go` command only accepts raw profiles due to\r\nhttps://github.com/golang/go/commit/081dc9fd8c9cf824f5caac3a03a1c8dfd86894c0\r\nwhich makes the go command itself run the pre-processor on the input\r\nprofile, which leads to errors if the given profile is already\r\npre-processed. Since rules_go adds the `--pgo` flag when building the\r\nstdlib, this leads to errors when passing a pre-processed profile via\r\n`--@io_bazel_rules_go//go/config:pgoprofile`:\r\n\r\n```\r\n$ go version\r\ngo version go1.23.1 linux/amd64\r\n$ go tool preprofile -i raw_profile -o preprocessed\r\n$ bazel build --@io_bazel_rules_go//go/config:pgoprofile\u003d$(pwd)/preprocessed .\r\n...\r\npreprofile: error parsing profile: error parsing profile: parsing profile: unknown wire type: 7\r\n...\r\n```\r\n\r\nThis PR uses the gcflag instead when building stdlib,\r\nas that can accept either a raw or pre-processed profile. This is what\r\nwe already do within the compile action anyways:\r\nhttps://github.com/bazelbuild/rules_go/blob/fb5f09191c968817d149ddf296c526289dd15219/go/tools/builders/compilepkg.go#L490-L492",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "105ca5c635d6f645e4f2cbd15017aa35140b4b14",
      "old_mode": 33188,
      "old_path": "go/tools/builders/stdlib.go",
      "new_id": "573144709049a3ad362fc2256b518f280c05ffd6",
      "new_mode": 33188,
      "new_path": "go/tools/builders/stdlib.go"
    }
  ]
}
