-
Notifications
You must be signed in to change notification settings - Fork 532
golang: migrate to Godep alternative? #775
Comments
"Are you used to tools such as Cargo..." LGTM |
See also etcd-io/etcd#4913 which is causing me quite some consternation. +1 to moving away from godep and tentative +1 to glide. Please don't check in vendored dependencies for any repo which may conceivably be imported from other packages. /cc @sdboyer |
As a POC I tried to move dex over to glide (with some help from @chancez). Moving from godepSince we'd like dex to be buildable with only a Go installation, and dex is never imported, I attempted to check in a The command to move dex from godep to glide was: $ glide init This created a package: github.com/coreos/dex
import:
- package: github.com/coreos/go-oidc
version: 6039032c0b15517897116d333ead8edf38792437
subpackages:
- http
- jose
- key
- oauth2
- oidc To (re)populate the
This creates a
All of these flags are mandatory. For instance, I omitted the Glide downloaded the packages at the correct version and everything worked fine. It leaves a bunch of junk in the Updating a dependencyAs a test, I tried to update a package dex depends on. To do this, I looked up the latest commit of diff --git a/glide.yaml b/glide.yaml
index 905dcc9..4bdb943 100644
--- a/glide.yaml
+++ b/glide.yaml
@@ -36,7 +36,7 @@ import:
- diff
- pretty
- package: github.com/lib/pq
- version: 7175accbed18058468c07811f76440d6e8d7cf19
+ version: 3cd0097429be7d611bb644ef85b42bfb102ceea4
- package: github.com/mailgun/mailgun-go
version: 9578dc67692294bb7e2a6f4b15dd18c97af19440
- package: github.com/mattn/go-sqlite3
This downloads all of dex's dependencies before updating Misc notes
|
I'm 👍 for glide. I think commiting our vendored deps also needs to be potentially re-considered, or re-thought. We commit
For 1 we can solve this by using some sort of tool that has a lockfile for retrieving all packages at a specified revision, glide supports this already. For 2 and 3 we have a few choices: One option is to continue committing the vendor dir into our repositories, I'm not a huge fan of this, as it causes problems with downstream users of our packages if they do not remove nested vendor directories. Glide will allow us to do this, and supports stripping most anything we need. Another option is to fork upstream projects and/or re-host/mirror upstream dependencies, and use repository aliasing (a glide feature) to tell Glide where to pull upstream packages from, without changing the actual import path used in code. This adds more burden on us to maintain these copies, but that might be worth while. To fix the issue with any hosting location potentially going down, or disappearing, we should always maintain a copy somewhere. A final option I've considered is a mixture of the above. Instead of saving dependencies into |
Great to hear you folks are trying glide!
It's worth noting that we are actively working on getting rid of both the That'll also mean the It'll probably still be a few weeks - I have to get the new engine shipshape - but the ball is rolling, so it's just a matter of time. |
From @ericchiang
Glide is planning on adding native functionality to strip packages which are not directly used IIRC, but https://github.com/sgotti/glide-vc/ does support removing the packages we dont directly import, and a few other things, which we can use to address that concern. |
Thats AWESOME - means much better experience with tools like gvm |
🎉 all That said, the kubernetes folks - being that they're stuck on Go 1.4 due to performance regressions - did put in a request (Masterminds/glide#374) to allow ...though again, that's only after the new engine comes in, if at all. |
Folks, I thought I'd jump in here and say hi. I'm one of the authors of Glide. Along with others, like @sdboyer, we're working to make a better overall experience. I'm happy to try and answer any of your questions if you have them. |
* Use glide for dependency management * coreos/docs#775
* Use glide for dependency management * coreos/docs#775
* Use glide for dependency management * coreos/docs#775
We currently recommend godep as our standard solution for vendoring dependencies in CoreOS golang projects, but there are massive inconsistencies in how it's used (e.g. using the vendor experiment or not, rewriting or not, using scripts for management), and some projects don't use it at all. And of course it provides a lot of difficulty for many developers trying to upgrade dependencies (not even going to bother to provide references for this point).
Given the number of developer hours we still lose to fiddling with Godep, and the general community sentiment towards it (e.g. projects like Kubernetes considering moving), it would be nice if we could agree on a sensible replacement with a more usable workflow, and recover a semblance of standardisation across CoreOS projects whereever possible.
The primary contender at the moment (ancedotally, see below) is glide.
Assorted non-exhaustive references:
rkt/rkt#1933
rkt/rkt#1424
coreos/coreos-baremetal#82
containers/build#186
Masterminds/glide#303 (Kubernetes + others investigating migrating)
The text was updated successfully, but these errors were encountered: