cmd/go: module cache can cache inappropriate commits #29099
Labels
FrozenDueToAge
GoCommand
cmd/go
modules
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I was building a module with a dependency that had been forked.
The
go.mod
file specified this dependency.Note that commit a27b59fe2be9 does not appear in the
github.com/altoros/gosigma
repository, although it does appear in a PR on that repository. The dependency does not contain ago.mod
file.The commit is also in a fork of the repository at its HEAD (
github.com/juju/gosigma
).My build succeeds locally, and I can see that somehow that commit has made its way into $GOPATH/pkg/mod:
When I pushed my package to be tested with CI, the CI failed because it could not find
github.com/altoros/[email protected]
.Unfortunately, I don't know how this happened, but I'm recording the issue here as a placeholder in case other people see the same thing. When I tried to reproduce the issue, I failed. I tried with a fresh GOPATH and
go get github.com/juju/[email protected]
, in case that would poison the cache, but it didn't.What did you expect to see?
I expected to get a build failure locally.
What did you see instead?
The build succeeded locally but failed with a fresh $GOPATH.
The text was updated successfully, but these errors were encountered: