Cli: Breaks go get -u

Created on 3 Oct 2019  ·  13Comments  ·  Source: urfave/cli

I am trying to execute go get -u ./... on my repo and get the following error:

go: gopkg.in/urfave/cli.[email protected]: go.mod has non-....v1 module path "github.com/urfave/cli" at revision v1.22.1

The urfave/cli package is an indirect dependency so I cannot fix this myself.

go env:
GOARCH="amd64"
GOBIN="/home/xxxx/go/bin"
GOCACHE="/homexxxxl/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/xxxx/go"
GOPROXY=""
GORACE=""
GOROOT="/home/paul/go"
GOTMPDIR=""
GOTOOLDIR="/home/xxx/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/xxxx/git/yyy/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build955206262=/tmp/go-build -gno-record-gcc-switches"

kinbug statuuser-feedback-required

Most helpful comment

Also, what go version. I suspect you need to move to go 1.13, given the module support has teething issues in 1.12

All 13 comments

@eccles I need two things:

  • a reproduction of this issue in CI
  • to know which upstream project is causing this problem

Can you get me that please?

Also, what go version. I suspect you need to move to go 1.13, given the module support has teething issues in 1.12

Apparently go-ethereum pulls gopkg.in/urfave/cli.v1 in.

$ go mod why gopkg.in/urfave/cli.v1
gopkg.in/urfave/cli.v1
github.com/ethereum/go-ethereum/ethclient
github.com/ethereum/go-ethereum/ethclient.test
github.com/ethereum/go-ethereum/node
github.com/ethereum/go-ethereum/internal/debug
gopkg.in/urfave/cli.v1

AND

$ go mod why github.com/urfave/cli
go: finding github.com/urfave/cli v1.22.1
go: downloading github.com/urfave/cli v1.22.1
go: extracting github.com/urfave/cli v1.22.1
go: finding github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d
go: finding github.com/russross/blackfriday/v2 v2.0.1
go: finding github.com/shurcooL/sanitized_anchor_name v1.0.0
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d
go: extracting github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d
go: downloading github.com/russross/blackfriday/v2 v2.0.1
go: extracting github.com/russross/blackfriday/v2 v2.0.1
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
go: extracting github.com/shurcooL/sanitized_anchor_name v1.0.0
github.com/urfave/cli
(main module does not need package github.com/urfave/cli)

Moving to 1.13 is not possible at the moment although it is planned

Moving to 1.13 is not possible at the moment although it is planned

Are you using go 1.12? It usually should work with it, but if not can you try
export GOPROXY=https://proxy.golang.org and check again if it works as intended?

With GOPROXY set the error changes:

2019-10-08T09:20:34.6515969Z go get: upgrading gopkg.in/urfave/cli.[email protected]: unexpected status (https://proxy.golang.org/gopkg.in/urfave/cli.v1/@v/v1.22.1.info): 410 Gone

Intersetingly with GOPROXY set I also get the 410 Gone for github.com/go-interpreter/[email protected]

2019-10-08T09:20:34.6515969Z go get: upgrading gopkg.in/urfave/cli.[email protected]: unexpected status (https://proxy.golang.org/gopkg.in/urfave/cli.v1/@v/v1.22.1.info): 410 Gone

Change gopkg.in to github.com, we only know how to publish to GitHub at the moment

Unfortunately I cant do that as it is not a direct dependency.

Adding:

// fix https://github.com/urfave/cli/issues/904
replace gopkg.in/urfave/cli.v1 => github.com/urfave/cli v1.22.1

to go.mod fixed the problem. This is a bit of a hack but might useful for others.

Does anyone think that this is a bug in go-ethereum? Should I report it there as well?

@eccles it looks like go-ethereum is using vendoring, and doesn't have a go.mod. My appraisal is that the issue here is one with golang itself, it's very hard / very confusing to mix modules and vendoring. You probably want to make an issue with go-ethereum asking them to move to go modules, it looks like nobody's reported a Github issue about that yet https://github.com/ethereum/go-ethereum/issues?utf8=✓&q=is%3Aissue+modules+vendor

@eccles I truly apologize for forcing the hack upon you 🙏 but it sounds like you've got stuff working now yeah?

Closing pending more feedback about us needing to do work here!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lynncyrin picture lynncyrin  ·  3Comments

genieplus picture genieplus  ·  5Comments

nkprince007 picture nkprince007  ·  5Comments

renzhengeek picture renzhengeek  ·  5Comments

oleorhagen picture oleorhagen  ·  4Comments