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

cmd/go: go.mod has non-....v2 module path error in master #33154

Closed
aspacca opened this issue Jul 17, 2019 · 6 comments
Closed

cmd/go: go.mod has non-....v2 module path error in master #33154

aspacca opened this issue Jul 17, 2019 · 6 comments
Assignees
Milestone

Comments

@aspacca
Copy link

@aspacca aspacca commented Jul 17, 2019

What version of Go are you using (go version)?

go version devel +6bf2767cc8 Tue Jul 16 15:37:25 2019 +0000 linux/amd64
go version devel +b5df14c309 Wed Jul 17 12:57:52 2019 +0000 linux/amd64

Does this issue reproduce with the latest release?

No reproducible other than go tip
it seems introduced by 24a6ca0

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="auto"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/travis/.cache/go-build"
GOENV="/home/travis/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/travis/gopath"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/travis/.gimme/versions/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/travis/.gimme/versions/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/travis/gopath/src/github.com/dutchcoders/transfer.sh/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-build599295724=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Run the CI pipeline on travis-ci for github.com/dutchcoders/transfer.sh
(see https://travis-ci.org/dutchcoders/transfer.sh/jobs/559620389 and https://travis-ci.org/dutchcoders/transfer.sh/jobs/559603532)

What did you expect to see?

go get -t -u -v ./... runs with no error

What did you see instead?

go get: upgrading gopkg.in/russross/blackfriday.v2@v2.0.1: gopkg.in/russross/blackfriday.v2@v2.0.1: invalid version: go.mod has non-....v2 module path "github.com/russross/blackfriday/v2" at revision v2.0.1

@FiloSottile FiloSottile added this to the Go1.13 milestone Jul 17, 2019
@FiloSottile FiloSottile added the modules label Jul 17, 2019
@FiloSottile FiloSottile changed the title go.mod has non-....v2 module path error in master cmd/go: go.mod has non-....v2 module path error in master Jul 17, 2019
@FiloSottile

This comment has been minimized.

Copy link
Member

@FiloSottile FiloSottile commented Jul 17, 2019

@bcmills

This comment has been minimized.

Copy link
Member

@bcmills bcmills commented Jul 17, 2019

It's unfortunate, but the error message there is not wrong.

A replace directive today means “replace the source code for module path/to/module/1 with the source code found at path/to/module/2”. It does not change the meaning of import statements, and therefore cannot reliably be used to fix incorrect import paths (see also #30831, which is similarly unfortunate).

The go.mod file in github.com/russross/blackfriday/v2 clearly declares its module path to be github.com/russross/blackfriday/v2, and if it had any internal imports you'd instead be running up against #26904.

That said, there may be something we can do for this case in the meantime.

@bcmills bcmills self-assigned this Jul 17, 2019
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jul 17, 2019

Change https://golang.org/cl/186617 mentions this issue: cmd/go: suppress errors with '@upgrade' when the latest version is replaced

@aspacca

This comment has been minimized.

Copy link
Author

@aspacca aspacca commented Jul 17, 2019

yes, the message is not wrong and the module path in the go.mod of github.com/russross/blackfriday is wrong as well, and that's why I needed the replace directive in the first place

I opened the issue to point out how it's working on current release and you may or may not want to break the behaviour

@gopherbot gopherbot closed this in 5ba15db Jul 18, 2019
@bcmills

This comment has been minimized.

Copy link
Member

@bcmills bcmills commented Jul 18, 2019

@aspacca, this should be fixed at head. Please let us know if you're still having trouble.

@aspacca

This comment has been minimized.

Copy link
Author

@aspacca aspacca commented Jul 18, 2019

@bcmills yes, build on head is now green. thank you very much, really appreciated
(ps: I will open an issue on github.com/russross/blackfriday to see if they are going to fix the go.mod on their side anyway)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.