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

x/vgo: vgo get -u raises error #24917

Closed
vvakame opened this issue Apr 18, 2018 · 3 comments
Closed

x/vgo: vgo get -u raises error #24917

vvakame opened this issue Apr 18, 2018 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@vvakame
Copy link

vvakame commented Apr 18, 2018

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

$ go version
go version go1.10.1 darwin/amd64
$ vgo version
go version go1.10.1 darwin/amd64 vgo:2018-02-20.1

Does this issue reproduce with the latest release?

Yes.
I tried go get -u golang.org/x/vgo just now.

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

$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/vvakame/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/vvakame/go"
GORACE=""
GOROOT="/usr/local/opt/go/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
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/sn/2c51f5x95qj6jzvwrv1tjzkh0000gq/T/go-build052901228=/tmp/go-build -gno-record-gcc-switches -fno-common"

$ vgo env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/vvakame/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/vvakame/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/opt/go/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
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/sn/2c51f5x95qj6jzvwrv1tjzkh0000gq/T/go-build039709236=/tmp/go-build -gno-record-gcc-switches -fno-common"
VGOMODROOT=""

What did you do?

$ cd /tmp
$ git clone https://github.com/ory/fosite-example.git
$ cd fosite-example
$ git rev-parse HEAD
f8f12ceead20888c06a67578cc8f6763075a7e33
$ echo 'module "github.com/ory/fosite-example"' > go.mod

$ vgo build
vgo: resolving import "github.com/ory/fosite"
vgo: finding github.com/ory/fosite (latest)
vgo: adding github.com/ory/fosite v0.17.0
vgo: resolving import "github.com/pkg/errors"
vgo: finding github.com/pkg/errors (latest)
vgo: adding github.com/pkg/errors v0.8.0
vgo: resolving import "github.com/parnurzeal/gorequest"
vgo: finding github.com/parnurzeal/gorequest (latest)
vgo: adding github.com/parnurzeal/gorequest v0.2.15
vgo: resolving import "golang.org/x/oauth2"
vgo: finding golang.org/x/oauth2 (latest)
vgo: adding golang.org/x/oauth2 v0.0.0-20180416194528-6881fee410a5
vgo: resolving import "golang.org/x/net/context"
vgo: finding golang.org/x/net (latest)
vgo: adding golang.org/x/net v0.0.0-20180418062111-d41e8174641f
vgo: finding github.com/ory/fosite v0.17.0
vgo: finding github.com/ory/fosite v0.17.0
vgo: parsing downloaded go.mod: go.mod:8: invalid module: github.com/dgrijalva/jwt-go should be v1, not v3 (v3.1.0)

$ vgo get -u
vgo: resolving import "github.com/ory/fosite"
vgo: finding github.com/ory/fosite (latest)
vgo: adding github.com/ory/fosite v0.17.0
vgo: resolving import "github.com/pkg/errors"
vgo: finding github.com/pkg/errors (latest)
vgo: adding github.com/pkg/errors v0.8.0
vgo: resolving import "github.com/parnurzeal/gorequest"
vgo: finding github.com/parnurzeal/gorequest (latest)
vgo: adding github.com/parnurzeal/gorequest v0.2.15
vgo: resolving import "golang.org/x/oauth2"
vgo: finding golang.org/x/oauth2 (latest)
vgo: adding golang.org/x/oauth2 v0.0.0-20180416194528-6881fee410a5
vgo: resolving import "golang.org/x/net/context"
vgo: finding golang.org/x/net (latest)
vgo: adding golang.org/x/net v0.0.0-20180418062111-d41e8174641f
vgo: finding github.com/ory/fosite latest
vgo: finding github.com/pkg/errors latest
vgo: finding github.com/parnurzeal/gorequest latest
vgo: finding golang.org/x/oauth2 latest
vgo: finding golang.org/x/net latest
vgo: finding github.com/ory/fosite v0.17.0
panic: parsing downloaded go.mod: go.mod:8: invalid module: github.com/dgrijalva/jwt-go should be v1, not v3 (v3.1.0)

