Skip to content
This repository has been archived by the owner on Feb 26, 2019. It is now read-only.

aws-sdk-go private packages being removed on restore / save? #416

Closed
phinze opened this issue Feb 20, 2016 · 5 comments
Closed

aws-sdk-go private packages being removed on restore / save? #416

phinze opened this issue Feb 20, 2016 · 5 comments

Comments

@phinze
Copy link

phinze commented Feb 20, 2016

This is perhaps related to #400, but I wanted to start it as a separate thread and we can merge the two later it makes sense to do so.

I had a user asking how to add a dependency in Terraform, and I instructed them to:

git checkout master
godep restore
git checkout feature-branch
godep save $(go list ./... | grep -v /vendor/)

But they reported unexpected diffs in aws-sdk-go. I looked into it and on Terraform master right now, if I run:

godep restore -v
godep save -v $(go list ./... | grep -v /vendor/)

I see the removal of all packages under github.com/aws/aws-sdk-go/private/... - the diff I ended up submitting here: hashicorp/terraform#5225, assuming it was just an oversight of not updating deps after a removed import reference. But those packages are definitely necessary for operation, as Travis made immediately clear. 😀

I feel like I might be misunderstanding something here about the go list ./... | grep -v /vendor/ workaround. If I switch to go save ./... godep ends up capturing another half-dozen debug/development type dependencies -- stuff like go-spew -- from things like examples subdirs in the vendor/ tree. I'd prefer to avoid carrying around extra stuff in vendor that's not needed at runtime. But it looks like the go list approach is somehow failing to catch these transitive dependencies.

It seems to be like the pair of commands I ran should be a logical noop, but that's not what's happening. What am I missing here?

Thanks in advance for your time! 👍

❯ godep version
godep v52 (darwin/amd64/go1.5.3)
@phinze
Copy link
Author

phinze commented Feb 22, 2016

Ah I just saw the PR here #415

I believe that would solve this problem:

If I switch to go save ./... godep ends up capturing another half-dozen debug/development type dependencies -- stuff like go-spew -- from things like examples subdirs in the vendor/ tree. I'd prefer to avoid carrying around extra stuff in vendor that's not needed at runtime.

And then we could just switch to "Add a dependency" instructions like this:

git checkout master
godep restore
git checkout feature-branch
godep save ./...

Does that sound right to you, @freeformz?

@freeformz
Copy link

@phinze Yep. I was looking into why ./... wasn't working with go install's for various go1.6 setups (with vendor) because it just should have. And that's when I noticed what seems to be previously spec'd behavior that I disagree with (copying all sub dirs of a required package).

@freeformz
Copy link

@phinze checking with terraform master now to see if what godep's generates is good.

@freeformz
Copy link

Once hashicorp/terraform#5248 is merged the instructions should be:

$ git checkout master
$ godep restore
$ git checkout <feature-branch>
$ <edit code, add imports as necessary>
$ godep save ./...
$ git add -A .
$ git commit -av

If that doesn't work (except for exotic situations) then I consider it a bug.

@phinze
Copy link
Author

phinze commented Feb 23, 2016

This was solved w/ godep v54 and deps fixed up in hashicorp/terraform#5248 - thanks again @freeformz!

@phinze phinze closed this as completed Feb 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants