-
Notifications
You must be signed in to change notification settings - Fork 883
Replace Godep with Glide, introduce native Go vendoring #2735
Conversation
@alban @iaguis @jonboulle @lucab PTAL |
@jellonek PTAL |
@steveej PTAL |
9c0e00b
to
eb1b6a0
Compare
@sgotti PTAL |
diffstat from the command line:
I guess the github "+20 −43,382" is wrong. |
I think, I'm experiencing the Semafailure as #2718, testing |
:-/ |
So it's still false-positive :/ |
That |
What exactly is flaking? Sounds like we need to prioritise a replacement. On 2 June 2016 at 11:12, Sergiusz Urbaniak notifications@github.com wrote:
|
@jonboulle I saw |
As discussed OOB with @lucab: His idea was to introduce a Some downstream maintainers (Debian) don't care about My suggestion is not to go forward with submodules due to the nature of it, but rather decide whether we strictly want to check in Going with option 1. (not checking in the vendor directory) still puts a burden on a) downstream maintainers and b) every CI build who would need to pull ~650MB by calling |
I don't understand the proposal exactly - to keep a vendor/ directory in I think we should just stick with a checked-in vendor directory that's as
I don't really understand this bit. A thought: what if we provide a simple bash script that would fully hydrate On 3 June 2016 at 17:15, Sergiusz Urbaniak notifications@github.com wrote:
|
@jonboulle it was more like a brainstorm discussion than an actual proposal, but in short: a single submodule for Glide manifest and lockfile already cover the reproducible part. Vendoring everything in git only prevents multiple network trips and prevents disappearing repos. The downside is increased repo size, cloning time (I don't have numbers here, but I guess this PR will weight a bit) and source tarball size. Plus some downstream will strip it anyway. I was just wondering if the two concerns could be split here, but at this point it looks like it is not a great idea. |
On Fri, Jun 3, 2016 at 5:49 PM, Jonathan Boulle notifications@github.com
Nevermind, I don't understand it either, my sentence doesn't make any sense
|
@s-urbaniak good to see moving to vendor (and committing it). Probably the vendor directory size (while keeping legal files) should be (I haven't checked all the vendored packages) further reduced since some not required packages may be kept (glide-vc currently used the |
@sgotti thanks for the update! Let's move this to the next release. |
I think this should land first after 1.9.0 is cut. |
Conflicting with #2837. Please take go-systemd bump into account when rebasing. |
@squeed review? |
merged changes from #2758 |
@s-urbaniak I'm fine with the changes. Tested the workflow before and was already working ok. If @squeed is ok with it, I think we can land it once CI tests are over. |
This looks good to me! I am wondering if we should have a script that warns / fails on unpinned packages. Unless I am not understanding this correctly, it seems possible that a |
@squeed I think it is the same discussion I split to Masterminds/glide#485 |
Those are interesting discussions, but I was thinking a bit simpler :-). I was trying to think of a way to tool around the issue in Masterminds/glide#252 by enforcing that all (non-transitive) dependencies are pinned.. It probably makes sense to just drop this and wait on 252. |
reconfirmed OOB with @alban to merge it now |
This PR introduces native Go vendoring and introduces Glide in favor of godep.
The following table shows a rkt-relevant feature comparison between both tools:
GOPATH
godep restore
go get github.com/fizz/buzz && git co ... && ./scripts/godep-save
glide get -u github.com/fizz/buzz#>=v1.0 && ./scripts/update-glide.sh
,**
git pull ... && godep update ...
glade.yaml
,$ ./scripts/update-glide.sh
./scripts/godep-save
glide rm github.com/fizz/buzz && ./scripts/update-glide.sh
, see*
*
: Note that glide inv0.10.2
currently has a bug with the--delete
option. This is fixed by a small PR [2] we submitted.**
: While it is possible to fetch single packages, doing so glide really wants to update the whole tree too, see Masterminds/glide#321 for an explanation.The general method of maintaining dependencies in Glide is to edit the
glide.yaml
and callingglide update
. Theglide.yaml
specifies the desired state and declares not only concrete versions but potentially whole version ranges. Wheneverglide update
is being executed the tool then tries to bump to the newest version matching the specified version range and pins the actual commit IDs in a file calledglide.lock
. It takes care to bump to tagged versions only if a semver has been specified inglade.yaml
. Glide supports the following two modes of operation:vendor
directory not checked into the VCS, but onlyglide.yaml
andglide.lock
.vendor
directory being checked in to the VCS. For this mode one has to specify the--update-vendored, -u
flag toglide update
.For rkt option 2. is a must for having reproducible builds.
When invoking
glide update
it simply checks out the target repository without modifications into thevendor
directory. One can specify the--strip-vcs, -s
, and--strip-vendor, -v
flags to remove VCS metadata and/or nested vendor and Godeps directories. Nevertheless the size of the vendor directories is still very big, even when combined with the-s
, and-v
flags. Theglide-vc
[3] tool for stripping more unneeded files has been created to keep the vendor directory size sane. Unfortunately for rktglide-vc
actually strips too much, so we submitted a small PR [4] against it.Here are the directory sizes for rkt:
glide
glide -v -s
glide
+glide-vc
One can clearly see that the
glide
+glide-vc
combo is what we are looking for. The smaller size actually surprised me, so I made a diff exposing the differences in [5].There is an ongoing discussion in the Go community about the next "idiomatic" package/vendoring, most of the ideas captured in [6].
Also I submitted a question [7] regarding transitive dependency resolution.
[1] Masterminds/glide#366
[2] Masterminds/glide#453
[3] https://github.com/sgotti/glide-vc
[4] sgotti/glide-vc#13
[5] https://gist.github.com/s-urbaniak/10f800d20f4281edfcf8d43e5bad115f
[6] https://docs.google.com/document/d/1xrV9D5u8AKu1ip-A1W9JqhUmmeOhoI6d6zjVwvdn5mc
[7] Masterminds/glide#471
Fixes #2385