goroutine 1 [running]:
golang.org/x/vgo/vendor/cmd/go/internal/mvs.UpgradeAll(0xc4201bc341, 0x1d, 0x0, 0x0, 0x159a000, 0xc420318400, 0xc420133e80, 0x1, 0x1, 0x0, ...)
	/Users/vvakame/Dropbox/work/go-work/src/golang.org/x/vgo/vendor/cmd/go/internal/mvs/mvs.go:174 +0x62d
golang.org/x/vgo/vendor/cmd/go/internal/vgo.iterate(0xc4201c7a68)
	/Users/vvakame/Dropbox/work/go-work/src/golang.org/x/vgo/vendor/cmd/go/internal/vgo/load.go:139 +0x20a
golang.org/x/vgo/vendor/cmd/go/internal/vgo.importPaths(0xc4202240d0, 0x1, 0x1, 0x6, 0x30, 0xd0)
	/Users/vvakame/Dropbox/work/go-work/src/golang.org/x/vgo/vendor/cmd/go/internal/vgo/load.go:82 +0xe4
golang.org/x/vgo/vendor/cmd/go/internal/vgo.ImportPaths(0xc4201c7c40, 0x1, 0x1, 0x14bc5c8, 0x30, 0x30)
	/Users/vvakame/Dropbox/work/go-work/src/golang.org/x/vgo/vendor/cmd/go/internal/vgo/load.go:70 +0x5a
golang.org/x/vgo/vendor/cmd/go/internal/vgo.runGet(0x17b6a60, 0xc42001e0e0, 0x0, 0x0)
	/Users/vvakame/Dropbox/work/go-work/src/golang.org/x/vgo/vendor/cmd/go/internal/vgo/get.go:54 +0xe75
golang.org/x/vgo/vendor/cmd/go.Main()
	/Users/vvakame/Dropbox/work/go-work/src/golang.org/x/vgo/vendor/cmd/go/main.go:155 +0x82e
main.main()
	/Users/vvakame/Dropbox/work/go-work/src/golang.org/x/vgo/main.go:31 +0x20

I checked github.com/ory/fosite, github.com/pkg/errors, github.com/parnurzeal/gorequest, github.com/parnurzeal/gorequest, golang.org/x/oauth2 and golang.org/x/net/context.
They haven't go.mod, doesn't contains github.com/dgrijalva/jwt-go with v1 in Gopkg.lock.

What did you expect to see?

  • Compile will succeed.
  • go.mod will update.

What did you see instead?

  • A panic has occurred.
@gopherbot gopherbot added this to the vgo milestone Apr 18, 2018
@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 18, 2018
@oiooj
Copy link
Member

oiooj commented Apr 18, 2018

//vgo 0.0.3

module "github.com/ory/fosite"

require (
	"github.com/asaskevich/govalidator" v0.0.0-20170903095215-73945b6115bf
	"github.com/davecgh/go-spew" v1.1.0
	"github.com/dgrijalva/jwt-go" v3.1.0
	"github.com/golang/mock" v1.0.0
	"github.com/golang/protobuf" v0.0.0-20171021043952-1643683e1b54
	"github.com/gorilla/context" v0.0.0-20160226214623-1ea25387ff6f
         ...

for line 8 : "github.com/dgrijalva/jwt-go" v3.1.0

github.com/dgrijalva/jwt-go -> v1
v3.1.0 -> v3

v1 != v3 && (v1 != "v1" || v3 != "v0") is true, so we met the problem.

@gopherbot
Copy link

Change https://golang.org/cl/107856 mentions this issue: x/vgo: fix invalid module version error on parsing modfile

@rsc
Copy link
Contributor

rsc commented Jun 6, 2018

The example in the original post works now. The converter correctly uses a pseudoversion instead of v3.1.0 for github.com/dgrijalva/jwt-go.

@rsc rsc closed this as completed Jun 6, 2018
@golang golang locked and limited conversation to collaborators Jun 6, 2019
@rsc rsc removed their assignment Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants