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: using git over ssh fails to load modules requirements #26894

Closed
myitcv opened this issue Aug 9, 2018 · 2 comments
Closed

cmd/go: using git over ssh fails to load modules requirements #26894

myitcv opened this issue Aug 9, 2018 · 2 comments

Comments

@myitcv
Copy link
Member

myitcv commented Aug 9, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version devel +f2131f6e0c Wed Aug 8 21:37:36 2018 +0000 linux/amd64

Does this issue reproduce with the latest release?

n/a: working with tip.

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/myitcv/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/tmp/tmp.RZ8OywaMcW"
GOPROXY=""
GORACE=""
GOROOT="/go"
GOTMPDIR=""
GOTOOLDIR="/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/tmp/tmp.Uj8YPmtD3X/hello/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-build157183933=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Also relevant:

$ git --version
git version 2.11.0

This is distilled from #26594 (comment). It requires a user with a Github registered ssh key.

Note: the following commands modify that user's global git config.

I reproduced the following using a custom version of the CircleCI build container image circleci/golang:1.10.

git config --global url.ssh://git@git.luolix.top.insteadof https://github.com
cd `mktemp -d`
export GOPATH=$(mktemp -d)
mkdir hello
cd hello
go mod init example.com/hello
cat <<EOD > main.go
package main

import _ "github.com/neelance/astrewrite"

func main() {}
EOD
go mod edit -require github.com/neelance/astrewrite@v0.0.0-20160511093645-99348263ae86
go list

What did you expect to see?

go: finding github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86
go: downloading github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86
example.com/hello

and zero exit code.

What did you see instead?

go: finding github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86
go: github.com/neelance/astrewrite@v0.0.0-20160511093645-99348263ae86: git fetch -f --depth=1 origin 99348263ae862cc230986ce88deaddbf7edcc034:refs/dummy in /tmp/tmp.a7pTq36Mi6/pkg/mod/cache/vcs/ce1091f713cdf402472d8855c76f8c5a63f1f08d8a979809ea8d50221cff5983: exit status 1
go: error loading module requirements

and exit code 1.

The reason behind this is explained in #26594 (comment).

Marking this as a release blocker, because CircleCI globally sets url.ssh://git@git.luolix.top.insteadof=https://github.com in its v2 containers, and git v2.11.0 is the default version in those containers. @rsc @bcmills - please do opine on whether you consider this a blocker.

This is not a problem with later git versions, although I'm unclear what the inflection point between bad/good is.

@myitcv myitcv added this to the Go1.11 milestone Aug 9, 2018
@bcmills
Copy link
Contributor

bcmills commented Aug 9, 2018

This is not a problem with later git versions, although I'm unclear what the inflection point between bad/good is.

That's #26746.

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/128904 mentions this issue: cmd/go: do not try to understand git fetch --depth=1 errors

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