Skip to content

modules: go1.11beta2 fails to "find" dependency although regular git succeeds #26568

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

Closed
akavel opened this issue Jul 24, 2018 · 5 comments
Closed

Comments

@akavel
Copy link
Contributor

akavel commented Jul 24, 2018

Please answer these questions before submitting your issue. Thanks!

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

$ go1.11beta2 version
go version go1.11beta2 linux/amd64

Does this issue reproduce with the latest release?

yes, with the latest beta

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/akavel/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/akavel/gopath/src/CENSORED/_vendor:/home/akavel/gopath"
GOPROXY=""
GORACE=""
GOROOT="/home/akavel/sdk/go1.11beta2"
GOTMPDIR=""
GOTOOLDIR="/home/akavel/sdk/go1.11beta2/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build946318930=/tmp/go-build -gno-record-gcc-switches"

What did you do?

$ git clone -b go-mod-trouble https://github.com/akavel/g-wiki
Cloning into 'g-wiki'...
remote: Counting objects: 444, done.
remote: Compressing objects: 100% (96/96), done.
remote: Total 444 (delta 125), reused 165 (delta 97), pack-reused 248
Receiving objects: 100% (444/444), 3.17 MiB | 578.00 KiB/s, done.
Resolving deltas: 100% (215/215), done.
Checking connectivity... done.
Note: checking out '0178ca70cf1011109d63a0eeeb94a10af14d3ec4'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

$ cd g-wiki
$ go1.11beta2 run wiki.go -help
go: finding gopkg.in/russross/blackfriday.v1 v1.5.1
go: gopkg.in/russross/[email protected]: unknown revision refs/tags/v1.5.1
go: error loading module requirements
$ go1.11beta2 get -v -d
Fetching https://gopkg.in/russross/blackfriday.v1?go-get=1
Parsing meta tags from https://gopkg.in/russross/blackfriday.v1?go-get=1 (status code 200)
get "gopkg.in/russross/blackfriday.v1": found meta tag get.metaImport{Prefix:"gopkg.in/russross/blackfriday.v1", VCS:"git", RepoRoot:"https://gopkg.in/russross/blackfriday.v1"} at https://gopkg.in/russross/blackfriday.v1?go-get=1
go: finding gopkg.in/russross/blackfriday.v1 v1.5.1
go: gopkg.in/russross/[email protected]: unknown revision refs/tags/v1.5.1
go: error loading module requirements
$ go1.11beta2 get -v -d -u
Fetching https://gopkg.in/russross/blackfriday.v1?go-get=1
Parsing meta tags from https://gopkg.in/russross/blackfriday.v1?go-get=1 (status code 200)
get "gopkg.in/russross/blackfriday.v1": found meta tag get.metaImport{Prefix:"gopkg.in/russross/blackfriday.v1", VCS:"git", RepoRoot:"https://gopkg.in/russross/blackfriday.v1"} at https://gopkg.in/russross/blackfriday.v1?go-get=1
go: finding gopkg.in/russross/blackfriday.v1 v1.5.1
go: gopkg.in/russross/[email protected]: unknown revision refs/tags/v1.5.1
go: error loading module requirements
$ cd ..
$ git clone -b v1.5.1 https://github.com/russross/blackfriday tmp1
Cloning into 'tmp1'...
remote: Counting objects: 2334, done.
remote: Total 2334 (delta 0), reused 0 (delta 0), pack-reused 2334
Receiving objects: 100% (2334/2334), 1.24 MiB | 258.00 KiB/s, done.
Resolving deltas: 100% (1452/1452), done.
Checking connectivity... done.
Note: checking out '55d61fa8aa702f59229e6cff85793c22e580eaf5'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

$ git clone -b v1.5.1 https://gopkg.in/russross/blackfriday.v1 tmp2
Cloning into 'tmp2'...
remote: Counting objects: 2324, done.
remote: Total 2324 (delta 0), reused 0 (delta 0), pack-reused 2324
Receiving objects: 100% (2324/2324), 1.23 MiB | 809.00 KiB/s, done.
Resolving deltas: 100% (1445/1445), done.
Checking connectivity... done.
Note: checking out '55d61fa8aa702f59229e6cff85793c22e580eaf5'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

