sweet: rebuild cmd/compile and cmd/link for go-build benchmark
go-build is a subtly strange benchmark. For every other benchmark, sweet
builds the benchmarked program in set up, using Config.BuildEnv.
go-build does not do that because the benchmarked programs (cmd/compile,
cmd/link, and (to a lesser degree) cmd/go) are conveniently prebuilt in
But this breaks the intuition that BuildEnv can control build flags for
the benchmarked program, particularly for sweet run -pgo, where sweet
itself expects a PGO flag in BuildEnv to impact the benchmarked program.
Adjust go-build to follow these standards by copying GOROOT for each
config and running `go install cmd/compile cmd/link` in the copied
GOROOT, allowing BuildEnv to take effect.
This fixes the general case for PGO, though it could use more work as
really cmd/compile and cmd/link should receive _different_ PGO profiles.
We also run the dummy build with the ExecEnv (matching how the actual
benchmark will run) to avoid passing -pgo to those builds.
Reviewed-by: Michael Knyszek <firstname.lastname@example.org>
Run-TryBot: Michael Pratt <email@example.com>
TryBot-Result: Gopher Robot <firstname.lastname@example.org>
1 file changed