Skip to content

project: use vndr for vendoring#27912

Merged
LK4D4 merged 1 commit intomoby:masterfrom
LK4D4:vndr
Nov 4, 2016
Merged

project: use vndr for vendoring#27912
LK4D4 merged 1 commit intomoby:masterfrom
LK4D4:vndr

Conversation

@LK4D4
Copy link
Contributor

@LK4D4 LK4D4 commented Oct 31, 2016

- What I did
Vendored all dependencies with github.com/LK4D4/vndr and removed hack/vendor.sh. Also, I've fixed some minor stuff:

  • a mistake in the comment in validate-seccomp
  • use package name instead of path in go build because pathes doesn't work correctly with AUTO_GOPATH

I tried make validate, make cross and hack/make.sh {dyn}binary in make shell with AUTO_GOPATH=1 and without it.
I think vndr provides slightly better experience than hack/vendor.sh with same features.

- How I did it
Slightly modified hack/vendor.sh to convert it to vendor.conf and ran vndr tool.
- How to verify it
Try to compile docker.
- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

cat

@cpuguy83
Copy link
Member

Yes for native vendor dir.

@cpuguy83
Copy link
Member

ping @tianon

@thaJeztah
Copy link
Member

can we keep hack/vendor.sh and make it run vendr? Also put a comment in that file to explain how to do it "the new way"?

We've taught people how to do vendoring for some time, so any pointers we could give people that are used to the existing workflow would help :D

@thaJeztah
Copy link
Member

@LK4D4
Copy link
Contributor Author

LK4D4 commented Oct 31, 2016

@thaJeztah I'd love never write bash again, but if you insist.

@thaJeztah
Copy link
Member

@LK4D4 I'm sure @tianon can help :)

@LK4D4
Copy link
Contributor Author

LK4D4 commented Oct 31, 2016

@thaJeztah put hack/vendor.sh back with comment. Where should I add doc about new vendoring process?

@thaJeztah
Copy link
Member

@LK4D4 no, this is perfect, just what I meant, thanks!

We can remove the file in a while, it's just temporary :)

@runcom
Copy link
Member

runcom commented Nov 1, 2016

works like a charm, @LK4D4 yeah pls do not remove AUTO_GOPATH 😄 (in reply of an IRC question)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo , missing p...

@justincormack
Copy link
Contributor

Apart from a minor typo, seems like a huge improvement, LGTM.

@LK4D4
Copy link
Contributor Author

LK4D4 commented Nov 1, 2016

Fixed typo. Thanks!

hack/vendor.sh Outdated

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use of Pls here is kind of weird.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right. I'll fix

vendor.conf Outdated

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this transition be a good opportunity to require hashes for each vendored repo? Relying on upstream tags kind of worries me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to keep it outside this PR because it would move it back to design review. There is no consensus among maintainers about using tags vs revisions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely for a separate PR, but my ideal would be both "tag" (if exists, and for readability) and hash. I.e. "0.5.2 -> 0.5.3" gives meaning to a change, but the hash makes sure that an upstream doesn't re-push a tag (which happened!)

Copy link
Member

@tianon tianon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks sane to me! 👍 ❤️

(just one minor comment)

hack/vendor.sh Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This $@ should be quoted, ie:

vndr "$@"

@LK4D4
Copy link
Contributor Author

LK4D4 commented Nov 2, 2016

@tianon @aaronlehmann fixed comments!

@LK4D4
Copy link
Contributor Author

LK4D4 commented Nov 3, 2016

ping @thaJeztah @vdemeester

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐸
Need vndr locally to update the vendor though right ? (we could have a make vendor or something, but could be done in a follow-up PR)

@thaJeztah
Copy link
Member

moving to merge!

Signed-off-by: Alexander Morozov <[email protected]>
@LK4D4 LK4D4 merged commit c072347 into moby:master Nov 4, 2016
@LK4D4 LK4D4 deleted the vndr branch November 4, 2016 01:30
@tamird
Copy link

tamird commented Nov 4, 2016

This breaks effectively all downstream dependents of this repo with compilation failures like:

pkg/acceptance/cluster/docker.go:285: cannot use port (type "github.com/docker/go-connections/nat".Port) as type "github.com/docker/docker/vendor/github.com/docker/go-connections/nat".Port in map index
pkg/acceptance/cluster/localcluster.go:193: cannot use retryingClient (type retryingDockerClient) as type "github.com/docker/docker/client".APIClient in field value:
    retryingDockerClient does not implement "github.com/docker/docker/client".APIClient (wrong type for ContainerCreate method)
        have ContainerCreate("golang.org/x/net/context".Context, *container.Config, *container.HostConfig, *network.NetworkingConfig, string) (container.ContainerCreateCreatedBody, error)
        want ContainerCreate("github.com/docker/docker/vendor/golang.org/x/net/context".Context, *container.Config, *container.HostConfig, *network.NetworkingConfig, string) (container.ContainerCreateCreatedBody, error)
pkg/acceptance/cluster/localcluster.go:442: cannot use map["github.com/docker/go-connections/nat".Port]struct {} literal (type map["github.com/docker/go-connections/nat".Port]struct {}) as type map["github.com/docker/docker/vendor/github.com/docker/go-connections/nat".Port]struct {} in field value

@LK4D4
Copy link
Contributor Author

LK4D4 commented Nov 4, 2016

@tamird whoa, that is really unfortunate.
I'm really not sure what to do, looks like new vendoring scheme is very bad for dependencies.

@tamird
Copy link

tamird commented Nov 4, 2016

Yes, go's vendoring feature is basically terrible for this reason :(

@LK4D4
Copy link
Contributor Author

LK4D4 commented Nov 4, 2016

Actually I kinda know what to do. Like in etcd, we need to move vendor folder under cmd. Will try tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.