-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: go mod tidy reverts upgrade #38985
Comments
After the first
The second
In order to perform the downgrade, There isn't a way to use these three versions together while keeping MVS happy.
|
Thinking about what we should do here: #33284 is related. Each In general, the behavior of removing requirements during a downgrade seems strange to me. They'll almost always be added back by the next build command or cc @matloob |
This is not a downgrade; it's a later version. Is there an issue therefore with the pseudo version calculated for the later version?
|
It's chronologically newer, but MVS just looks at the versions themselves, and In this case, it doesn't look like it's possible to construct a valid pseudo-version for the same commit that compares higher than
|
Ah thank you for that analysis. In which case I think this is an issue to raise on @dominikh's side because the situation is a function of the versioning strategy for that project. Thanks very much @jayconrod - would you like me to leave this open for the other points you raised above? |
Sounds good, let's close this then. I'd still be curious what folks think about |
This seems to make it difficult to use release branches? All my tagged releases are on release branches, at commits that are specific to the release branch. No tagged release will be an ancestor of the master branch. How would a user create a pseudo-version for a commit referring to master in that case? |
Re-opening on the basis @dominikh's comment seems related to the issue as reported. @jayconrod - please close/redirect as appropriate, just didn't want you to miss the response. |
@dominikh, if you apply tags only to release branches, then you should also tag corresponding pre-release tags to the development branch to inform the For example, if you cut a |
Thank you @bcmills, I will explore that and plan fixing my tags :-) |
Maybe we should document this somewhere clearly. I've done bugfix releases in release branches via cherry-picking in a few projects (just like the Go repo does), so I probably have the same issue - I just never noticed. |
CL 229678 adds some documentation about pseudo-versions. Most of the detail is already in https://tip.golang.org/ref/mod#go-get will be the reference on What else would be helpful? |
The advice in #38985 (comment) for module authors regarding release branches I suspect? |
Sounds good. I've added a note to #33637 to document this. |
@jayconrod golang/mock has this same bug today; master is newer software, but it gets the version v1.4.4-0.20210128224731-b9a8584115bc since the v1.4.4 tag was done in a separate branch. Have the authoritative docs for this been written yet? I saw the downgrade section, but that's not what I want here. I want something like #38985 (comment) :) I can use that link for now, but I just want to ensure this is being tracked. I could not find a reference to "branch" or "downgrade" in #33637 (other than the section I already linked to). |
I'm also just realising that this is a more widespread problem than we think. my For those two modules, it probably doesn't cause actual bugs in practice, since it is not common for many modules to indirectly depend on either of them at the same time, forcing a MVS upgrade. I imagine it happened with golang/mock since it's a common test dependency; if you want an "older but actually newer" v1.4.4-0.20210128224731-b9a8584115bc and one of your dependencies wants the "newer but actually older" v1.4.4, you get the bug. |
@mvdan I don't think this is explicitly called out in https://golang.org/ref/mod yet. I need to go through comments in #33637 and make sure everything is covered before closing that issue out. This seems like something that should be called out in Pseudo-versions with cross-references in a couple other relevant sections. |
Ah, thanks. I had entirely missed #33637 (comment) as it was hidden by GitHub. |
Thanks @mvdan for bringing this to our (Tendermint's) attention as an example team causing problems with our release tags :) One thought, from Tendermint's perspective: In an ideal world, people wouldn't actually be able to automatically "upgrade" to |
I think this already happens if your tags and branches follow semver. If a user is on the latest v0.34.2 tag, any automatic upgrades or |
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?
At this point you should see
go.mod
as:Now run
go mod tidy
andgo.mod
looks like this:Notice how both
golang.org/x/tools/gopls
andhonnef.co/go/tools
have reverted to earlier versions that those requested viago get
above.What did you expect to see?
As above.
What did you see instead?
As above
Is this related to #27899?
cc @bcmills @jayconrod
The text was updated successfully, but these errors were encountered: