Skip to content

cmd/go: 'panic: mistake: chose version "v0.0.N" instead of target' when an argument to 'go get' requires a newer version of itself #31491

Closed
@raulk

Description

@raulk

What version of Go are you using (go version)?

$ go version
go version go1.12.4 darwin/amd64

Does this issue reproduce with the latest release?

Yes, using the latest release available at this time.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
❯ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="--homedir--/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/raul/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="--workspace--/go-libp2p/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/tv/ly66_c6121jg370fvnfcb_mh0000gn/T/go-build064039334=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

With this go.mod file, I tried to upgrade go-libp2p-peerstore to the latest commit in the consolidate-skeleton branch:

> go get github.com/libp2p/go-libp2p-peerstore@consolidate-skeleton;

Note that this was part of a batch update, where all go get commands succeeded except for this one, which failed both inside the batch and in isolation:

go get github.com/libp2p/go-conn-security@consolidate-skeleton;
go get github.com/libp2p/go-libp2p-blankhost@consolidate-skeleton;
go get github.com/libp2p/go-libp2p-discovery@consolidate-skeleton;
go get github.com/libp2p/go-libp2p-host@consolidate-skeleton;
go get github.com/libp2p/go-libp2p-interface-connmgr@consolidate-skeleton;
go get github.com/libp2p/go-libp2p-interface-pnet@consolidate-skeleton;
go get github.com/libp2p/go-libp2p-metrics@consolidate-skeleton;
go get github.com/libp2p/go-libp2p-net@consolidate-skeleton;
go get github.com/libp2p/go-libp2p-peer@consolidate-skeleton;
go get github.com/libp2p/go-libp2p-peerstore@consolidate-skeleton;
go get github.com/libp2p/go-libp2p-protocol@consolidate-skeleton;
go get github.com/libp2p/go-libp2p-routing@consolidate-skeleton;
go get github.com/libp2p/go-libp2p-secio@consolidate-skeleton;
go get github.com/libp2p/go-libp2p-transport@consolidate-skeleton;
go get github.com/libp2p/go-stream-muxer@consolidate-skeleton;

What did you expect to see?

go.mod successfully updated to reference the latest commit on the consolidate-skeleton branch of go-libp2p-peerstore.

What did you see instead?

❯ go get github.com/libp2p/go-libp2p-peerstore@consolidate-skeleton;
go: finding github.com/libp2p/go-libp2p-peerstore consolidate-skeleton
panic: mistake: chose version "v0.0.2" instead of target {Path:github.com/libp2p/go-libp2p-peerstore Version:v0.0.2-0.20190416173150-2ca0254625f6}

goroutine 1 [running]:
cmd/go/internal/mvs.buildList(0x7ffeefbff687, 0x25, 0xc000276630, 0x24, 0x16c8300, 0xc000448cb0, 0x0, 0x1e, 0x0, 0x0, ...)
	/usr/local/Cellar/go/1.12.4/libexec/src/cmd/go/internal/mvs/mvs.go:125 +0xc88
cmd/go/internal/mvs.BuildList(...)
	/usr/local/Cellar/go/1.12.4/libexec/src/cmd/go/internal/mvs/mvs.go:73
cmd/go/internal/modget.runGet(0x1a48c60, 0xc000020050, 0x1, 0x1)
	/usr/local/Cellar/go/1.12.4/libexec/src/cmd/go/internal/modget/get.go:487 +0x1283
main.main()
	/usr/local/Cellar/go/1.12.4/libexec/src/cmd/go/main.go:219 +0x7a4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions