Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Equivalent of godep restore ? #366

Closed
thockin opened this issue Apr 3, 2016 · 10 comments
Closed

Equivalent of godep restore ? #366

thockin opened this issue Apr 3, 2016 · 10 comments

Comments

@thockin
Copy link
Contributor

thockin commented Apr 3, 2016

This is going to be weird, but we need something...

First, we want to vendor code into the vendor dir with glide.

Issue: we still build using go-1.4 for production binaries (we have a major perf hit in 1.5 and 1.6, we're working on it). Obviously, go-1.4 does not support the vendor dir. With Godep we have a choice - godep restore will check out the vendored revisions into my GOPATH so I can go build, or I can say godep go build and it will munge my GOPATH and build.

Glide seems to sort of kind of, but not really, support something similar in the form of glide update -u --cache-gopath --strip-vcs --strip-vendor - this pulls all the revisions from upstream and stores them in my GOPATH. But in so doing, it removes and re-adds them in my project (which leaves a mess if it is aborted or crashes or anything) and it always updates glide.lock (just the timestamp).

We also do this in our CI to make sure that our vendor dir is still recreate-able from upstream and that the Godeps file (soon to be a glide file) is valid. Changing glide.lock makes it harder to detect success (defined as no net change).

Is there any way to do a "non-modifying" operation that doesn't futz with glide.lock or my local vendor dir, but still pulls the versioned code from upstream into my GOPATH and strips VCS and vendor dirs? Or maybe we can live with messing with the local dirs but not changing glide.lock ?

@sdboyer
Copy link
Member

sdboyer commented Apr 3, 2016

FWIW, i would generally prefer to see the timestamp either removed, or not updated if the file isn't changed - i'm not clear on what valuable information it's communicating by updating just the timestamp. (anybody interested in that information can effectively get it from the controlling VCS).

Maybe @mattfarina can enlighten me?

@thockin
Copy link
Contributor Author

thockin commented Apr 5, 2016

@vishh a less huge issue for kubernetes

@mattfarina
Copy link
Member

Since this problem is generally going to go away I would suggest this as a plugin. I've seen this request a couple times. Basically, I could suggest a plugin that copies the contents of the vendor/ folder to the appropriate location in the GOPATH. Would that work?

@sdboyer The timestamp is to tell people or tooling when the last update occurred. If nothing has changed we can likely skip updating the timestamp.

@thockin
Copy link
Contributor Author

thockin commented Apr 5, 2016

Both suggestions sound good to me.

Specifically:

  1. something like glide copy-to-gopath which copies from vendor/ to GOPATH
  2. don't change timestamp on glide update unless something has changed

On Tue, Apr 5, 2016 at 11:04 AM, Matt Farina notifications@github.com
wrote:

Since this problem is generally going to go away I would suggest this as a
plugin. I've seen this request a couple times. Basically, I could suggest a
plugin that copies the contents of the vendor/ folder to the appropriate
location in the GOPATH. Would that work?

@sdboyer https://github.com/sdboyer The timestamp is to tell people or
tooling when the last update occurred. If nothing has changed we can likely
skip updating the timestamp.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#366 (comment)

@sdboyer
Copy link
Member

sdboyer commented Apr 5, 2016

The timestamp is to tell people or tooling when the last update occurred. If nothing has changed we can likely skip updating the timestamp.

👍

@thockin
Copy link
Contributor Author

thockin commented Apr 12, 2016

Given that we're going to embrace go-1.6, I only really need the fix to not touch timestamp unless other things have changed. thoughts?

@mattfarina
Copy link
Member

Two address the issues here.

  • The timestamp is now only changed if the content has changed.
  • With Go 1.7 not allowing for the disabling of the vendor experiment and security updates only for 1.7 and 1.6 I think we can skip the copy to gopath functionality.

I'm going to close this. If k8s does adopt glide and we need the copy-to-gopath I can make a plugin as part of my k8s time.

@thockin
Copy link
Contributor Author

thockin commented Aug 19, 2016

I think the main requirement is to test that I can recreate the currently
committed vendor/ tree from the various upstream sources.

On Fri, Aug 19, 2016 at 10:15 AM, Matt Farina notifications@github.com
wrote:

Two address the issues here.

  • The timestamp is now only changed if the content has changed.
  • With Go 1.7 not allowing for the disabling of the vendor experiment
    and security updates only for 1.7 and 1.6 I think we can skip the copy to
    gopath functionality.

I'm going to close this. If k8s does adopt glide and we need the
copy-to-gopath I can make a plugin as part of my k8s time.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#366 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFVgVFG3aLVlx01973ylZRUa2O3RcWkAks5qheS2gaJpZM4H-eZp
.

@mattfarina
Copy link
Member

@thockin with the exception of the new client-go that resides within the staging area of k8s and needs to be copied to vendor/ you can do that. Do you need to maintain that workflow for long?

@thockin
Copy link
Contributor Author

thockin commented Aug 22, 2016

The client-go hack? yeah, that's a temporary hack. The general "must be
able to restore from the wild" flow we want.

On Mon, Aug 22, 2016 at 10:52 AM, Matt Farina notifications@github.com
wrote:

@thockin https://github.com/thockin with the exception of the new
client-go that resides within the staging area of k8s and needs to be
copied to vendor/ you can do that. Do you need to maintain that workflow
for long?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#366 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFVgVP4bCyklnjrErIN47dhtroC8NHmgks5qieHUgaJpZM4H-eZp
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants