]> Cypherpunks repositories - gostls13.git/commit
cmd/go: update build info when updating PGO file
authorMichael Pratt <mpratt@google.com>
Mon, 22 May 2023 18:14:44 +0000 (14:14 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 24 May 2023 14:13:41 +0000 (14:13 +0000)
commit227e7126857df9f73863fc60090976b98fa9dd4e
treee2a1b5b858ac3e05b688f3bd716e44be002b56db
parentc7f0a8c443d91a7dcf5962936903aff7e43124cb
cmd/go: update build info when updating PGO file

setPGOProfilePath sets Package.Internal.PGOProfile very late in package
loading (because it may split/copy packages). Build info was computed
long before this, causing PGO packages to miss -pgo from their build
settings.

Adjust BuildInfo to be stored as *debug.BuildInfo rather than eagerly
converting to a string. This enables setPGOProfilePath to update the
BuildInfo at the same point that it sets PGOProfile.

Change-Id: Ic12266309bfd0f8ec440b0dc94d4df813b27cb04
Reviewed-on: https://go-review.googlesource.com/c/go/+/496958
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Michael Pratt <mpratt@google.com>
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/load/test.go
src/cmd/go/internal/work/exec.go
src/cmd/go/testdata/script/build_pgo.txt
src/cmd/go/testdata/script/build_pgo_auto.txt
src/cmd/go/testdata/script/build_pgo_auto_multi.txt