-
Notifications
You must be signed in to change notification settings - Fork 1k
dep ensure failed to resolve project root #372
Comments
I think I've got the same problem but on different stage.
I use 2 GOPATH to separate internal git tree and external (gopath_third_party) one + system packages (gentoo/usr/lib/go). It worked ok around 1 week ago. |
(first, pinging @brianstarke 😄 ) @ensonic this first case seems odd, unless @Civil So, if I'm reading that error correctly, you're trying to run PS symlinks, wherefore art thou such an abomination |
@sdboyer yes, I'm issuing dep init in that path and this is the error I'm getting out of it. If it'll help I can find last working commit. |
Agreed with @sdboyer on the first case, @ensonic... in this case we're not really sure which path to use (the symlink or the real path) and didn't want to make the decision for you since that would set the expectation that it worked as expected and there's a 50% chance it didn't :) Prior to #247, you would have gotten the same error. @Civil ... that definitely looks like a bug and definitely looks like my fault. Sorry! Ideally what I tried to do was to do nothing if no symlinks are involved. I'll look in to it. |
From what I understand my bug is https://github.com/golang/dep/blob/master/context.go#L37-L52 in this part. What happens here (on an example): We are starting iterating over all GOPATHS. First iteration - we assign GOPATH=/Users/vsmirnov/go/gopath_third_party, but then for some reason we are not stopping iterating over and because next GOPATHS[1] is called '/Users/vsmirnov/go/gopath', our I'll send a PR with a simple fix as an example. Edit: #379 |
I still don't under stand the 'is linked to another path within a GOPATH' part. The gopath is "/home/ensonic/go" and my actual code is under "/home/ensonic/projects/foo". The latter is not inside the gopath, I just linked it into the gopath. |
@ensonic yes, it seems like we do have a bug there. disallowing "linking to another GOPATH" is supposed to avoid the situation where you have multiple elements in your GOPATH, and a symlink points from one, into the other. We really need to have just one GOPATH that we operate on (in It would appear our logic isn't doing that quite correctly, though. I'm pretty overwhelmed with other things at the moment, but if you have a reproducible case that you could turn into a PR (or at least a test that simulates it), that would be amazing. |
Closing this since #641 is merged. We should be handling symlinks according to #247 (comment). |
I don't think the error message is correct, neither can I understand it, not can I see what I can do to help the tool.
I now stopped using symlinks, but a 2nd path entry in GOPATH and it looking better.
The text was updated successfully, but these errors were encountered: