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: 'go get -d all' no longer works when a deleted transitive dependency is no longer needed after upgrading #47303

Open
bcmills opened this issue Jul 20, 2021 · 2 comments
Assignees
Labels
GoCommand modules NeedsInvestigation
Milestone

Comments

@bcmills
Copy link
Member

@bcmills bcmills commented Jul 20, 2021

go get -d all used to work in some situations in which it no longer does.

It appears that as of Go 1.16, it first resolves all to a package pattern, then attempts to install the latest version of each such package. If some of those packages have been deleted, it fails.

In Go 1.15 and earlier, it did something closer to what go get -u -t ./... does today: it upgraded (some subset of) direct imports and then upgraded transitive dependencies from there.

As a workaround, go get -d -u -t ./... achieves essentially the same set of upgrades, but go get -d all ought to be a reasonable alternative.

$ go1.17rc1 get -d all
go get all: module google.golang.org/protobuf@upgrade found (v1.27.1), but does not contain package google.golang.org/protobuf/internal/fieldsort
go get all: module google.golang.org/protobuf@upgrade found (v1.27.1), but does not contain package google.golang.org/protobuf/internal/mapsort

$ go1.16.6 get -d all
go get all: module google.golang.org/protobuf@upgrade found (v1.27.1), but does not contain package google.golang.org/protobuf/internal/fieldsort
go get all: module google.golang.org/protobuf@upgrade found (v1.27.1), but does not contain package google.golang.org/protobuf/internal/mapsort

$ go1.15.14 get -d all
go: github.com/google/go-cmp upgrade => v0.5.6
go: google.golang.org/protobuf upgrade => v1.27.1
go: golang.org/x/xerrors upgrade => v0.0.0-20200804184101-5ec99f83aff1

$ go1.17rc1 get -d -u -t ./...
go get: upgraded google.golang.org/protobuf v1.25.0 => v1.27.1

-- go.mod --
module example.com/m

go 1.16

require google.golang.org/protobuf v1.25.0
-- main.go --
package main

import _ "google.golang.org/protobuf/proto"
@bcmills bcmills added NeedsInvestigation GoCommand modules labels Jul 20, 2021
@bcmills bcmills added this to the Go1.18 milestone Jul 20, 2021
@bcmills
Copy link
Member Author

@bcmills bcmills commented Jul 20, 2021

@bcmills bcmills changed the title cmd/go: cmd/go: 'go get -d all' no longer works when a deleted transitive dependency is no longer needed after upgrading Jul 20, 2021
@bcmills bcmills self-assigned this Jul 20, 2021
@bcmills
Copy link
Member Author

@bcmills bcmills commented Jul 20, 2021

Since nobody reported this against Go 1.16, and given that go get -d -u -t ./... works as a workaround, I suspect that it is not severe enough to warrant a backport. (That said, if the fix patches cleanly onto Go 1.16 I think it would be fine to backport too. Go 1.15 is not affected either way.)

@bcmills bcmills removed this from the Go1.18 milestone Nov 10, 2021
@bcmills bcmills added this to the Backlog milestone Nov 10, 2021
@bcmills bcmills removed this from the Backlog milestone Nov 10, 2021
@bcmills bcmills added this to the Go1.19 milestone Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand modules NeedsInvestigation
Projects
None yet
Development

No branches or pull requests

1 participant