Skip to content

Conversation

@vbatts
Copy link
Member

@vbatts vbatts commented Jan 26, 2017

Due to the new vendoring logic in the golang compiler it can cause
issues for projects that import a package that has vendored a package
that is used locally. See containers/image#223

This change moves the vendored sources to the package that uses them,
rather than for the whole project. Also is explictly is not vendoring
code repos from "github.com/opencontainers/". For now we'll consider
these non-remote. Though versioning may likely be future concern.

Fixes #527
Obsoletes #528

Signed-off-by: Vincent Batts [email protected]

Due to the new vendoring logic in the golang compiler it can cause
issues for projects that import a package that has vendored a package
that is used locally. See containers/image#223

This change moves the vendored sources to the package that uses them,
rather than for the whole project. Also is explictly is not vendoring
code repos from "github.com/opencontainers/". For now we'll consider
these non-remote. Though versioning may likely be future concern.

Fixes opencontainers#527
Obsoletes opencontainers#528

Signed-off-by: Vincent Batts <[email protected]>
@vbatts
Copy link
Member Author

vbatts commented Jan 26, 2017

@runcom @mtrmac PTAL
@tianon is this what you were recommending? Seems to work well enough.

@wking
Copy link
Contributor

wking commented Jan 26, 2017 via email

@tianon
Copy link
Member

tianon commented Jan 26, 2017

@vbatts depends -- if external (ie, outside this repo) Go programs are intended to import github.com/opencontainers/image-spec/schema, then this won't work since it'll (partially) force these imports upon folks using them

Generally speaking, libraries shouldn't have vendor/, but package main can (should?), so for packages that have ./cmd/abc, ./cmd/xyz, etc where all their package main lives, then ./cmd/vendor/... is 💯, but at ./vendor/..., it'd force users of ./other/package to also have these vendors.

@wking
Copy link
Contributor

wking commented Jan 26, 2017 via email

@tianon
Copy link
Member

tianon commented Jan 26, 2017

IMO that's a reasonably easy problem to solve -- just have the CI which runs the tests rename vendor to something with a src subdirectory and add it directly to the GOPATH. That way, it's easy for developers to run the tests locally against other versions of the deps if they so choose.

I really wish the Go developers had kept .../src/... in this new vendoring spec so that we could continue to use a vendor directory as a direct GOPATH component. 😞

Edit: and this is complicated slightly further by the fact that go(1) (the tool) doesn't look kindly on symlinks, and so sometimes they work, but often times they break in very obscure ways

@vbatts
Copy link
Member Author

vbatts commented Jan 26, 2017

k. so this thing hardly makes sense, and I did it wrong too.

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

Successfully merging this pull request may close these issues.

3 participants