-
Notifications
You must be signed in to change notification settings - Fork 1k
Using dep with a project depending on "gomail" results in unbuildable package #777
Comments
Hello @dcelasun. Semver tags are preferred to branches. The solution is to update the constraints in [[constraint]]
name = "gopkg.in/gomail.v2"
branch = "v2" instead of: [[constraint]]
name = "gopkg.in/gomail.v2"
version = "2.0.0" and then make sure to run |
I think this is the same init problem that #715 is attempting to fix by having init detect the |
It definitely looks related, but #715 only applies to configs imported from other tools, right? The question is how it should behave when the only information available is the import path. I don't think there is a solution that'll satisfy every use case :/ |
Yeah they are not exact same problem but are quite similar. In this case, dep isn't following gopkg.in's sorting rules, where a branch named |
I'm going to work on this (and #776) as they are both related to how we sort/resolve gopkg.in versions. |
@carolynvs Do we have anything documented on how we handle It seems like it doesn't (or at least should not) follow the same rules as other sources, probably because |
There's no doc that I'm aware of. I am basing my understanding of things on the source code for dep https://github.com/golang/dep/blob/master/internal/gps/vcs_source.go#L285 and gopkg https://github.com/niemeyer/gopkg/blob/master/version.go#L9. In my opinion, during init dep should follow the same version matching rules that gopkg uses when parsing a gopkg URL. |
Confirming @carolynvs' answer to your question, @ibrasho - i wrote the gopkg.in implementation quite some time ago, but never did document it anywhere. We should probably create a documentation area specifically for how import path deduction works. Analogous to the go docs on remote import paths, but necessarily more detailed. |
Dear engineers, Do I understand right that this is just the way it works and you are not going to fix it? Your comments have helped a lot. I was bummed when I saw that mistake poped up after dep installation. |
@mariaefi29 Thanks for asking about this. IMO it's a bug that needs to be fixed. I thought that I had traction on it earlier but turns out that I was wrong. |
Repro steps
See minimal repro here.
Description
The problem is
dep
resolvesgopkg.in/gomail.v2
to an ancient commit (#41f3572), which doesn't have theNewDialer
function.go get
, however, does the right thing withgo get gopkg.in/gomail.v2
.What version of Go (
go version
) anddep
(git describe --tags
) are you using?What
dep
command did you run?2
dep
commands and thengo build
:Finally
go build
.What did you expect to see?
What did you see instead?
$ go build # github.com/dcelasun/depbug ./main.go:8: undefined: gomail.NewDialer
The text was updated successfully, but these errors were encountered: