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: preceding tags not always fetched when downloading a pseudo-version #47650

Open
bcmills opened this issue Aug 11, 2021 · 9 comments
Open
Assignees
Labels
modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@bcmills
Copy link
Member

bcmills commented Aug 11, 2021

From a report from @hyangah:

$ go1.17rc2 mod init example.com/m
go: creating new go.mod: module example.com/m

$ export GOPRIVATE=github.com/go-delve/delve

$ go1.17rc2 get -d github.com/go-delve/delve/cmd/dlv@v1.7.1-0.20210804080032-f95340ae1bf9
go: downloading github.com/go-delve/delve v1.7.1-0.20210804080032-f95340ae1bf9
go get: github.com/go-delve/delve/cmd/dlv@v1.7.1-0.20210804080032-f95340ae1bf9: invalid pseudo-version: preceding tag (v1.7.0) not found

$ go1.17rc2 get -d github.com/go-delve/delve/cmd/dlv@f95340ae1bf9
go: downloading github.com/sirupsen/logrus v1.6.0
go: downloading github.com/spf13/cobra v1.1.3
go: downloading github.com/mattn/go-isatty v0.0.3
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/cosiner/argv v0.1.0
go: downloading github.com/mattn/go-colorable v0.0.9
go: downloading github.com/peterh/liner v0.0.0-20170317030525-88609521dc4b
go: downloading github.com/google/go-dap v0.5.0
go: downloading golang.org/x/sys v0.0.0-20210514084401-e8d321eab015
go: downloading go.starlark.net v0.0.0-20200821142938-949cc6f4b097
go: downloading github.com/hashicorp/golang-lru v0.5.4
go: downloading golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4
go: downloading github.com/aquasecurity/libbpfgo v0.1.2-0.20210708203834-4928d36fafac
go: downloading github.com/konsorten/go-windows-terminal-sequences v1.0.3
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/inconshreveable/mousetrap v1.0.0
go: downloading github.com/russross/blackfriday/v2 v2.0.1
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
go get: added github.com/aquasecurity/libbpfgo v0.1.2-0.20210708203834-4928d36fafac
go get: added github.com/cosiner/argv v0.1.0
go get: added github.com/cpuguy83/go-md2man/v2 v2.0.0
go get: added github.com/go-delve/delve v1.7.1-0.20210804080032-f95340ae1bf9
go get: added github.com/google/go-dap v0.5.0
go get: added github.com/hashicorp/golang-lru v0.5.4
go get: added github.com/inconshreveable/mousetrap v1.0.0
go get: added github.com/konsorten/go-windows-terminal-sequences v1.0.3
go get: added github.com/mattn/go-colorable v0.0.9
go get: added github.com/mattn/go-isatty v0.0.3
go get: added github.com/peterh/liner v0.0.0-20170317030525-88609521dc4b
go get: added github.com/russross/blackfriday/v2 v2.0.1
go get: added github.com/shurcooL/sanitized_anchor_name v1.0.0
go get: added github.com/sirupsen/logrus v1.6.0
go get: added github.com/spf13/cobra v1.1.3
go get: added github.com/spf13/pflag v1.0.5
go get: added go.starlark.net v0.0.0-20200821142938-949cc6f4b097
go get: added golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4
go get: added golang.org/x/sys v0.0.0-20210514084401-e8d321eab015
go get: added gopkg.in/yaml.v2 v2.4.0
@bcmills bcmills added modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Aug 11, 2021
@bcmills bcmills added this to the Go1.18 milestone Aug 11, 2021
@bcmills bcmills self-assigned this Aug 11, 2021
@bcmills
Copy link
Member Author

bcmills commented Aug 11, 2021

$ git version
git version 2.33.0.rc1.237.g0d66db33f3-goog

(because it isn't clear to me whether this is actually a bug in git or cmd/go.)

@bcmills
Copy link
Member Author

bcmills commented Aug 11, 2021

Interestingly, go1.17rc2 mod download -x github.com/go-delve/delve@v1.7.1-0.20210804080032-f95340ae1bf9 doesn't reproduce the error. So I suspect that this has something to do with looking for nested modules before the root module. (Perhaps we're fetching the nested-module tags but caching them as though we had downloaded the root-module tags?)

@aarzilli
Copy link
Contributor

aarzilli commented Dec 3, 2021

FWIW I'm running into something very similar to this with golang.org/x/tools:

$ go get -u golang.org/x/tools@master
go get: upgraded golang.org/x/mod v0.4.2 => v0.5.1
go get: upgraded golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e => v0.0.0-20211019181941-9d821ace8654
go get: upgraded golang.org/x/tools v0.1.7 => v0.1.8-0.20211202032535-e212aff8fd14
$ go build
../../n/go/pkg/mod/golang.org/x/tools@v0.1.8-0.20211202032535-e212aff8fd14/internal/gocommand/vendor.go:17:2: missing go.sum entry for module providing package golang.org/x/mod/semver (imported by golang.org/x/tools/internal/gocommand); to add:
	go get golang.org/x/tools/internal/gocommand@v0.1.8-0.20211202032535-e212aff8fd14
../../n/go/pkg/mod/golang.org/x/tools@v0.1.8-0.20211202032535-e212aff8fd14/go/packages/external.go:15:2: missing go.sum entry for module providing package golang.org/x/sys/execabs (imported by golang.org/x/tools/go/packages); to add:
	go get golang.org/x/tools/go/packages@v0.1.8-0.20211202032535-e212aff8fd14
$ go get golang.org/x/tools/internal/gocommand@v0.1.8-0.20211202032535-e212aff8fd14
go get: golang.org/x/tools/internal/gocommand@v0.1.8-0.20211202032535-e212aff8fd14: invalid pseudo-version: preceding tag (v0.1.7) not found

This is with GOPROXY=direct, happens on go1.17 and go1.18. Git version 2.25.1.

@ianlancetaylor
Copy link
Contributor

@bcmills This is in the 1.18 milestone; time to move to 1.19? Thanks.

@bcmills bcmills modified the milestones: Go1.18, Go1.19 Feb 1, 2022
@ianlancetaylor
Copy link
Contributor

@bcmills @matloob This issue is marked for 1.19. It's just been rolling forward in milestones. Should it move to Backlog? Thanks.

@bcmills
Copy link
Member Author

bcmills commented Jun 28, 2022

It should still be fixed — it's a fairly serious issue in version resolution. Unfortunately it needs some involved work to fix correctly, and I've had limited capability for focused work this cycle due to burnout.

@tuxillo
Copy link
Contributor

tuxillo commented Mar 20, 2023

Not sure if this is the same but it seems it could be like #58116:

# go version
go version go1.19.5 dragonfly/amd64
thor# go clean -modcache
# go install golang.org/x/tools@master
go: downloading golang.org/x/tools v0.7.1-0.20230317165317-fa556487c5c2
go: golang.org/x/tools@master: module golang.org/x/tools@master found (v0.7.1-0.20230317165317-fa556487c5c2), but does not contain package golang.org/x/tools

Got this error too while building packages for DragonFlyBSD. Example:

-- Phase: extract
-------------------------------------------------------------------------------

===>  License MIT accepted by the user
===>   rclone-1.61.1_2 depends on file: /usr/local/sbin/pkg - found
===>   rclone-1.61.1_2 depends on file: /usr/local/bin/go119 - found
===>   rclone-1.61.1_2 depends on package: ca_root_nss>0 - found
===> Fetching all distfiles required by rclone-1.61.1_2 for building
===> Fetching github.com/rclone/rclone dependencies
===>  Extracting for rclone-1.61.1_2
=> SHA256 Checksum OK for go/net_rclone/rclone-v1.61.1/v1.61.1.mod.
=> SHA256 Checksum OK for go/net_rclone/rclone-v1.61.1/v1.61.1.zip.
===> Tidying github.com/rclone/rclone dependencies
go: finding module for package github.com/hanwen/go-fuse/v2/fuse
go: finding module for package github.com/ncw/go-acd
[...]
go: finding module for package github.com/golang/protobuf/ptypes/empty
github.com/rclone/rclone/backend/amazonclouddrive imports
	github.com/ncw/go-acd: module github.com/ncw/go-acd@latest found (v0.0.0-20201019170801-fe55f33415b1), but does not contain package github.com/ncw/go-acd
github.com/rclone/rclone/backend/box imports
	github.com/youmark/pkcs8: module github.com/youmark/pkcs8@latest found (v0.0.0-20201027041543-1326539a0a0a), but does not contain package github.com/youmark/pkcs8
github.com/rclone/rclone/backend/cache imports
	github.com/patrickmn/go-cache: module github.com/patrickmn/go-cache@latest found (v2.1.0+incompatible), but does not contain package github.com/patrickmn/go-cache
github.com/rclone/rclone/backend/cache imports
	go.etcd.io/bbolt: module go.etcd.io/bbolt@latest found (v1.3.6), but does not contain package go.etcd.io/bbolt
github.com/rclone/rclone/backend/compress imports
	github.com/buengese/sgzip: module github.com/buengese/sgzip@latest found (v0.1.1), but does not contain package github.com/buengese/sgzip

Is there any workaround?

@kylechadha
Copy link

kylechadha commented Mar 27, 2023

@tuxillo Not sure if this is the same issue as described above (I see it in 1.20.2), but I installed 1.19.7 and that worked for me: #59281

@bcmills
Copy link
Member Author

bcmills commented May 11, 2023

This may be related to #56881.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Status: No status
Development

No branches or pull requests

5 participants