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

why the image-spec has a vendor directory? #527

Closed
runcom opened this issue Jan 24, 2017 · 4 comments
Closed

why the image-spec has a vendor directory? #527

runcom opened this issue Jan 24, 2017 · 4 comments

Comments

@runcom
Copy link
Member

runcom commented Jan 24, 2017

runtime-spec doesn't have it, it doesn't vendor anything at all. Right now, this is breaking code which uses the image-spec with stuff like:

oci/layout/oci_dest.go:142: cannot use digest (type "github.com/opencontainers/go-digest".Digest) as type "github.com/opencontainers/image-spec/vendor/github.com/opencontainers/go-digest".Digest in assignment

I understand this is how golang works, but image-spec isn't going to work as a package this way..

@vbatts can we get rid of that vendoring altogether?

@runcom runcom changed the title why does the image-spec has a vendor directory? why the image-spec has a vendor directory? Jan 24, 2017
@mtrmac
Copy link
Contributor

mtrmac commented Jan 25, 2017

Similar issue: distribution/distribution#2130 .

I’d prefer dropping the vendor directory, but if that were not acceptable, at least a type Digest digest.Digest somewhere in the non-vendor parts of the tree would make the type available for casts.

vbatts added a commit to vbatts/oci-image-spec that referenced this issue 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 opencontainers#527
Obsoletes opencontainers#528

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
@stevvooe
Copy link
Contributor

@mtrmac @runcom Do your vendoring tools not remove subvendoring?

@runcom
Copy link
Member Author

runcom commented Jan 26, 2017

@stevvooe we use vndr (used is docker projects as well). The point is not what we use. The point is that packages other than the "main" one shouldn't have a vendor folder at all to me.

@mtrmac
Copy link
Contributor

mtrmac commented Jan 27, 2017

@mtrmac @runcom Do your vendoring tools not remove subvendoring?

If a library expects all its consumers to remove its vendored dependencies, then presumably the library does not care which version of those dependencies are used when the library is used in a consumer; in that case the library might just as well not vendor the dependency at all.

(Or, well, perhaps the library expects all its consumers to remove its vendored dependencies, and then vendor exactly the same version into the consumer. That breaks down pretty much every time two different libraries want to use the same dependency, in a diamond dependency pattern, because they are quite unlikely to want to use exactly the same version.)

AFAICT, it’s easiest when library APIs are backward-compatible and never remove or redefine old symbols. If that doesn't happen, vending can mask only some failure cases.

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