-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: go get tries to download non-existing commit #33076
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
Comments
This issue does not reproduce for me with
Nor does it reproduce if the
The failure mode with
I can reproduce the failure mode you observed with
That comes from an explicit requirement here, and that error message is also accurate: the repository at https://github.com/nats-io/nats.go contains no such commit. Sorry, but this is not a bug in the |
There is no 1.8.2 release, so this is from a commit on master most likely that may no longer exist. |
Yes: judging by the pseudo-version, it is specifically a commit on master at some point after the |
Yes, I guess that's exactly the case. However, my question is why it tries to find this non-existing commit, instead of using existing latest tag 1.8.1? Wouldn't be that expected behaviour? |
@ayzu, builds using Go modules are expected to be 100% reproducible. If the configuration required for a reproducible build cannot be obtained, that results in an error rather than a silent change in behavior. Note that you can explicitly change the behavior by adding a
|
(And note that, at least for now, you can explicitly set |
Yes, this is the exact issue. It tries to find non-existing commit and fails. Is it expected behaviour? The dependency in go.mod file is From wiki:
In my understanding Moreover, this commit Could you please elaborate why |
Is it listed in the go.sum? |
You mean in go-plugins repository? https://github.com/micro/go-plugins/blob/6eef94c098315c5cfc03334fbcb5f8d43b1ca04a/go.sum#L523 Yes, it is listed: github.com/nats-io/go-nats v1.7.0 h1:oQOfHcLr8hb43QG8yeVyY2jtarIaTjOv41CGdF3tTvQ= |
There is something more interesting. If I have a direct dependency But if try to download the exact dependency
So, it looks like behaviour differs for those use cases. |
Yes, it comes from v.1.1.1 But I specifically identify the version in the command: So why v1.0.0 version uses go.mod file from other verion (v1.1.1)? |
See #29121. |
Could you please specify how the mentioned #29121 relates to my question? As far as I understand, the mentioned problem was that go mod assigned incorrect pseudo-tag (starting with v2.0.0) to a commit. The issue was solved, and the commit was assigned a correct pseudo-version In this case, we have a pseudo-tag 1.8.2. This pseudo-tag is correct because the dependency identifies itself as However, my question was - why do |
@ayzu, #29121 causes |
Ok, thank you. I was under assumption that the mentioned issue has happened because kubernetes didn't followed semver. So there is a bug in 1.12: one specifies a version "go get some/package@v1.0.8", but 'go get' downloads the latest version instead. As far understand, this bug occur only in some cases? |
Yes. Specifically, it occurs when the argument to (The |
Ok, thank for your time and effort. Nice to hear that this bag was already fixed. |
It turns out that that commit never should have been resolvable in the first place (see #31191): github.com/nats-io/nats.go@9f4d16fe7c2d was a PR, and was merged as commit 3d6c21bef4f7 instead. That at least gives you a more precise target for a |
Ok, now I have got the title of the issue: 'go get @' should not fall back to 'latest' if does not provide I.e., |
Please answer these questions before submitting your issue. Thanks!
What did you do?
What did you expect to see?
successful download of dependency
What did you see instead?
Does this issue reproduce with the latest release (go1.12.7)?
yes
System details
go version go1.12.7 darwin/amd64
Note:
The case is that
github.com/micro/go-plugins@v1.0.0
has a mod filehttps://github.com/micro/go-plugins/blob/v1.0.0/go.mod
which requiresgithub.com/nats-io/go-nats v1.7.0
Repository
github.com/nats-io/go-nats
is archived and probably redirects tohttps://github.com/nats-io/nats.go
.However,
github.com/nats-io/nats.go
does not have commit9f4d16fe7c2d
at all. Probably, it was here at some point but then was removed. Sogo get
tries download non-existing commit from the master branch instead of latest tag1.8.1
ingithub.com/nats-io/nats.go
.The same error will pop up, if we specify the dependency in
go.mod
and rungo build
.The text was updated successfully, but these errors were encountered: