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

Missing dependencies in vendor/ #16

Closed
ryboe opened this issue Feb 19, 2017 · 1 comment · Fixed by #17
Closed

Missing dependencies in vendor/ #16

ryboe opened this issue Feb 19, 2017 · 1 comment · Fixed by #17

Comments

@ryboe
Copy link
Contributor

ryboe commented Feb 19, 2017

$ cd $GOPATH/src/github.com/yudai/gojsondiff
$ go test ./...
vendor/github.com/yudai/gojsondiff/deltas.go:5:2: cannot find package "github.com/sergi/go-diff/diffmatchpatch" in any of:
	/Users/ryan/go2/src/foo/vendor/github.com/yudai/gojsondiff/vendor/github.com/sergi/go-diff/diffmatchpatch (vendor tree)
	/Users/ryan/go2/src/foo/vendor/github.com/sergi/go-diff/diffmatchpatch
	/usr/local/Cellar/go/1.8/libexec/src/github.com/sergi/go-diff/diffmatchpatch (from $GOROOT)
	/Users/ryan/go2/src/github.com/sergi/go-diff/diffmatchpatch (from $GOPATH)
vendor/github.com/yudai/gojsondiff/gojsondiff.go:13:2: cannot find package "github.com/yudai/golcs" in any of:
	/Users/ryan/go2/src/foo/vendor/github.com/yudai/gojsondiff/vendor/github.com/yudai/golcs (vendor tree)
	/Users/ryan/go2/src/foo/vendor/github.com/yudai/golcs
	/usr/local/Cellar/go/1.8/libexec/src/github.com/yudai/golcs (from $GOROOT)
	/Users/ryan/go2/src/github.com/yudai/golcs (from $GOPATH)
vendor/github.com/yudai/gojsondiff/jd/main.go:9:2: cannot find package "github.com/codegangsta/cli" in any of:
	/Users/ryan/go2/src/foo/vendor/github.com/yudai/gojsondiff/vendor/github.com/codegangsta/cli (vendor tree)
	/Users/ryan/go2/src/foo/vendor/github.com/codegangsta/cli
	/usr/local/Cellar/go/1.8/libexec/src/github.com/codegangsta/cli (from $GOROOT)
	/Users/ryan/go2/src/github.com/codegangsta/cli (from $GOPATH)
vendor/github.com/yudai/gojsondiff/tests/helper.go:4:2: cannot find package "github.com/onsi/ginkgo" in any of:
	/Users/ryan/go2/src/foo/vendor/github.com/yudai/gojsondiff/vendor/github.com/onsi/ginkgo (vendor tree)
	/Users/ryan/go2/src/foo/vendor/github.com/onsi/ginkgo
	/usr/local/Cellar/go/1.8/libexec/src/github.com/onsi/ginkgo (from $GOROOT)
	/Users/ryan/go2/src/github.com/onsi/ginkgo (from $GOPATH)

This is with a clean $GOPATH (a $GOPATH that contains gojsondiff and nothing else).

The problem

These deps are not in vendor/.

github.com/sergi/go-diff/diffmatchpatch
github.com/yudai/golcs
github.com/codegangsta/cli

This dep appears to be in vendor/, but Go is having trouble finding it for some reason. Perhaps the vendoring of that pkg is incomplete.

github.com/onsi/ginkgo

The real problem

You thought everything was vendored because you have everything in your Godeps.json manifest and you ran godep restore. Unfortunately, godep is a first-gen vendoring tool with all sorts of surprising behavior. I could submit a PR to just add the missing deps, but that still leaves us with the problem of why ginkgo isn't being found, and it doesn't prevent future problems should you decide to add/remove deps.

The real solution

A better solution is to revendor the deps using a better vendoring tool, such as Glide or gvt, so that this problem doesn't happen again. This is what I've done in #17 . In the process of revendoring gojsondiff I discovered some other issues which are detailed in the PR notes.

Who I am

I'm the "vendoring guy" at a company called Apcera. We're using gojsondiff internally (thanks very much for writing it!). I discovered this issue when I tried to vendor gojsondiff itself and it didn't work.

@yudai
Copy link
Owner

yudai commented Feb 25, 2017

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants