-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
proposal: cmd/go: list available major versions in 'go list -u -m all' #51491
Comments
Should the output perhaps clarify that new major versions may require a new |
Given that major upgrades will always require more work both to query and to do the actual upgrade, maybe it would make sense to put this behind a flag? Or maybe #29666 How would this information be represented in Does this interact with the |
cc @icholy for input/experience based on https://github.com/icholy/gomajor |
This proposal has been added to the active column of the proposals project |
AFAIK, doing this properly is currently expensive. I currently use tooling that tracks & caches the Index to detect new major versions. Other tools try querying version N+1, but this fails when major versions are skipped. In any case, I think the user experience is more important. Any query costs should be reduced. The module proxy protocol probably needs to be updated for this use case. Perhaps by adding a
(just examples -- those decisions should be left to the module authors) |
Currently Moreover, we have only had support for module deprecation notices since Go 1.17. I don't think we have yet had enough time to see how well that addresses the problem space, but it does at least afford the opportunity to list related or recommended substitute modules (as described by @mpx). |
I also want to note that We probably ought to have some kind of substitute for that — maybe allowing |
It sounds like we shouldn't do this specifically, and that we should encourage people who want to deprecate their major version to use module deprecation notices, as @bcmills pointed out. |
Based on the discussion above, this proposal seems like a likely decline. |
No change in consensus, so declined. |
In #44550 (comment), Russ wrote:
In addition to the locations Russ mentioned, it would be helpful to expose the existence of a major version upgrade in 'go list -u -m all'.
I think this would help reduce toe-stubbing around major versions.
I believe this has been mentioned as a possibility in the past (e.g., #44550 (comment)), and for example discussed as part of a much broader & complex #40323, but I'm filing this short proposal because I'm not sure there is an existing issue that narrowly targets 'go list -u -m all'.
Spelling
There would need to be a decision on how it would be spelled. Bikeshedding can come later, but it could possibly use words like 'breaking' or 'major' in the output. ('incompat' or 'incompatible' I think would probably confuse people given the '+incompatible' in go.mod. 'latest' might also be best to avoid. It might be nice pick a word that hints you might need to do some work to upgrade).
So perhaps something along the lines of:
But the exact spelling could come later if there is interest in the core capability.
Concerns
One concern expressed in the past I think was people might not like it if they see a major version listed in 'go list -u -m all' that does not get picked up by a subsequent invocation of 'go get -u'. That is a fair concern, but I think it is still a net benefit to be aware of an available major version even if the cmd/go does not automatically upgrade major versions (yet 🤞).
One other concern could be the stability of 'go list' output for programs that parse its output, but it is already somewhat complex and has already changed in the past. Parsing 'go list -u -m all' without using the '-json' flag is probably already a bad idea.
Another concern has been performance for cmd/go. Perhaps parallel requests would make it fast enough for the common case of using a GOPROXY? Also, if it helps, I think it would be reasonable to assume no vN means no need to look for a vN+1 -- in other words, no need to handle holes in the major version numbering if that helps performance at all.
Existing output
For reference, here is some sample output of
go list -u -m all
today:Implementation
If this proposal is accepted, I would be interested in sending a CL.
The text was updated successfully, but these errors were encountered: