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 #33091

Closed
dsnet opened this issue Jul 12, 2019 · 2 comments
Closed

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

dsnet opened this issue Jul 12, 2019 · 2 comments
Labels
FrozenDueToAge GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@dsnet
Copy link
Member

dsnet commented Jul 12, 2019

This is a re-issue of #26883, which was fixed and then broken again.

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

Steps to reproduce:

# 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.12.7.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/alg.go:8:2: import /tmp/cache-conflict/cache/28/2829dcccd09b7c1ac1694d626da6e06a28de4470a18c47b518bc0236aa533c48-d: object is [darwin amd64 go1.12.7 X:framepointer
] expected [darwin amd64 go1.12.7 X:fieldtrack,framepointer
]

\cc @rsc @ianlancetaylor

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 14, 2019
@dmitshur dmitshur added this to the Go1.13 milestone Jul 14, 2019
@dmitshur dmitshur added the GoCommand cmd/go label Jul 14, 2019
@jayconrod
Copy link
Contributor

It looks like the most recent change here was CL 149338. The go command invokes the compiler with -V=full to get the version. For a released version, the output looks like:

compile version go1.13beta1 X:framepointer

For a released version, the Go command only includes the version in the tool ID. It should include the version and everything after.

For a development version, it will include the content ID (stamped SHA-256) of the binary, so that shouldn't be a problem.

@jayconrod jayconrod self-assigned this Jul 15, 2019
@jayconrod jayconrod added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jul 15, 2019
@gopherbot
Copy link

Change https://golang.org/cl/186200 mentions this issue: cmd/go: include GOEXPERIMENT flags in tool id for cache key

@golang golang locked and limited conversation to collaborators Jul 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants