Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: cache conflict with compiler experiment flags #26883

Closed
dsnet opened this issue Aug 8, 2018 · 2 comments
Closed

cmd/go: cache conflict with compiler experiment flags #26883

dsnet opened this issue Aug 8, 2018 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@dsnet
Copy link
Member

dsnet commented Aug 8, 2018

There seems to be cache conflict where the compiler experiment is not part of the hash.

Steps to reproduce (affects go1.10.3 and go1.11.beta3):

# Download the Go toolchain.
mkdir /tmp/cache-conflict
export GOCACHE=/tmp/cache-conflict/cache # clean cache for reproduction purposes
(cd /tmp/cache-conflict/ && curl -s -L https://dl.google.com/go/go1.10.3.src.tar.gz | tar -zxf -)

# Build the Go toolchain normally and use that to build some random target.
(cd /tmp/cache-conflict/go/src && ./make.bash)
/tmp/cache-conflict/go/bin/go build -race archive/tar

# Build the Go toolchain with fieldtracking support and use that to build the same target again.
(cd /tmp/cache-conflict/go/src && GOEXPERIMENT=fieldtrack ./make.bash)
/tmp/cache-conflict/go/bin/go build -race archive/tar

The last command fails with:

# runtime
/tmp/cache-conflict/go/src/runtime/atomic_pointer.go:8:2: import /tmp/cache-conflict/cache/f6/f6a70051462e64c976906382146c2b90e54e5565f3f4bdc9fcd551b422e152aa-d: object is [darwin amd64 go1.10.3 X:framepointer] expected [darwin amd64 go1.10.3 X:fieldtrack,framepointer]

Clearing the cache with /tmp/cache-conflict/go/bin/go clean -cache fixes the problem.

\cc @bcmills @rsc

@ianlancetaylor ianlancetaylor changed the title cmd/compile: cache conflict with compiler experiment flags cmd/go: cache conflict with compiler experiment flags Aug 8, 2018
@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 8, 2018
@ianlancetaylor ianlancetaylor added this to the Go1.11 milestone Aug 8, 2018
@ianlancetaylor
Copy link
Contributor

@dsnet Can you see if CL 128735 fixes the problem?

@gopherbot
Copy link

Change https://golang.org/cl/128735 mentions this issue: cmd/go: include experiments in compiler tool ID

@golang golang locked and limited conversation to collaborators Aug 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants