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

Comments

Projects
None yet
3 participants
@dsnet
Copy link
Member

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 this to the Go1.11 milestone Aug 8, 2018

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Aug 8, 2018

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

@gopherbot

This comment has been minimized.

Copy link

commented Aug 8, 2018

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

@gopherbot gopherbot closed this in 0cac563 Aug 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.