Can you check this error
ardan-bkennedy opened this issue · 16 comments
go get github.com/goinggo/mongorules
This is the mgo driver and requires bazaar
vendorize -n github.com/goinggo/mongorules github.com/goinggo/mongorules/3rdparty
couldn't vendorize github.com/goinggo/mongorules/engine: couldn't vendorize github.com/goinggo/mongorules/rules: couldn't vendorize github.com/goinggo/mongorules/data: couldn't vendorize labix.org/v2/mgo: labix.org/v2/mgo: couldn't import launchpad.net/gocheck: cannot find package "launchpad.net/gocheck" in any of:
/Users/bill/go/src/pkg/launchpad.net/gocheck (from $GOROOT)
/Users/bill/example/src/launchpad.net/gocheck (from $GOPATH)
I would not want to vendorize the internal packages, just the external ones. Am I doing something wrong?
Thanks for the report, I'll try to have a look at it this evening.
Okay, I figured out the problem. launchpad.net/gocheck is a test dependency of labix.org/v2/mgo. It's not download by default unless you go get -t labix.org/v2/mgo
. vendorize
tries to copy all of the dependencies including tests. I could add a flag to disable vendorizing the test dependencies.
Also it did lead me to another bug which I have now fixed :)
That is great. I will download the latest version and try again.
Yea, removing the test imports might be good. Since I didn't have that package downloaded, because I didn't run any of the tests, if you don't see it on the disk you could just ignore it.
One thing I really want is to vendor a package to a root path
vendorize -project labix.org/v2/mgo github.com/goinggo/mgo
That could move and fix the internal imports plus copy and move the external imports as well inside the project.
Then I could run this on projects that are using the old import reference.
vendorize -imports labix.org/v2/mgo github.com/goinggo/mgo
Then I could maintain one copy of the vendored code for all my projects. Update that vendored version as needed and continue to use the go tooling as it works today.
Are you interested in this functionality? I don't want to start another tool. I could contribute to your project. You won't hurt my feelings so be honest please.
Sincerely,
Bill Kennedy
On Oct 25, 2013, at 1:37 AM, Kamil Kisiel notifications@github.com wrote:
Okay, I figured out the problem. launchpad.net/gocheck is a test dependency of labix.org/v2/mgo. It's not download by default unless you go get -t labix.org/v2/mgo. vendorize tries to copy all of the dependencies including tests. I could add a flag to disable vendorizing the test dependencies.
—
Reply to this email directly or view it on GitHub.
Once I put together a small project with revel I will try the tool again. That would be a great test.
Sincerely,
Bill Kennedy
On Oct 25, 2013, at 2:06 AM, Kamil Kisiel notifications@github.com wrote:
Also it did lead me to another bug which I have now fixed :)
—
Reply to this email directly or view it on GitHub.
I would not want to vendorize the internal packages?
vendorize github.com/goinggo/mongorules github.com/goinggo/mongorules
2013/10/25 09:16:57 couldn't vendorize github.com/goinggo/mongorules/engine: couldn't vendorize github.com/goinggo/mongorules/rules: couldn't vendorize github.com/goinggo/mongorules/data: couldn't vendorize labix.org/v2/mgo: labix.org/v2/mgo: couldn't import launchpad.net/gocheck: cannot find package "launchpad.net/gocheck" in any of:
/Users/bill/go/src/pkg/launchpad.net/gocheck (from $GOROOT)
/Users/bill/example/src/launchpad.net/gocheck (from $GOPATH)
I'm not sure what you mean? It's not trying to actually copy the internal packages, the error just spawns from it trying to copy gocheck. The vendorize function is called for every package it comes across, but does not necessarily copy all of them.
"couldn't vendorize github.com/goinggo/mongorules/engine"
That message made me think there was an error trying to copy that package. The message confused me. Maybe have it say, "ignoring ...."
"vendorize" is a made up word in this case, also note that you run
vendorize on your package and not the third party ones. But I agree it
reads a bit funny, I'll think about how to make it clearer.
Kamil
On Fri, Oct 25, 2013 at 7:20 AM, ardan-bkennedy notifications@github.comwrote:
"couldn't vendorize github.com/goinggo/mongorules/engine"
That message made me think there was an error trying to copy that package.
The message confused me. Maybe have it say, "ignoring ...."—
Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-27096092
.
in this case then does "vendorize" pull in the transient dependencies of the libraries as well? seems to me if your going install the library into 3rd party, you should pull the libraries dependencies as well.
yes, the whole point of the tool is to pull in all your dependencies, including transitive dependencies.
The idea is you point it at one of your projects and it copies all of the dependencies which you don't exclude in to a different location and then rewrites all the necessary imports.
Understood.
Of course the tool is in very early stages right now, so a lot of things are probably not very clear or may not work properly. Feedback is always appreciated.
absolutely, see the latest issue :-)
Anything left to do? Maybe this can be closed.
I think so.