facebookarchive / grace

Graceful restart & zero downtime deploy for Go servers.

Home Page:https://godoc.org/github.com/facebookgo/grace

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[question] including grace as a vendor-ed dependency?

thisisaaronland opened this issue · comments

Hi,

We are using grace to good effect over here so first of all, thanks!

https://github.com/whosonfirst/go-whosonfirst-pip/

However when we try to bundle grace (and its friends) as vendored dependencies they don't appear to be being saved:

https://github.com/whosonfirst/go-whosonfirst-pip/tree/master/vendor/src/github.com/facebookgo

Is this is a limitation that FB has imposed on these libraries or am I just doing it wrong (always possible...) ?

Glad to hear it's working well for you!

We haven't done anything that should prevent vendoring. Can you tell me more about what doesn't work as expected? Is there an error you could share with me?

Mostly just that the various facebookgo packages get included in the vendor dir, but then when you clone the (pip) repo to a new machine the (facebook) packages are empty.

I will try purging and re-adding them to see what happens. Git is weird. Go vendoring is weirder...

Ah, you're trying to use git submodules and having trouble with them. I haven't used them much recently, but I think you forgot to check in your .gitmodules file after you added the submodules. Once you add that file, if you clone your repo using something like:

git clone --recursive git@github.com:whosonfirst/go-whosonfirst-pip.git

It should clone your repo along with your vendored dependencies.

PS: Personally I've found submodule to be confusing and annoying to work with in practice. Personally I prefer to check-in my vendor directory. If you'd like to avoid that, then I think something like https://github.com/tools/godep might still be a better alternative to submodules.

In any case I think this isn't an issue with the library so I'm closing this issue.

Yeah, the vendor directory should be checked in but... Git is (still) weird. Anyway, thanks for the clarification about the FB packages. I will keep poking at this until it works.

Ah, I know what you did now. After you checkout the dependencies in the vendor directory, rm -rf .git in each of the dependencies directories, then check them in. I think that'll fix it.

If there's a way to make Git and the vendor stuff play nicely then it is apparently beyond me :-)

I just gave up, removed vendor from GOPATH and hit it with a bigger stick. It may not be pretty but at least it works now, particularly for people who don't care about the details. Thanks again for your help!

https://github.com/whosonfirst/go-whosonfirst-pip/blob/master/Makefile#L7-L33