Skip to content

Commit c34a208

Browse files
prattmicgopherbot
authored andcommitted
sweet/harnesses: log which go-build package fails to build
For golang/go#53572. Change-Id: I6a90f20d7032b3e2d3989ae7357d0340854b5f64 Reviewed-on: https://go-review.googlesource.com/c/benchmarks/+/414396 TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Michael Pratt <[email protected]> Auto-Submit: Michael Pratt <[email protected]> Reviewed-by: Bryan Mills <[email protected]>
1 parent 0fc6e7c commit c34a208

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

sweet/harnesses/go-build.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package harnesses
66

77
import (
8+
"fmt"
89
"os/exec"
910
"path/filepath"
1011

@@ -91,10 +92,14 @@ func (h GoBuild) Build(cfg *common.Config, bcfg *common.BuildConfig) error {
9192
pkgPath := filepath.Join(bcfg.BinDir, bench.name, bench.pkg)
9293
dummyBin := filepath.Join(bcfg.BinDir, "dummy")
9394
if err := cfg.GoTool().BuildPath(pkgPath, dummyBin); err != nil {
94-
return err
95+
return fmt.Errorf("error building %s %s: %w", bench.name, bench.pkg, err)
9596
}
9697
}
97-
return cfg.GoTool().BuildPath(bcfg.BenchDir, filepath.Join(bcfg.BinDir, "go-build-bench"))
98+
99+
if err := cfg.GoTool().BuildPath(bcfg.BenchDir, filepath.Join(bcfg.BinDir, "go-build-bench")); err != nil {
100+
return fmt.Errorf("error building go-build tool: %w", err)
101+
}
102+
return nil
98103
}
99104

100105
func (h GoBuild) Run(cfg *common.Config, rcfg *common.RunConfig) error {

0 commit comments

Comments
 (0)