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

Cannot use info.Digest as github.com/containers/storage/vendor/github.com/opencontainers/go-digest #605

Closed
emolitor opened this issue Apr 27, 2020 · 4 comments
Labels

Comments

@emolitor
Copy link

I've created a project that couples Starlark with Buildah (inducing a transitive dependency on github.com/containers/image) to simplify building packages for my toy Linux distribution. This may simply be user error but when I go get my project I get the following error. However when I use go build it works fine. Searching around the only issue I could find that might be related to this is golang/go#30354 I wanted to confirm whether or not go get is expected to work? I'm relatively new to go so it's very possible "I'm doing it wrong". :)

emolitor@DESKTOP-VJPGU2V:~$ go get github.com/esplinux/espbuild
# github.com/containers/image/storage
go/src/github.com/containers/image/storage/storage_image.go:150:73: cannot use info.Digest (type "github.com/opencontainers/go-digest".Digest) as type "github.com/containers/storage/vendor/github.com/opencontainers/go-digest".Digest in argument to s.imageRef.transport.store.LayersByUncompressedDigest
go/src/github.com/containers/image/storage/storage_image.go:267:4: cannot use layer.UncompressedDigest (type "github.com/containers/storage/vendor/github.com/opencontainers/go-digest".Digest) as type "github.com/opencontainers/go-digest".Digest in field value
go/src/github.com/containers/image/storage/storage_image.go:490:79: cannot use blobinfo.Digest (type "github.com/opencontainers/go-digest".Digest) as type "github.com/containers/storage/vendor/github.com/opencontainers/go-digest".Digest in argument to s.imageRef.transport.store.LayersByUncompressedDigest
go/src/github.com/containers/image/storage/storage_image.go:496:34: cannot use layers[0].UncompressedDigest (type "github.com/containers/storage/vendor/github.com/opencontainers/go-digest".Digest) as type "github.com/opencontainers/go-digest".Digest in assignment
go/src/github.com/containers/image/storage/storage_image.go:505:76: cannot use blobinfo.Digest (type "github.com/opencontainers/go-digest".Digest) as type "github.com/containers/storage/vendor/github.com/opencontainers/go-digest".Digest in argument to s.imageRef.transport.store.LayersByCompressedDigest
go/src/github.com/containers/image/storage/storage_image.go:511:34: cannot use layers[0].UncompressedDigest (type "github.com/containers/storage/vendor/github.com/opencontainers/go-digest".Digest) as type "github.com/opencontainers/go-digest".Digest in assignment
go/src/github.com/containers/image/storage/storage_image.go:524:72: cannot use uncompressedDigest (type "github.com/opencontainers/go-digest".Digest) as type "github.com/containers/storage/vendor/github.com/opencontainers/go-digest".Digest in argument to s.imageRef.transport.store.LayersByUncompressedDigest
go/src/github.com/containers/image/storage/storage_image.go:530:37: cannot use layers[0].UncompressedDigest (type "github.com/containers/storage/vendor/github.com/opencontainers/go-digest".Digest) as type "github.com/opencontainers/go-digest".Digest in assignment
go/src/github.com/containers/image/storage/storage_image.go:536:39: cannot use layers[0].UncompressedDigest (type "github.com/containers/storage/vendor/github.com/opencontainers/go-digest".Digest) as type "github.com/opencontainers/go-digest".Digest in assignment
go/src/github.com/containers/image/storage/storage_image.go:691:73: cannot use diffID (type "github.com/opencontainers/go-digest".Digest) as type "github.com/containers/storage/vendor/github.com/opencontainers/go-digest".Digest in argument to s.imageRef.transport.store.LayersByUncompressedDigest
go/src/github.com/containers/image/storage/storage_image.go:691:73: too many errors
@mtrmac
Copy link
Collaborator

mtrmac commented Apr 27, 2020

Thanks for your report.

This happens because containers/storage contains a vendor subdirectory in the repository, and thus it refers to types defined in that directory (you can verify this by manually removing $GOPATH/src/github.com/containers/storage/vendor.) Compare distribution/distribution#2130 .

One way to get things to work is to force the go get to be module-aware (which cause the vendor directory to be ignored): GO111MODULE=on go get ….

Moving to c/storage to consider no longer committing the vendor subdirectory

@mtrmac mtrmac transferred this issue from containers/image Apr 27, 2020
@rhatdan
Copy link
Member

rhatdan commented Apr 27, 2020

@nalind WDYT?

@rhatdan
Copy link
Member

rhatdan commented Aug 3, 2020

@nalind PTAL

@rhatdan
Copy link
Member

rhatdan commented Jun 14, 2021

Since there has been no movement on this in a year, I am going to consider this as a WONTFIX

@rhatdan rhatdan closed this as completed Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants