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: behavior of @latest is confusing #32846

Closed
bcmills opened this issue Jun 28, 2019 · 2 comments
Closed

cmd/go: behavior of @latest is confusing #32846

bcmills opened this issue Jun 28, 2019 · 2 comments
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Jun 28, 2019

In the Go 1.13 cycle, we made a couple of changes to go get -u:

Those changes individually makes sense, but combined they produce a counter-intuitive result: an explicit go get foo@latest does not downgrade to the latest release, when it arguably should. That makes issues like #32805 more subtle to diagnose, because commands like go get golang.org/x/tools/gopls@latest are unexpectedly sensitive to the initial state.

I talked with @jayconrod and @rsc about this result, and we have a consensus about what to do about it. The current plan (for Go 1.13!) is:

  • Add an @upgrade suffix, with the meaning “@latest, but only if newer than the active version”.
  • Make -u without arguments apply @upgrade (instead of @latest) to the named arguments and their dependencies.
  • Reject -u=latest (as it was in Go 1.12), so that the supported arguments to -u are only those whose behavior depends on the active version.
    • But continue to support @latest as an explicit suffix, with its meaning from Go 1.12 (always the latest release version, even if that is a downgrade from the currently active version).
  • For arguments passed to go get without an explicit suffix:
    • Retain the current (go1.13beta1) behavior of -u=patch, which implicitly adds the @patch suffix.
    • Retain the current (go1.13beta1) behavior when -u is unset, which upgrades (but does not downgrade) only the named arguments.
      • This behavior will now corresponds to the @upgrade suffix instead of @latest.

@jayconrod has volunteered to implement this fix.

CC @thepudds @myitcv @leitzler @hyangah

@bcmills bcmills added NeedsFix The path to resolution is known, but the work has not been done. release-blocker modules labels Jun 28, 2019
@bcmills bcmills added this to the Go1.13 milestone Jun 28, 2019
@gopherbot
Copy link

Change https://golang.org/cl/184440 mentions this issue: cmd/go: restore @latest behavior and support @upgrade in 'go get'

@gopherbot
Copy link

Change https://golang.org/cl/184920 mentions this issue: cmd/go: update tests for new @upgrade query

gopherbot pushed a commit that referenced this issue Jul 3, 2019
This should have been part of CL 184440.

Updates #32846

Change-Id: I78a1326f4a67b3b526859bd15cb9653b4a8551a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/184920
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@golang golang locked and limited conversation to collaborators Jul 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

3 participants