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

cmd/go: Golang not detecting vendor folder #19919

Closed
armic opened this issue Apr 11, 2017 · 10 comments
Closed

cmd/go: Golang not detecting vendor folder #19919

armic opened this issue Apr 11, 2017 · 10 comments

Comments

@armic
Copy link

armic commented Apr 11, 2017

Please answer these questions before submitting your issue. Thanks!

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

go version go1.8.1 darwin/amd64

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/aaronmichaels/Developer/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.8.1/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.8.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/hm/nb7xhr9961v06dsc9jsm95m80000gn/T/go-build516539570=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

What did you do?

I used the glide tool (https://github.com/Masterminds/glide) to install a dependency (github.com/appliedgo/perceptron/draw) at /Users/aaronmichaels/Developer/go/src/github.com/ajmichaels/misc/appliedgo/perceptron.

Under this directory, I have a glide.yaml file, a glide.lock file, a main.go file, and a vendor/ folder. Within the main.go file, I have "github.com/appliedgo/perceptron/draw" imported. However, when I try to go build my main.go file, I get this error:

main.go:8:2: cannot find package "github.com/appliedgo/perceptron/draw" in any of:
/usr/local/Cellar/go/1.8.1/libexec/src/github.com/appliedgo/perceptron/draw (from $GOROOT)
/Users/aaronmichaels/Developer/go/src/github.com/appliedgo/perceptron/draw (from $GOPATH)

My gopath is /Users/aaronmichaels/Developer/go, so the error is not related to not being within my gopath. Also, projects with dependencies installed via go get work fine.

What did you expect to see?

From what I've seen online, the go build command should have run with no errors.

What did you see instead?

@bradfitz
Copy link
Contributor

For questions about Go, see https://golang.org/wiki/Questions.

@armic
Copy link
Author

armic commented Apr 11, 2017

Hi @bradfitz I'm not asking a question, this is a bug report.

@bradfitz
Copy link
Contributor

Please start with the mailing list. This looks like user error instead of a clear bug report.

If you have a problem with glide, please file a bug report against glide.

@armic
Copy link
Author

armic commented Apr 11, 2017

@bradfitz I will ask on the mailing list, but I consulted with the go-nuts irc channel and it looks like a bug. Also #19916 seems to a similar (same?) bug. The issue is not with glide, it is with golang not detecting that a vendor folder is present

@bradfitz
Copy link
Contributor

#19916 also looks like a question instead of a bug report.

@armic
Copy link
Author

armic commented Apr 11, 2017

How do I make it look like a bug report instead of a question?

@bradfitz
Copy link
Contributor

The mailing list can help solve your problem and/or help you file a bug report.

But in general, we don't have the resources to help debug external tools.

@laboger
Copy link
Contributor

laboger commented Apr 11, 2017

This is probably the same as #15628 since vendoring has never really worked with gccgo AFAIK. I just posted a CL in that issue to fix the problem when using the go tool built for gccgo (not golang yet).

Another suggestion is for you to explicitly add the -I option(s) to your GCCGOFLAGS to identify the vendor paths of the missing packages.

@javasgl
Copy link

javasgl commented Jul 13, 2017

when has multi GOPATH, It can`t detect the vendor folder.

go env
....
GOPATH="/go/codes/path1:/go/codes/path2"
....

@mikioh mikioh changed the title Golang not detecting vendor folder cmd/go: Golang not detecting vendor folder Jul 21, 2017
@lafolle
Copy link

lafolle commented Jul 21, 2017

Hi @ajmichaels ,

github.com/appliedgo/perceptron/draw is what you intend to import, but in src folder your pkg is github.com/ajmichaels/misc/appliedgo/perceptron.

Note "misc".

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

6 participants