vendorize icon indicating copy to clipboard operation
vendorize copied to clipboard

vendorize non-deterministically fails to rewrite some imports

Open dmac opened this issue 9 years ago • 2 comments

I've seen behavior where vendorize will sometimes not rewrite import paths. I've created a small reproducible project at http://github.com/dmac/vendorize-issue. In the failure cases I've seen, vendorize will correctly copy the imported transitive dependency into the specified vendor directory, but it will not update the corresponding import path in the requiring dependency. This results in build failures like the following:

# github.com/dmac/vendorize-issue/vendor/github.com/aws/aws-sdk-go/internal/signer/v4
vendor/github.com/aws/aws-sdk-go/internal/signer/v4/v4.go:70: invalid operation: req.Service.Config.Credentials == "github.com/dmac/vendorize-issue/vendor/github.com/aws/aws-sdk-go/aws/credentials".AnonymousCredentials (mismatched types *"github.com/aws/aws-sdk-go/aws/credentials".Credentials and *"github.com/dmac/vendorize-issue/vendor/github.com/aws/aws-sdk-go/aws/credentials".Credentials)
vendor/github.com/aws/aws-sdk-go/internal/signer/v4/v4.go:92: cannot use req.Service.Config.Credentials (type *"github.com/aws/aws-sdk-go/aws/credentials".Credentials) as type *"github.com/dmac/vendorize-issue/vendor/github.com/aws/aws-sdk-go/aws/credentials".Credentials in field value

These failures are non-deterministic. Vendoring from scratch each time, sometimes all imports will be vendored and rewritten correctly and the build will succeed. Other times, one or more of the import paths will not be rewritten and the build will fail.

dmac avatar Jun 30 '15 01:06 dmac

Were you able to reproduce this?

dmac avatar Jul 06 '15 17:07 dmac

Sorry, I haven't had time to look in to it yet.

kisielk avatar Jul 06 '15 18:07 kisielk