-
Notifications
You must be signed in to change notification settings - Fork 9
Consider using dep for vendoring #2
Comments
I'm not sure if this is the right approach since the current solution (inserting dependencies as actual copies and not submodules or similar link based solutions) offers very appealing guarantees:
If dependencies mutate or disappear for whatever reason then this library won't be affected at all and will continue produce predictable builds. If the vendor directory was big with lots of dependencies then it'd be a problem, but it's only 228KB, not much to be honest, and it could even be stripped down to 160 removing non-source-code stuff such as the examples. Is there something special about dep that I'm missing here? |
I haven't seen an enforcement of the |
As of Go 1.6 the vendoring feature is enabled by default and as we do not plan to support anything below 1.6 all dependencies are embedded into the vendor directory for the reasons described above. Is there still any problem with the current solution or can I close this issue? |
Talking about go get by the way one should always remember that |
Currently, you vendor gorilla/websocket by hands, without using any tools. This approach has two issues:
I propose one of the two approaches:
The current approach, in my opinion, is the worst of two worlds. |
Oh no, I'm not proposing submodules or symlinks. Please no. |
We only use stable versions from the official releases, currently it's v1.2.0. If we ever change or update the underlying socket implementation we will mention that in the change log for the evolution to be transparent to our users.
I think neither library users nor their dependency management tools need to know or care that gorilla/websocket is used internally. We're providing a websockets abstraction after all so you don't have to care about low level stuff. Your dependency management tool thus should consider qbeon/webwire-go and gorilla/websocket a single piece of code.
I'm trying to prevent getting tons of issues referencing strange bugs which we then have to spend time debugging on just to find out It's a problem caused by the user fetching the wrong version of the dependencies. Nobody wants that, so better keep dependencies embedded and immutable.
By "link-based approach" I meant when there's no copy of the dependencies embedded and you'll have to explicitly get it from a remote source, be it a submodule, a reference from Summary
|
Sorry, but that's not true. gorilla/websocket leaks into webwire's public API: https://godoc.org/github.com/qbeon/webwire-go#NewClientAgent And it can't be used as-is: https://github.com/AlekSi/webwire-vendoring/
To make it work, both gorilla/websocket and webwire should be vendored, and nested vendor/ directory should be stripped. And since there is not machine-readable information about the version of gorilla/websocket you use, some other version may be used. |
It's good that you mention that, this is obviously a mistake and I'll fix it as soon as I can, thank you! Normally users won't confront gorilla/websocket when using qbeon/webwire-go so the fact that webwire is an abstraction hiding the internal websocket implementation for good reason remains true. The 3 questions from the above summary thus still remain unanswered. |
As of commit #2daff67 gorilla/websocket is no longer exported to the public API of qbeon/webwire-go. All socket interactions are now done through the new abstract socket and upgrader interfaces which make the underlying socket implementation interchangeable. This should make dep work without requiring gorilla/websocket. |
But that assumption should be checked. :) I checked it for you: https://github.com/qbeon/webwire-go As you can see, But so far it looks to me that you actively fighting against Go best practices for dependencies management. You asked for feedback and review, and I delivered. And now I'm going on vacation. 😄 |
First, thank you very much for taking your time, we appreciate it! Does this mean
I'm not fighting against best practices, actually I'm trying to ensure all of the three questions above ↑ are answered properly to:
|
As of commit #216d118 support for The embedded vendor directory containing the default gorilla/websocket depedency won't be removed for this repository to remain When I consider this issue resolved, if there's still anything to be discussed then we can reopen it any time. |
That will simplify life for those who use both this library and gorilla/websocket directly.
The text was updated successfully, but these errors were encountered: