Skip to content

Commit

Permalink
cmd/dist: skip the staleness check for 'cmd' when testing on aix-ppc64
Browse files Browse the repository at this point in the history
The gcc toolchain on the aix-ppc64 builder apparently does not achieve
reproducible builds for packages that use cgo, which causes the
binaries in cmd that use package "net" (cmd/go, cmd/pprof, and
cmd/trace) to appear stale whenever the Go build cache is cleared.

For now, we work around the staleness by rebuilding std and simply not
checking whether cmd is stale.

For #56896.
Updates #47257.

Change-Id: I15f86e72dee53904b881710d5d5d613872361510
Reviewed-on: https://go-review.googlesource.com/c/go/+/452680
Run-TryBot: Bryan Mills <[email protected]>
Reviewed-by: Ayappan Perumal <[email protected]>
Auto-Submit: Bryan Mills <[email protected]>
Reviewed-by: Russ Cox <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
  • Loading branch information
Bryan C. Mills authored and gopherbot committed Nov 22, 2022
1 parent 6ca3acc commit 5b1b080
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/cmd/dist/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func (t *tester) run() {
}

if !t.listMode {
if os.Getenv("GO_BUILDER_NAME") == "" {
if builder := os.Getenv("GO_BUILDER_NAME"); builder == "" {
// Complete rebuild bootstrap, even with -no-rebuild.
// If everything is up-to-date, this is a no-op.
// If everything is not up-to-date, the first checkNotStale
Expand All @@ -185,7 +185,15 @@ func (t *tester) run() {
// running dist test, so rebuild (but don't install) std and cmd to make
// sure packages without install targets are cached so they are not stale.
goCmd("go", "build", "std", "cmd") // make sure dependencies of targets are cached
checkNotStale("go", "std", "cmd")
if builder == "aix-ppc64" {
// The aix-ppc64 builder for some reason does not have deterministic cgo
// builds, so "cmd" is stale. Fortunately, most of the tests don't care.
// TODO(#56896): remove this special case once the builder supports
// determistic cgo builds.
checkNotStale("go", "std")
} else {
checkNotStale("go", "std", "cmd")
}
}
}

Expand Down

0 comments on commit 5b1b080

Please sign in to comment.