Open HelloGrayson opened 7 years ago
I can confirm this. I am using the latest master (because no easy way to install binaries on windows).
glide.yaml
package: github.com/ory-am/editor-platform/firewall-reverse-proxy
import:
- package: github.com/Sirupsen/logrus
version: ~0.10.0
- package: github.com/golang/mock
subpackages:
- gomock
- package: github.com/ory-am/common
subpackages:
- compiler
- env
- package: github.com/ory-am/fosite
version: ~0.3.2
- package: github.com/ory-am/hydra
version: ~0.5.2
subpackages:
- firewall
- sdk
- package: github.com/ory-am/ladon
version: ~0.2.0
- package: github.com/pkg/errors
version: ~0.7.0
- package: golang.org/x/net
subpackages:
- context
testImport:
- package: github.com/stretchr/testify
version: ~1.1.0
subpackages:
- assert
- require
log:
...
[INFO] --> Exporting gopkg.in/yaml.v2
[INFO] --> Exporting github.com/spf13/jwalterweatherman
[INFO] --> Exporting github.com/stretchr/testify
[INFO] --> Exporting github.com/spf13/cast
[INFO] --> Exporting gopkg.in/dancannon/gorethink.v2
[INFO] --> Exporting github.com/kr/fs
[INFO] --> Exporting gopkg.in/fatih/pool.v2
[INFO] --> Exporting golang.org/x/text
[INFO] --> Exporting gopkg.in/square/go-jose.v1
[INFO] Replacing existing vendor dependencies
[ERROR] Failed to generate lock file: Generating lock produced conflicting versions of github.com/stretchr/testify. import (~1.1.3), testImport (~1.1.0)
Neither of these two above yaml files produce an error for me with the current release of glide (0.12.3); however, I ran into a very similar problem. I'm not sure if this is the entire problem or not, but I think what is happening is that:
glide.yaml
indicates that pkg-A
and pkg-B
are testImport
glide update
, glide notices that pkg-B
has a Godeps.json
that depends on pkg-A
pkg-A
as an import
even though it came in via a testImport
Godepspkg-B -> pkg-A
(import
) is a different version from pkg-A
(testImport
).I think common packages are almost certain to cause this problem; my conflict was on go-diff
, which is a dep of testify
, and my workaround was to move go-diff
from a testImport
to an import
in my glide.yaml
since import
package versions trump testImport
package versions.
Ran into the same problem. Can confirm that moving to regular import works (@novas0x2a solution)
I ran into the same problem.
It's interesting.
After moving testImport to import and making glide up
I moved the dependencies back to testImport. Then ran glide up
again, and it ran without errors!
I think the best solution easiest workaround is to don't have a version constraint on your test dependencies.
I think the best solution is to don't have a version constraint on your test dependencies.
I strongly disagree
@arekkas well, "best solution" might have been a bad expression of what I meant. Let me rephrase to "easiest workaround".
Not having a version constraint doesn't work either:
package: company/team/myapp
testImport:
- package: github.com/imdario/mergo
resulting in the following error
[INFO] Replacing existing vendor dependencies
[ERROR] Failed to generate lock file: Generating lock produced conflicting versions of github.com/imdario/mergo. import (6633656539c1639d9d78127b7d47c622b5d7b6dc), testImport ()
I'm trying to move my libs test deps out of
import
and intotestImport
, so that my lib doesn't impose constraints on my users test dependencies.I've updated my
glide.yaml
to move the test deps intotestImport
:But when I run
glide up
I get the errorFailed to generate lock file: Generating lock produced conflicting versions of github.com/golang/mock. import (), testImport (master)
:The version of glide at hand is
0.12.0
:And there is a branch to reproduce this here, just run this:
Is there a way to dump more info about the error?