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

dep ensure is not working #169

Closed
fabianTMC opened this issue Feb 27, 2019 · 3 comments
Closed

dep ensure is not working #169

fabianTMC opened this issue Feb 27, 2019 · 3 comments

Comments

@fabianTMC
Copy link

If I try dep ensure -add github.com/mailgun/mailgun-go or dep ensure -add github.com/mailgun/mailgun-go/v3, I get the following error:

Solving failure: No versions of github.com/mailgun/mailgun-go met constraints:
        v3.3.0: Could not introduce github.com/mailgun/mailgun-go@v3.3.0, as its subpackage github.com/mailgun/mailgun-go/v3 is missing. (Package is required by (root).)
        v3.2.0: Could not introduce github.com/mailgun/mailgun-go@v3.2.0, as it is not allowed by constraint ^3.3.0 from project projectname.
        v3.1.0: Could not introduce github.com/mailgun/mailgun-go@v3.1.0, as it is not allowed by constraint ^3.3.0 from project projectname.
        v3.0.1: Could not introduce github.com/mailgun/mailgun-go@v3.0.1, as it is not allowed by constraint ^3.3.0 from project projectname.
        v3.0.0: Could not introduce github.com/mailgun/mailgun-go@v3.0.0, as it is not allowed by constraint ^3.3.0 from project projectname.
        v2.0.0: Could not introduce github.com/mailgun/mailgun-go@v2.0.0, as it is not allowed by constraint ^3.3.0 from project projectname.
        v1.1.1: Could not introduce github.com/mailgun/mailgun-go@v1.1.1, as it is not allowed by constraint ^3.3.0 from project projectname.
        v1.1.0: Could not introduce github.com/mailgun/mailgun-go@v1.1.0, as it is not allowed by constraint ^3.3.0 from project projectname.
        v1.0.2: Could not introduce github.com/mailgun/mailgun-go@v1.0.2, as it is not allowed by constraint ^3.3.0 from project projectname.
        v1.0.1: Could not introduce github.com/mailgun/mailgun-go@v1.0.1, as it is not allowed by constraint ^3.3.0 from project projectname.
        v1.0.0: Could not introduce github.com/mailgun/mailgun-go@v1.0.0, as it is not allowed by constraint ^3.3.0 from project projectname.
        3.3.0-rc.1: Could not introduce github.com/mailgun/mailgun-go@3.3.0-rc.1, as it is not allowed by constraint ^3.3.0 from project projectname.
        v3.0.0-rc.2: Could not introduce github.com/mailgun/mailgun-go@v3.0.0-rc.2, as it is not allowed by constraint ^3.3.0 from project projectname.
        v3.0.0-rc.1: Could not introduce github.com/mailgun/mailgun-go@v3.0.0-rc.1, as it is not allowed by constraint ^3.3.0 from project projectname.
        master: Could not introduce github.com/mailgun/mailgun-go@master, as it is not allowed by constraint ^3.3.0 from project projectname.
        brendan/add-black-greylisting-reasons: Could not introduce github.com/mailgun/mailgun-go@brendan/add-black-greylisting-reasons, as it is not allowed by constraint ^3.3.0 from project projectname.
        issue/159: Could not introduce github.com/mailgun/mailgun-go@issue/159, as it is not allowed by constraint ^3.3.0 from project projectname.
        kristen/go-messages: Could not introduce github.com/mailgun/mailgun-go@kristen/go-messages, as it is not allowed by constraint ^3.3.0 from project projectname.
        release/2.0.0: Could not introduce github.com/mailgun/mailgun-go@release/2.0.0, as it is not allowed by constraint ^3.3.0 from project projectname.
        thrawn/develop: Could not introduce github.com/mailgun/mailgun-go@thrawn/develop, as it is not allowed by constraint ^3.3.0 from project projectname.
        travis-testing: Could not introduce github.com/mailgun/mailgun-go@travis-testing, as it is not allowed by constraint ^3.3.0 from project projectname.
        v2.0.0-RC1: Could not introduce github.com/mailgun/mailgun-go@v2.0.0-RC1, as it is not allowed by constraint ^3.3.0 from project projectname.
        V3.0.0: Could not introduce github.com/mailgun/mailgun-go@V3.0.0, as it is not allowed by constraint ^3.3.0 from project projectname
@thrawn01
Copy link
Contributor

@fabianTMC What version of golang and dep are you using. I'm using a build from master and it works. You may have another version that doesn't know how to handle go modules

$ dep version
dep:
 version     : devel
 build date  :
 git hash    :
 go version  : go1.11.1
 go compiler : gc
 platform    : darwin/amd64
 features    : ImportDuringSolve=false

@JDiPierro
Copy link

JDiPierro commented Aug 8, 2019

I'm having what looks to be the same issue:

$ dep version
dep:
 version     : v0.5.3
 build date  : 2019-05-19
 git hash    : 192eb44
 go version  : go1.12.5
 go compiler : gc
 platform    : darwin/amd64
 features    : ImportDuringSolve=false

I'm not using Go Modules so I'm importing mailgun with: import "github.com/mailgun/mailgun-go"
and I added a constraint to the Gopkg.toml:

[[constraint]]
  name = "github.com/mailgun/mailgun-go"
  version = "v3.6.0"

but when I run dep ensure I get:

Solving failure: No versions of github.com/mailgun/mailgun-go met constraints:
	v3.6.0: "github.com/mailgun/mailgun-go" imports "github.com/mailgun/mailgun-go/v3/events", which contains malformed code: no package exists at "github.com/mailgun/mailgun-go/v3/events"

Followed by a lot of version failures because of my constraint.

If I remove the version constraint dep ensure will run successfully but it pulls v1.1.1.. but I'd prefer to have the most recent version.

The only solution I've been able to find is to have Dep ignore the mailgun package by adding this to the Gopkg.toml:

ignored = ["github.com/mailgun/mailgun-go"]

And adding go get github.com/mailgun/mailgun-go to our build process.

@thrawn01
Copy link
Contributor

thrawn01 commented Aug 9, 2019

@JDiPierro unfortunately go dep has an outstanding bug golang/dep#1963 and is not compatible with versioned go modules.

From looking at the go dep repo it appears the project has stalled and I wouldn't expect a fix from them any time soon. You might want to consider switching your project to go modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants