]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: skip the staleness check for 'cmd' when testing on aix-ppc64
authorBryan C. Mills <bcmills@google.com>
Tue, 22 Nov 2022 05:27:07 +0000 (00:27 -0500)
committerGopher Robot <gobot@golang.org>
Tue, 22 Nov 2022 15:58:21 +0000 (15:58 +0000)
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 <bcmills@google.com>
Reviewed-by: Ayappan Perumal <ayappanec@gmail.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/dist/test.go

index 3f16fc3e086046096c1ff3993a26ce7c3b9334c0..eadca9c08feb538da282b38e68d0cffde46935e4 100644 (file)
@@ -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
@@ -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")
+                       }
                }
        }