From de01f140e5d02c45101bd1b4493cf0ee9e808b98 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 22 Jul 2024 17:11:21 -0400 Subject: [PATCH] sweet/harnesses: bypass Go build version check in github.com/cockroachdb/swiss Without this, CockroachDB can't build at tip. Change-Id: Icb7e969e1f7cfb98f15f1f2991213ab67bcb0124 Reviewed-on: https://go-review.googlesource.com/c/benchmarks/+/600196 Reviewed-by: Michael Knyszek Auto-Submit: Austin Clements LUCI-TryBot-Result: Go LUCI --- sweet/harnesses/cockroachdb.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sweet/harnesses/cockroachdb.go b/sweet/harnesses/cockroachdb.go index 79be846..75a4b86 100644 --- a/sweet/harnesses/cockroachdb.go +++ b/sweet/harnesses/cockroachdb.go @@ -106,8 +106,12 @@ func (h CockroachDB) Build(cfg *common.Config, bcfg *common.BuildConfig) error { // to build cockroach. However, benchmark release branches are on older // versions that don't recognize the flag. Try first with the flag and // again without if there is an error. - if buildWithFlagErr := cfg.GoTool().BuildPath(filepath.Join(bcfg.SrcDir, "pkg/cmd/cockroach-short"), bcfg.BinDir, "-ldflags=-checklinkname=0"); buildWithFlagErr != nil { - if buildWithoutFlagErr := cfg.GoTool().BuildPath(filepath.Join(bcfg.SrcDir, "pkg/cmd/cockroach-short"), bcfg.BinDir); buildWithoutFlagErr != nil { + // + // Cockroachdb reaches into runtime internals, so it has a negative build + // tag to exclude unreleased Go versions. Set untested_go_version so we can + // run at tip (and cross our fingers). + if buildWithFlagErr := cfg.GoTool().BuildPath(filepath.Join(bcfg.SrcDir, "pkg/cmd/cockroach-short"), bcfg.BinDir, "-tags=untested_go_version", "-ldflags=-checklinkname=0"); buildWithFlagErr != nil { + if buildWithoutFlagErr := cfg.GoTool().BuildPath(filepath.Join(bcfg.SrcDir, "pkg/cmd/cockroach-short"), bcfg.BinDir, "-tags=untested_go_version"); buildWithoutFlagErr != nil { return errors.Join(buildWithFlagErr, buildWithoutFlagErr) } }