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 list of stdlib packages that depend on vendored packages downloads, doesn't work #28375

Closed
heschik opened this issue Oct 24, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@heschik
Copy link
Contributor

commented Oct 24, 2018

It's a weird thing to do, but I figured I'd note it for the record.

If for some reason you do go list on a vendored package in the stdlib, the upstream version gets downloaded, and of course doesn't work:

GOPATH=$(pwd)/gopath GO111MODULE=on go list cmd/vendor/github.com/google/pprof/internal/plugin
go: finding github.com/google/pprof/profile latest
go: finding github.com/google/pprof latest
go: downloading github.com/google/pprof v0.0.0-20181022170640-baeddb81b1fb
can't load package: $GOROOT/src/cmd/vendor/github.com/google/pprof/internal/plugin/plugin.go:24:2: non-standard import "github.com/google/pprof/profile" in standard package "cmd/vendor/github.com/google/pprof/internal/plugin"

I'm not sure what I was expecting, probably some kind of error, but downloading the upstream version was surprising.

@heschik heschik added the modules label Oct 24, 2018

@heschik

This comment has been minimized.

Copy link
Contributor Author

commented Oct 25, 2018

Actually, it's worse than that -- it downloads them even if they're just dependencies:

GOPATH=$(mktemp -d) go list -- runtime/pprof net/http/pprof cmd/pprof .               
go: finding github.com/google/pprof v0.0.0-20181025074646-b44fece90146
go: finding github.com/ianlancetaylor/demangle v0.0.0-20180714043527-fcd258a6f0b4
go: finding golang.org/x/sys v0.0.0-20181025063200-d989b31c8746
go: finding golang.org/x/arch v0.0.0-20180920145803-b19384d3c130
go: finding golang.org/x/crypto v0.0.0-20181025213731-e84da0312774
go: downloading golang.org/x/crypto v0.0.0-20181025213731-e84da0312774
go: downloading golang.org/x/arch v0.0.0-20180920145803-b19384d3c130
go: downloading github.com/google/pprof v0.0.0-20181025074646-b44fece90146
go: downloading golang.org/x/sys v0.0.0-20181025063200-d989b31c8746
go: downloading github.com/ianlancetaylor/demangle v0.0.0-20180714043527-fcd258a6f0b4
can't load package: /usr/lib/google-golang/src/cmd/pprof/pprof.go:28:2: non-standard import "github.com/google/pprof/driver" in standard package "cmd/pprof"
runtime/pprof
net/http/pprof
testmod

@heschik heschik changed the title cmd/go: go list cmd/vendor/<whatever> downloads cmd/go: go list of stdlib packages that depend on vendored packages downloads, doesn't work Oct 25, 2018

@bcmills

This comment has been minimized.

Copy link
Member

commented Nov 19, 2018

Same underlying problem as #26924, I believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.