aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/dist
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2021-04-08 12:50:39 -0400
committerAustin Clements <austin@google.com>2021-04-08 19:52:03 +0000
commit793844207d81bdc41212bc300195469c65c39766 (patch)
tree493eb3fbd6a80185da11259428c589fa946bd5b3 /src/cmd/dist
parent98dd205fa4f125c8ba8099c3d84d95189666068e (diff)
downloadgo-793844207d81bdc41212bc300195469c65c39766.tar.gz
go-793844207d81bdc41212bc300195469c65c39766.zip
cmd/go: strip GOEXPERIMENT from hash salt
The go command salts cache hashes using runtime.Version() (the Go version the go command was built with) in order to separate objects built with different versions of Go. CL 307820 added the active GOEXPERIMENTs to the result of runtime.Version, which affected cmd/go's hash salt. Since dist builds go_bootstrap with all GOEXPERIMENTs disabled, but then go_bootstrap builds the final go binary with the GOEXPERIMENTs passed to make.bash, if any GOEXPERIMENTs were passed, go_bootstrap and the final go binary produce different cache hashes. At the very end of dist, it uses the final go binary to check the hashes of all packages, but these hashes were produced by go_bootstrap, so it concludes everything is stale. This should fix the builders that enable GOEXPERIMENTs, including the regabi and staticlockranking builders. Change-Id: Ie389929dff6f7b6eff2b19a2f43507e72be5f32e Reviewed-on: https://go-review.googlesource.com/c/go/+/308591 Trust: Austin Clements <austin@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/dist')
-rw-r--r--src/cmd/dist/build.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
index 8accb6db8f..f8f8003ff7 100644
--- a/src/cmd/dist/build.go
+++ b/src/cmd/dist/build.go
@@ -1541,7 +1541,7 @@ func checkNotStale(goBinary string, targets ...string) {
break
}
}
- fatalf("unexpected stale targets reported by %s list -gcflags=\"%s\" -ldflags=\"%s\" for %v:\n%s", goBinary, gogcflags, goldflags, targets, out)
+ fatalf("unexpected stale targets reported by %s list -gcflags=\"%s\" -ldflags=\"%s\" for %v (consider rerunning with GOMAXPROCS=1 GODEBUG=gocachehash=1):\n%s", goBinary, gogcflags, goldflags, targets, out)
}
}