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: get gopkg.in/yaml.v2 succeeds, but produces invalid go.mod #25243

Closed
Groxx opened this issue May 3, 2018 · 2 comments
Closed

x/vgo: get gopkg.in/yaml.v2 succeeds, but produces invalid go.mod #25243

Groxx opened this issue May 3, 2018 · 2 comments
Milestone

Comments

@Groxx
Copy link

Groxx commented May 3, 2018

I've seen a few gopkg.in related issues, some closed with fixes, but can't find one that appears still active after those fixes. Please let me know if you need anything else, I'm happy to help :)

What did you do?

Following along with the vgo tour, I got vgo:

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

made a blank dir, then added:

package main // import "github.com/you/hello"

import (
	"fmt"
	"rsc.io/quote"
)

func main() {
	fmt.Println(quote.Hello())
}

then ran touch go.mod; vgo build, all works so far:

$ touch go.mod

$ vgo build
vgo: resolving import "rsc.io/quote"
vgo: finding rsc.io/quote (latest)
vgo: adding rsc.io/quote v1.5.2
vgo: finding rsc.io/quote v1.5.2
vgo: finding rsc.io/sampler v1.3.0
vgo: finding golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c
vgo: downloading rsc.io/quote v1.5.2
vgo: downloading rsc.io/sampler v1.3.0
vgo: downloading golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c

$ ./hello
Hello, world.

$ vgo list -m
MODULE                VERSION
github.com/you/hello  -
golang.org/x/text     v0.0.0-20170915032832-14c0d48ead0c
rsc.io/quote          v1.5.2
rsc.io/sampler        v1.3.0

If I then get gopkg.in/yaml.v2 and try to vgo list -m again, it errors:

$ vgo get gopkg.in/yaml.v2
vgo: finding gopkg.in/yaml.v2 v2.2.1
vgo: finding gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
vgo: downloading gopkg.in/yaml.v2 v2.2.1

$ vgo list -m
vgo: errors parsing go.mod:
/Users/stevenl/tmp/go.mod:4: invalid module: gopkg.in/yaml.v2 should be v1, not v2 (v2.2.1)

So far this appears perfectly reproducible, including if I delete the gopath/src/v folder and try again from scratch.

What did you expect to see?

Something like

$ vgo list -m
MODULE                VERSION
github.com/you/hello  -
golang.org/x/text     v0.0.0-20170915032832-14c0d48ead0c
gopkg.in/yaml.v2      v2.2.1
rsc.io/quote          v1.5.2
rsc.io/sampler        v1.3.0

What did you see instead?

$ vgo list -m
vgo: errors parsing go.mod:
/Users/stevenl/tmp/go.mod:4: invalid module: gopkg.in/yaml.v2 should be v1, not v2 (v2.2.1)

Does this issue reproduce with the latest release (go1.10.2)?

Seems unrelated, but I can try.
edit: yes, deleting Library/Caches/go-build and $GOPATH/src/v and re-doing everything from scratch behaves exactly the same.

System details

go version go1.10.1 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/stevenl/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/stevenl/gocode"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.10.1/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.10.1/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/kd/r_70f16j01l07s9spqs4g9vm0000gn/T/go-build207032809=/tmp/go-build -gno-record-gcc-switches -fno-common"
VGOMODROOT=""
GOROOT/bin/go version: go version go1.10.1 darwin/amd64
GOROOT/bin/go tool compile -V: compile version go1.10.1
uname -v: Darwin Kernel Version 17.5.0: Fri Apr 13 19:32:32 PDT 2018; root:xnu-4570.51.2~1/RELEASE_X86_64
ProductName:	Mac OS X
ProductVersion:	10.13.4
BuildVersion:	17E202
lldb --version: lldb-902.0.79.2
  Swift-4.1

System details (for 1.10.2)

$ vgo version
go version go1.10.2 darwin/amd64 vgo:2018-02-20.1
go version go1.10.2 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/stevenl/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/stevenl/gocode"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.10.2/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.10.2/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/kd/r_70f16j01l07s9spqs4g9vm0000gn/T/go-build358073593=/tmp/go-build -gno-record-gcc-switches -fno-common"
VGOMODROOT=""
GOROOT/bin/go version: go version go1.10.2 darwin/amd64
GOROOT/bin/go tool compile -V: compile version go1.10.2
uname -v: Darwin Kernel Version 17.5.0: Fri Apr 13 19:32:32 PDT 2018; root:xnu-4570.51.2~1/RELEASE_X86_64
ProductName:	Mac OS X
ProductVersion:	10.13.4
BuildVersion:	17E202
lldb --version: lldb-902.0.79.2
  Swift-4.1
@gopherbot gopherbot added this to the vgo milestone May 3, 2018
@docwhat
Copy link

docwhat commented May 8, 2018

I think this is a duplicate of #24099 – or at least related.

@rsc
Copy link
Contributor

rsc commented May 10, 2018

Dup of #24099.

@rsc rsc closed this as completed May 10, 2018
@golang golang locked and limited conversation to collaborators May 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants