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: add -e flag to 'go get -u' #53737

Open
josharian opened this issue Jul 7, 2022 · 4 comments
Open

cmd/go: add -e flag to 'go get -u' #53737

josharian opened this issue Jul 7, 2022 · 4 comments

Comments

@josharian
Copy link
Contributor

@josharian josharian commented Jul 7, 2022

A missing dependency currently blocks go get -u from working at all. For a concrete example, see #28424 (comment).

go mod tidy and go mod vendor have a -e flag that means: "attempt to proceed despite errors
encountered while loading packages". I propose that we add an analogous -e flag to go get -u.

cc @bcmills

@gopherbot gopherbot added this to the Proposal milestone Jul 7, 2022
@bcmills bcmills added the GoCommand label Jul 7, 2022
@bcmills
Copy link
Member

@bcmills bcmills commented Jul 7, 2022

This would make it easier to start an upgrade by running go get -e -u ./... and then fixing up the build failures through subsequent code changes (such as adjusting import statements within the main module). That seems like a completely reasonable workflow to me.

We do already have some logic in module-mode go get that attempts to suppress errors for transitive imports for as long as possible:
https://cs.opensource.google/go/go/+/master:src/cmd/go/internal/modget/get.go;l=1072-1084;drc=19309779ac5e2f5a2fd3cbb34421dafb2855ac21

So I think this would probably boil down to suppressing a couple of calls to base.SetExitStatus very late in the go get command:
https://cs.opensource.google/go/go/+/master:src/cmd/go/internal/modget/get.go;l=1476-1494;drc=19309779ac5e2f5a2fd3cbb34421dafb2855ac21

For such a low cost, this seems worth the usability benefit.

@ianlancetaylor ianlancetaylor added this to Incoming in Proposals Jul 13, 2022
@rsc rsc moved this from Incoming to Active in Proposals Jul 13, 2022
@rsc
Copy link
Contributor

@rsc rsc commented Jul 13, 2022

This proposal has been added to the active column of the proposals project
and will now be reviewed at the weekly proposal review meetings.
— rsc for the proposal review group

@rsc rsc moved this from Active to Likely Accept in Proposals Jul 20, 2022
@rsc
Copy link
Contributor

@rsc rsc commented Jul 20, 2022

Based on the discussion above, this proposal seems like a likely accept.
— rsc for the proposal review group

@rsc rsc moved this from Likely Accept to Accepted in Proposals Jul 27, 2022
@rsc
Copy link
Contributor

@rsc rsc commented Jul 27, 2022

No change in consensus, so accepted. 🎉
This issue now tracks the work of implementing the proposal.
— rsc for the proposal review group

@rsc rsc changed the title proposal: cmd/go: add -e flag to 'go get -u' cmd/go: add -e flag to 'go get -u' Jul 27, 2022
@rsc rsc modified the milestones: Proposal, Backlog Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Proposals
Accepted
Development

No branches or pull requests

4 participants