vendorize
vendorize copied to clipboard
vendorize non-deterministically fails to rewrite some imports
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.
Were you able to reproduce this?
Sorry, I haven't had time to look in to it yet.