proxy.golang.org has inconsistent versions with git repo for golang.zx2c4.com/wireguard

272 views
Skip to first unread message

Ben Strauss

unread,
Apr 2, 2021, 3:19:35 PM4/2/21
to golang-nuts
Hi,

I'm trying to build a Go module that has a transitive dependency on golang.zx2c4.com/wireguard [1].  My organization requires me to use GOPROXY=direct.  I get the following error when running any go command:

go: github.com/influxdata/tele...@v0.0.0-00010101000000-000000000000 requires
        golang.zx2c4.com/wireguard/wgc...@v0.0.0-20200205215550-e35592f146e4 requires
        golang.zx2c4.com/wireguard@v0.0.20200121: reading golang.zx2c4.com/wireguard/go.mod at revision v0.0.20200121: unknown revision v0.0.20200121

However, if I switch to GOPROXY=https://proxy.golang.org,direct, then everything works fine.

I tracked it down to the fact that the git repo for golang.zx2c4.com/wireguard has tags without leading v's: https://git.zx2c4.com/wireguard-go/refs/tags

But proxy.golang.org somehow has versions with leading v's:
$ curl 'https://proxy.golang.org/golang.zx2c4.com/wireguard/@v/list'
v0.0.20200320
v0.0.20181001
v0.0.20180531
v0.0.20200121
v0.0.20180613
v0.0.20201118
v0.0.20180519
v0.0.20180524
v0.0.20191012
v0.0.20190409
v0.0.20180514
v0.0.20190517
v0.0.20190805
v0.0.20181222
v0.0.20190908
v0.0.20181018

Is proxy.golang.org doing something weird here?  How did it end up with those versions?  I reached out to the owner of golang.zx2c4.com/wireguard and it doesn't sound like he has changed his git tags.

I can work around this by adding the following replace directive to my main package's go.mod:

replace golang.zx2c4.com/wireguard v0.0.20200121 => golang.zx2c4.com/wireguard v0.0.0-20200121152719-05b03c675090

Or I can ask the maintainers of golang.zx2c4.com/wireguard/wgctrl to do it.  But neither of us should need to do that.

A further piece of information is that a member of my team who joined 6 months ago didn't have this problem, but when he cleaned his module cache, he reproduced it.  So something with the module mirror or go command must have changed between then and now.

Thanks for your help!

-Ben

[1]
Reply all
Reply to author
Forward
0 new messages