Skip to content

x/vgo getmode=vendor not using vendor directory #26126

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

Closed
RichyHBM opened this issue Jun 29, 2018 · 5 comments
Closed

x/vgo getmode=vendor not using vendor directory #26126

RichyHBM opened this issue Jun 29, 2018 · 5 comments
Milestone

Comments

@RichyHBM
Copy link

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

$ vgo version
go version go1.10.3 linux/amd64 vgo:2018-02-20.1

Does this issue reproduce with the latest release?

Yes

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

$ vgo env
GOARCH="amd64"
GOBIN="/home/richy/.bin"
GOCACHE="/home/richy/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/richy/go"
GOPROXY=""
GORACE=""
GOROOT="/home/linuxbrew/.linuxbrew/Cellar/go/1.10.3/libexec"
GOTMPDIR=""
GOTOOLDIR="/home/linuxbrew/.linuxbrew/Cellar/go/1.10.3/libexec/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc-5"
CXX="g++-5"
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-build522635311=/tmp/go-build -gno-record-gcc-switches"
VGOMODROOT="/home/richy/repos/temp"

What did you do?

Starting with

$ ls
go.mod  main.go

$ cat go.mod
module temp

require (
        github.com/gorilla/context v1.1.1
        github.com/gorilla/mux v1.6.2
)

$ cat main.go
package main

import (
        "net/http"
        "github.com/gorilla/mux"
)

func handler(w http.ResponseWriter, r *http.Request) {
        return
}

func main() {
        r := mux.NewRouter()
        r.HandleFunc("/", handler)
}
$ vgo build
$ vgo mod -vendor
$ vgo build -getmode=vendor
$ rm -rf ~/go/src/mod/
$ vgo build -getmode=vendor

What did you expect to see?

$ vgo build
vgo: downloading github.com/gorilla/mux v1.6.2
$ vgo mod -vendor
vgo: downloading github.com/gorilla/context v1.1.1
$ vgo build -getmode=vendor
$ rm -rf ~/go/src/mod/
$ vgo build -getmode=vendor
$

What did you see instead?

$ vgo build
vgo: downloading github.com/gorilla/mux v1.6.2

$ vgo mod -vendor
vgo: downloading github.com/gorilla/context v1.1.1

$ vgo build -getmode=vendor

$ rm -rf ~/go/src/mod/

$ vgo build -getmode=vendor
vgo: github.com/gorilla/mux v1.6.2: module lookup disabled by -getmode=vendor
vgo: github.com/gorilla/context v1.1.1: module lookup disabled by -getmode=vendor
@gopherbot gopherbot added this to the vgo milestone Jun 29, 2018
@typeless
Copy link

typeless commented Jun 29, 2018

Edit: a quick git-bisect reveals that 97ff4ad34612eed56f1dc6c6aaee19617e45e2be is the first bad commit.

@bcmills
Copy link
Contributor

bcmills commented Jun 29, 2018

What's in your directory tree after vgo mod -vendor step? (Is #26152 a duplicate of this issue?)

@RichyHBM
Copy link
Author

Not at my computer right now, but there were definitely files in my vendor directory (from memory a module list file, and a file structure mirroring dependencies)
AFAIK the vendor folder looked perfectly valid

@golang golang deleted a comment from gopherbot Jul 1, 2018
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/122479 mentions this issue: cmd/go/internal/modload: work better with -getmode=vendor

@RichyHBM
Copy link
Author

For what it's worth, the above changes seem to fix it when applied to my local vgo

@golang golang locked and limited conversation to collaborators Jul 12, 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