golang/go

cmd/go: staleness-related failures in make.bash

Closed this issue · 7 comments

What version of Go are you using (go version)?

tip 18525735

Does this issue reproduce with the latest release?

Unlikely. This didn't happen on tip as of bc723cf3

What operating system and processor architecture are you using (go env)?

Darwin/amd64

What did you do?

./make.bash

Make some debug logging changes to the compiler (specifically cmd/compile/internal/gc/inl.go), all gated behind appropriate Debug check to avoid impacting the compiler build/test flow.

./make.bash

What did you expect to see?

Building Go cmd/dist using /usr/local/Cellar/go/1.9.1/libexec.
Building Go toolchain1 using /usr/local/Cellar/go/1.9.1/libexec.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for darwin/amd64.
---
Installed Go for darwin/amd64 in /Users/hugues/go
Installed commands in /Users/hugues/go/bin

What did you see instead?

Building Go cmd/dist using /usr/local/Cellar/go/1.9.1/libexec.
Building Go toolchain1 using /usr/local/Cellar/go/1.9.1/libexec.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for darwin/amd64.
go tool dist: unexpected stale targets reported by /Users/hugues/go/pkg/tool/darwin_amd64/go_bootstrap list -gcflags="" -ldflags="" for [std cmd]:
	cmd/go: build ID mismatch
	cmd/gofmt: build ID mismatch

NB: once this error shows up, it persists until a run of ./clean.bash

@rsc This seems likely to be related to your recent changes to cmd/go and/or cmd/dist

Can you show us exactly what you changed? Thanks.

@ianlancetaylor Of course:

diff --git a/src/cmd/compile/internal/gc/inl.go b/src/cmd/compile/internal/gc/inl.go
index a509d2d648..b3919bc0d1 100644
--- a/src/cmd/compile/internal/gc/inl.go
+++ b/src/cmd/compile/internal/gc/inl.go
@@ -677,6 +677,9 @@ func (v *reassignVisitor) visit(n *Node) *Node {
        switch n.Op {
        case OAS:
                if n.Left == v.name && n != v.name.Name.Defn {
+                       if Debug['m'] > 1 {
+                               fmt.Printf("%p %p\n%+v\n%+v\n", n, v.name.Name.Defn, n, v.name.Name.Defn)
+                       }
                        return n
                }
                return nil

Still happening on tip as of c4b65fa4. Triggers reliably with as small a change as tweaking an existing format string (no code added/removed).

@rsc anything I can do to help debug this?

rsc commented

What does $GOROOT/VERSION.cache say?

devel +c4b65fa4cc Sun Nov 5 04:18:05 2017 +0000

NB: GOROOT is not set in my environment. This is the content of VERSION.cache in the root of my local copy of this repo.

edit: setting GOROOT doesn't have any impact on this issue. The content of VERSION.cache remains unchanged even after multiple ./make.bash / ./clean.bash

rsc commented

Reproduced at least.

Change https://golang.org/cl/76014 mentions this issue: cmd/go: fix corner case missed rebuild of binary