Glide: Strange behaviour when running `glide install` inside a "symbolic linked" directory

Created on 25 Jul 2016  路  3Comments  路  Source: Masterminds/glide

I am using gvm to manage go versions, and I've created a symbolic link inside each version from gvm's, so that I can make changes to projects and when I need to upgrade go version, I just create sym link inside the new version structure:

$ ls -l /home/msouza/.gvm/gos/go1.6.3/src/github.com/
lrwxrwxrwx. 1 msouza msouza 50 Jul 25 12:06 github.com -> /home/msouza/workspace/github.com/

When I run glide install, from the symbolic link, it complains about the project location, but successfully installs the dependencies under the vendor/ directory.

$ glide install
[WARN]  The name listed in the config file (github/user/project-name) does not match the current location (.)

When I run go run app.go, it returns an error complaining that it could not found the dependency defined in app.go which is under the vendor/ directory, from any GO paths (GOPATH, GOROOT, #etc).

$ go run app.go
app.go:4:2: cannot find package "github.com/gin-gonic/gin" in any of:
    /home/msouza/.gvm/gos/go1.6.3/src/github.com/gin-gonic/gin (from $GOROOT)
    /home/msouza/.gvm/pkgsets/go1.6.3/global/src/github.com/gin-gonic/gin (from $GOPATH)

When I run both glide install and go run from the real location, it works as expected.

Versions I am using:

$ glide --version 
glide version 0.11.0-dev
$ go version
go version go1.6.3 linux/amd64
$ uname -a
Linux localhost.localdomain 3.10.0-327.18.2.el7.x86_64 #1 SMP Thu May 12 11:03:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Can anyone help me understand this behaviour and if it is really an issue, I could make a pull request to fix that.
Thanks!

519

Most helpful comment

So what's the solution?

All 3 comments

hi @marioluan.
The problem you explained is not about glide itself but golang environment and gvm.
As you mentioned even go run is working as expected.
I think this issue https://github.com/moovweb/gvm/issues/189 is somehow related to your problem.
Certainly the right place to create this issue (or maybe to find the solution for your problem) is at https://github.com/moovweb/gvm project.

Hi @franciscocpg, thanks for your feedback.

I think the main cause of the problem is related to symbolic linking. When I upgraded from go 1.6.2 to 1.6.3, my IDE also got broken, because it could not follow the symbolic link which I created myself.

When I removed the symbolic link and created a hard link instead, it worked perfectly. So I think it is not related to gvm nor glide, but with the way I defined my directory structure.

I'm closing the issue now.

Cheers!

So what's the solution?

Was this page helpful?
0 / 5 - 0 ratings