-
Notifications
You must be signed in to change notification settings - Fork 541
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
Failed to generate lock file when same package exists in import and testImport #741
Comments
I have a similar issue: import:
- package: github.com/Sirupsen/logrus
version: ^0.11.2
testImport:
- package: google.golang.org/grpc
version: ^1.0.5 |
I have the same issue. Do you have any clue? |
I think the best solution is to don't have a version constraint on your test dependencies. |
It's weird, I now also get an error like that even when I don't have a version constraint on one of the dependencies. |
This one is somewhat a pain in the ass for us, as we have dependencies that Glide 0.12 and earlier fails to build against (the import . "github.com/project/repo" bug), but all the 0.13 Glides (and master) are running into this -- where some transitive dependency is pulling in github.com/stretchr/testify in import but the project itself is pulling it in testImport. We can move our dependencies on stretchr/testify to import also as a quick workaround, at least. Near as I can tell, the prevailing advice is "Hope all your dependencies don't use testImport, otherwise you might not be able to build your project". I'd be interested in hearing about other ways we can possibly mitigate this. |
Two corrections: Firstly, it looks like having any of your dependencies use testImport for something that is elsewhere simply imported will not cause an issue -- at least if the dependency doesn't declare a version. Secondly, as long as we don't declare a specific version in our own usage of testImport dependencies, then this usually doesn't seem to trigger the clash. Sometimes it does, and I haven't figured out why:
This means our mitigation strategy is to testImport-depend on testify, but to set no versions anywhere in testImport for anything. This isn't ideal, but it's certainly workable for us in the short term. |
On
glide install
(glide version 0.13.0-dev) I'm getting such error:Failed to generate lock file: Generating lock produced conflicting versions of github.com/stretchr/testify. import (~1.1.4), testImport (~1.1.0)
Tell me if I'm wrong, but expected behavior would be to choose
~1.1.4
.Cheers
The text was updated successfully, but these errors were encountered: