-
Notifications
You must be signed in to change notification settings - Fork 79
Add script/bootstrap
to install dependencies in ./_vendor
#67
Conversation
This helps newcomers who might have cloned the repo into an environment where they haven't yet set up proper GOPATH structure, and enables them to run tests and hack on the project.
Your script is doing what |
Yeah, I'm reiterating on that approach. I purposely not using a package manager because I feel one is not needed if |
I agree that vendoring dependencies is the best approach for a Go library. But I think instead of providing a bootstrap script, it'd be better to version control all dependencies:
This approach will make The only drawback with this IMO is the long package name. But it's not a show stopper. |
Interesting approach. If I understand correctly, you also want us to load these vendored dependencies at runtime as well (when go-octokit is included in a larger project), not just in development? Do you have examples of other libraries taking the same approach? I went for |
That's right, the dependency tree would look something like this:
And
There's a GopherCon talk about this earlier (skip to the dependency manager section). docker is actually adopting similar approach with this script. Any app develops on top of
Yup, I see what you're trying to accomplish there. Using Note that this is the first library I'm trying it. No worry if it sounds too "untraditional", we could go with using |
Pulling in @technoweenie and @pengwynn for the discussion |
After talking to some Soundcloud engineers who seem to do a lot of Go for their (mosly internal) toolset, I was convinced that vendoring dependencies and rewriting imports is the way to go. So basically you were right. I'm gonna redo this PR when I have time with the new approach. Ideally only maintainers (i.e. us) should ever have to use a tool like Godep or a custom script when bumping up dependencies, but any contributors to the library should be good to go after just cloning this repository. |
@pengwynn I'm not working on this currently. Feel free to move ahead. There's a on-going discussion about dependency & vendoring. For a library like go-octokit, it's not recommended to vendor dependencies. Vendoring is only used for binaries, e.g., hub. We'd still need to maintain the API stability for go-octokit. |
@pengwynn @jingweno
If I'm understanding correctly, we want to write a script that does exactly the above, correct? This involves adding
Thanks for reading and please let me know what you think! |
@feiranchen Sorry if I didn't make it more clear. But let me try to explain. Disclaimer: Vendoring is not yet implemented in Go and there's a WIP spec for vendoring tools.
That being said. I would recommend not to vendor dependencies for packages like This PR could be closed. |
Thanks @jingweno. Gonna close this and we can revisit vendoring 🔜. |
This helps newcomers who might have cloned the repo into an environment where they haven't yet set up proper GOPATH structure, and enables them to run tests and hack on the project.
It is also a step towards vendoring all dependencies in git; hence the cleanup of unnecessary files. Ideally no bootstraping should be required when someone clones this project.
/cc @jingweno