$ egrep '^' /home/akavel/gopath/src/CENSORED/_vendor/src/mod/cache/vcs/*/*
grep: /home/akavel/gopath/src/CENSORED/_vendor/src/mod/cache/vcs/45d78715e8642ccca2ff133acc565d0c7ab6d4825a063604cf2849f892b4c225/branches: Is a directory
/home/akavel/gopath/src/CENSORED/_vendor/src/mod/cache/vcs/45d78715e8642ccca2ff133acc565d0c7ab6d4825a063604cf2849f892b4c225/config:[core]
/home/akavel/gopath/src/CENSORED/_vendor/src/mod/cache/vcs/45d78715e8642ccca2ff133acc565d0c7ab6d4825a063604cf2849f892b4c225/config:	repositoryformatversion = 0
/home/akavel/gopath/src/CENSORED/_vendor/src/mod/cache/vcs/45d78715e8642ccca2ff133acc565d0c7ab6d4825a063604cf2849f892b4c225/config:	filemode = true
/home/akavel/gopath/src/CENSORED/_vendor/src/mod/cache/vcs/45d78715e8642ccca2ff133acc565d0c7ab6d4825a063604cf2849f892b4c225/config:	bare = true
/home/akavel/gopath/src/CENSORED/_vendor/src/mod/cache/vcs/45d78715e8642ccca2ff133acc565d0c7ab6d4825a063604cf2849f892b4c225/config:[remote "origin"]
/home/akavel/gopath/src/CENSORED/_vendor/src/mod/cache/vcs/45d78715e8642ccca2ff133acc565d0c7ab6d4825a063604cf2849f892b4c225/config:	url = https://gopkg.in/russross/blackfriday.v1
/home/akavel/gopath/src/CENSORED/_vendor/src/mod/cache/vcs/45d78715e8642ccca2ff133acc565d0c7ab6d4825a063604cf2849f892b4c225/config:	fetch = +refs/heads/*:refs/remotes/origin/*
/home/akavel/gopath/src/CENSORED/_vendor/src/mod/cache/vcs/45d78715e8642ccca2ff133acc565d0c7ab6d4825a063604cf2849f892b4c225/description:Unnamed repository; edit this file 'description' to name the repository.
/home/akavel/gopath/src/CENSORED/_vendor/src/mod/cache/vcs/45d78715e8642ccca2ff133acc565d0c7ab6d4825a063604cf2849f892b4c225/FETCH_HEAD:55d61fa8aa702f59229e6cff85793c22e580eaf5		tag 'v1.5.1' of https://gopkg.in/russross/blackfriday.v1
/home/akavel/gopath/src/CENSORED/_vendor/src/mod/cache/vcs/45d78715e8642ccca2ff133acc565d0c7ab6d4825a063604cf2849f892b4c225/HEAD:ref: refs/heads/master
grep: /home/akavel/gopath/src/CENSORED/_vendor/src/mod/cache/vcs/45d78715e8642ccca2ff133acc565d0c7ab6d4825a063604cf2849f892b4c225/hooks: Is a directory
grep: /home/akavel/gopath/src/CENSORED/_vendor/src/mod/cache/vcs/45d78715e8642ccca2ff133acc565d0c7ab6d4825a063604cf2849f892b4c225/info: Is a directory
grep: /home/akavel/gopath/src/CENSORED/_vendor/src/mod/cache/vcs/45d78715e8642ccca2ff133acc565d0c7ab6d4825a063604cf2849f892b4c225/objects: Is a directory
grep: /home/akavel/gopath/src/CENSORED/_vendor/src/mod/cache/vcs/45d78715e8642ccca2ff133acc565d0c7ab6d4825a063604cf2849f892b4c225/refs: Is a directory
/home/akavel/gopath/src/CENSORED/_vendor/src/mod/cache/vcs/45d78715e8642ccca2ff133acc565d0c7ab6d4825a063604cf2849f892b4c225/shallow:55d61fa8aa702f59229e6cff85793c22e580eaf5
$ ls ~/gopath/src/mod
ls: cannot access '/home/akavel/gopath/src/mod': No such file or directory
$ egrep -H '^' /home/akavel/gopath/src/CENSORED/_vendor/src/mod/cache/vcs/*/refs/tags/*
/home/akavel/gopath/src/CENSORED/_vendor/src/mod/cache/vcs/45d78715e8642ccca2ff133acc565d0c7ab6d4825a063604cf2849f892b4c225/refs/tags/v1.5.1:55d61fa8aa702f59229e6cff85793c22e580eaf5
$ git version
git version 2.7.4

What did you expect to see?

The go1.11beta2 run wiki.go -help command should have successfully downloaded gopkg.in/russross/blackfriday.v1, built wiki.go and run it. Similarly, the go1.11beta2 get should have downloaded & compiled successfully. In case of failure, the error message should be more informative, currently I have no idea what failed and what workarounds I could try. Especially given that regular git seems to have no trouble working.

Notably, this worked for me OK on a Windows machine at home.

What did you see instead?

See the errors in "What did you do?" above.

edit: added a command showing contents of files in $GOPATH/src/mod/...

edit 2: added git version

@akavel akavel changed the title modules: go1.11beta2 fails to download dependency although regular git succeeds modules: go1.11beta2 fails to "find" dependency although regular git succeeds Jul 24, 2018
@mvdan
Copy link
Member

mvdan commented Jul 24, 2018

Could be #26501, since you're on an older git version.

@akavel
Copy link
Contributor Author

akavel commented Jul 24, 2018

Seems to match:

$ git log --no-show-signature
fatal: unrecognized argument: --no-show-signature

Can be closed as a dupe then, I believe. Thanks!

@mvdan
Copy link
Member

mvdan commented Jul 24, 2018

Great. The fix for that bug should be merged soon, so you can always re-open this issue if it's still not fixed.

@mvdan mvdan closed this as completed Jul 24, 2018
@akavel
Copy link
Contributor Author

akavel commented Jul 24, 2018

I've just upgraded git to 2.18.0 via add-apt-repository ppa:git-core/ppa and it solved this for me, thanks! I don't run tip and not sure where the next beta will be released, so didn't want to wait.

@mvdan
Copy link
Member

mvdan commented Jul 24, 2018

That also works :) I believe a release candidate should be out soon, but I don't know when.

@golang golang locked and limited conversation to collaborators Jul 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants