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: Second vgo build execution gives an error #24069

Closed
franciscocpg opened this issue Feb 23, 2018 · 3 comments

Comments

@franciscocpg
Copy link

commented Feb 23, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version go1.10 linux/amd64

Does this issue reproduce with the latest release?

yes

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

GOARCH="amd64"
GOBIN="/home/francisco/go/bin"
GOCACHE="/home/francisco/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/francisco/go"
GORACE=""
GOROOT="/usr/lib/go"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build916224046=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I'm trying vgo in a project that already uses dep. It's a library (still not open source but will be soon).
I run CC=gcc vgo build (See #23965 (comment)) and the process runs successfully.
If I run CC=gcc vgo build again I get the error

vgo: errors parsing go.mod:
/$HOME/go/src/github.com/dr-go/go-healthcheck/go.mod:11: invalid module: github.com/ralekseenkov/govaluate should be v1, not v3 (v3.0.0)

I put go.mod, Gopkg.lock and Gopkg.toml in this gist.

What did you expect to see?

A successful build.

What did you see instead?

A failed build.

@gopherbot gopherbot added this to the vgo milestone Feb 23, 2018

@mkmik

This comment has been minimized.

Copy link

commented Feb 23, 2018

I have the same issue in a more simple scenario, just pure vgo

mkm@nemo $ git clone https://github.com/mmikulicic/vgo-issue-24069
mkm@nemo $ cd vgo-issue-24069
mkm@nemo $ vgo build
vgo: resolving import "github.com/go-sql-driver/mysql"
vgo: finding github.com/go-sql-driver/mysql (latest)
vgo: adding github.com/go-sql-driver/mysql v1.3

I ran a recent vgo (go get -u golang.org/x/vgo just now)
and now it records v1.3:

mkm@nemo $ git diff
diff --git a/go.mod b/go.mod
index 75216a6..c2dfb2e 100644
--- a/go.mod
+++ b/go.mod
@@ -1 +1,3 @@
 module "github.com/mmikulicic/vgo-issue-24069"
+
+require "github.com/go-sql-driver/mysql" v1.3

but it still breaks next time we run vgo build:

mkm@nemo $ vgo build
vgo: finding github.com/go-sql-driver/mysql v1.3.0
vgo: github.com/go-sql-driver/mysql v1.3.0: unexpected status (https://api.github.com/repos/go-sql-driver/mysql/git/refs/tags/v1.3.0): 404 Not Found
vgo: finding github.com/go-sql-driver/mysql v1.3.0
vgo: github.com/go-sql-driver/mysql v1.3.0: unexpected status (https://api.github.com/repos/go-sql-driver/mysql/git/refs/tags/v1.3.0): 404 Not Found
vgo: unexpected status (https://api.github.com/repos/go-sql-driver/mysql/git/refs/tags/v1.3.0): 404 Not Found

The version gets rewritten as a side effect of the second vgo build:

mkm@nemo $ git diff
diff --git a/go.mod b/go.mod
index 75216a6..c2dfb2e 100644
--- a/go.mod
+++ b/go.mod
@@ -1 +1,3 @@
 module "github.com/mmikulicic/vgo-issue-24069"
+
+require "github.com/go-sql-driver/mysql" v1.3.0
@mewmew

This comment has been minimized.

Copy link
Contributor

commented Mar 27, 2018

@mmikulicic As you already pointed out go-sql-driver has a v1.3 tag, but no v1.3.0 tag, thus resulting in 404 for vgo

I can echo that this issue also occurs for me. A minimal example to reproduce the issue has been uploaded to https://github.com/mewspring/pixel-vgo-example

vgo build completes successfully the first time and produces a go.mod file (note, vgo was run in the repository when only containing main.go, no go.mod file).

u@x220 ~/D/g/s/g/m/pixel-vgo-example> vgo build
vgo: resolving import "github.com/faiface/pixel"
vgo: finding github.com/faiface/pixel (latest)
vgo: adding github.com/faiface/pixel v0.7
vgo: resolving import "golang.org/x/image/colornames"
vgo: finding golang.org/x/image (latest)
vgo: adding golang.org/x/image v0.0.0-20180314180248-f3a9b89b59de
vgo: finding golang.org/x/image v0.0.0-20180314180248-f3a9b89b59de
vgo: finding github.com/faiface/pixel v0.7
vgo: downloading github.com/faiface/pixel v0.7
vgo: downloading golang.org/x/image v0.0.0-20180314180248-f3a9b89b59de
vgo: resolving import "github.com/faiface/glhf"
vgo: finding github.com/faiface/glhf (latest)
vgo: adding github.com/faiface/glhf v0.0.0-20170610131041-98c0391c0fd3
vgo: resolving import "github.com/faiface/mainthread"
vgo: finding github.com/faiface/mainthread (latest)
vgo: adding github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3
vgo: resolving import "github.com/go-gl/glfw/v3.2/glfw"
vgo: finding github.com/go-gl/glfw (latest)
vgo: adding github.com/go-gl/glfw v0.0.0-20170814180746-513e4f2bf85c
vgo: resolving import "github.com/go-gl/mathgl/mgl32"
vgo: finding github.com/go-gl/mathgl (latest)
vgo: adding github.com/go-gl/mathgl v0.0.0-20180319210751-5ab0e04e1f55
vgo: resolving import "github.com/pkg/errors"
vgo: finding github.com/pkg/errors (latest)
vgo: adding github.com/pkg/errors v0.8.0
vgo: finding github.com/pkg/errors v0.8.0
vgo: finding github.com/go-gl/mathgl v0.0.0-20180319210751-5ab0e04e1f55
vgo: finding github.com/go-gl/glfw v0.0.0-20170814180746-513e4f2bf85c
vgo: finding github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3
vgo: finding github.com/faiface/glhf v0.0.0-20170610131041-98c0391c0fd3
vgo: downloading github.com/faiface/glhf v0.0.0-20170610131041-98c0391c0fd3
vgo: downloading github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3
vgo: downloading github.com/go-gl/mathgl v0.0.0-20180319210751-5ab0e04e1f55
vgo: downloading github.com/pkg/errors v0.8.0
vgo: downloading github.com/go-gl/glfw v0.0.0-20170814180746-513e4f2bf85c
vgo: resolving import "github.com/go-gl/gl/v3.3-core/gl"
vgo: finding github.com/go-gl/gl (latest)
vgo: adding github.com/go-gl/gl v0.0.0-20180319200113-f8cee0ff968a
vgo: finding github.com/go-gl/gl v0.0.0-20180319200113-f8cee0ff968a
vgo: downloading github.com/go-gl/gl v0.0.0-20180319200113-f8cee0ff968a

Contents of go.mod:

module "github.com/mewspring/pixel-vgo-example"

require (
	"github.com/faiface/glhf" v0.0.0-20170610131041-98c0391c0fd3
	"github.com/faiface/mainthread" v0.0.0-20171120011319-8b78f0a41ae3
	"github.com/faiface/pixel" v0.7.0
	"github.com/go-gl/gl" v0.0.0-20180319200113-f8cee0ff968a
	"github.com/go-gl/glfw" v0.0.0-20170814180746-513e4f2bf85c
	"github.com/go-gl/mathgl" v0.0.0-20180319210751-5ab0e04e1f55
	"github.com/pkg/errors" v0.8.0
	"golang.org/x/image" v0.0.0-20180314180248-f3a9b89b59de
)

However, running vgo build again does not work as the version of Pixel is v0.7, and vgo rewrites it to v0.7.0 which results in 404.

u@x220 ~/D/g/s/g/m/pixel-vgo-example> vgo build
vgo: finding github.com/faiface/pixel v0.7.0
vgo: github.com/faiface/pixel v0.7.0: unexpected status (https://api.github.com/repos/faiface/pixel/git/refs/tags/v0.7.0): 404 Not Found
vgo: finding github.com/faiface/pixel v0.7.0
vgo: github.com/faiface/pixel v0.7.0: unexpected status (https://api.github.com/repos/faiface/pixel/git/refs/tags/v0.7.0): 404 Not Found
vgo: unexpected status (https://api.github.com/repos/faiface/pixel/git/refs/tags/v0.7.0): 404 Not Found
mewmew added a commit to sanctuary/djavul-asm that referenced this issue Mar 28, 2018
@rsc

This comment has been minimized.

Copy link
Contributor

commented Mar 30, 2018

The original report by @franciscocpg is a duplicate of #24585.

The #24069 (comment) by @mmikulicic is a duplicate of #24476.

Closing this one.

@rsc rsc closed this Mar 30, 2018

@golang golang locked and limited conversation to collaborators Mar 30, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants
You can’t perform that action at this time.