Closed
Description
What version of Go are you using (go version
)?
$ go version go version devel +9da7abd2eb Tue Sep 3 18:35:32 2019 +0000 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go env GO111MODULE="on" GOARCH="amd64" GOBIN="" GOCACHE="/home/myitcv/.cache/go-build" GOENV="/home/myitcv/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/myitcv/gostuff" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/home/myitcv/gos" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/home/myitcv/gos/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/home/myitcv/gostuff/src/github.com/myitcv/govim/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-build658226068=/tmp/go-build -gno-record-gcc-switches"
What did you do?
export GOPATH=$(mktemp -d)
export PATH=$GOPATH/bin:$PATH
cd $(mktemp -d)
export GO111MODULE=on
GOPROXY=direct go get golang.org/x/tools/gopls@master
At the time of writing, a4fdb3a is the commit at master
What did you expect to see?
The command to succeed.
What did you see instead?
go: finding golang.org/x/tools master
go: finding golang.org/x/tools/gopls master
go: downloading golang.org/x/tools v0.0.0-20190904211325-a4fdb3a8b281
go: downloading golang.org/x/tools/gopls v0.0.0-20190904211325-a4fdb3a8b281
go: extracting golang.org/x/tools/gopls v0.0.0-20190904211325-a4fdb3a8b281
go: extracting golang.org/x/tools v0.0.0-20190904211325-a4fdb3a8b281
go get: golang.org/x/tools/gopls@v0.0.0-20190904211325-a4fdb3a8b281 requires
golang.org/x/tools@v0.0.0-20190904201204-7dc6b39912d7: invalid version: unknown revision 7dc6b39912d7
However golang.org/x/tools@v0.0.0-20190904201204-7dc6b39912d7
is indeed valid:
export GOPATH=$(mktemp -d)
cd $(mktemp -d)
go mod init mod
go get golang.org/x/tools@v0.0.0-20190904201204-7dc6b39912d7
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
hyangah commentedon Sep 4, 2019
More interestingly, if try the last
go get
command again, it succeedsbcmills commentedon Sep 13, 2019
This no longer reproduces at head, presumably due to changes in the
golang.org/x/tools
repo.There is an interesting fact about that commit: namely, that commit updated the dependency on
golang.org/x/tools
to the exact previous commit of the same repository. If that fact is relevant, it may be possible to construct a standalone repository that reproduces the error.It is also interesting to note that the pseudo-version in the output log for that commit of
golang.org/x/tools/gopls
uses av0.0.0-
prefix, even though that commit has the commit taggedgopls/v0.1.3
as an ancestor. A more appropriate pseudo-version (per #27171) would have beenv0.1.4-0.20190904211325-a4fdb3a8b281
. The fact thatv0.0.0-
was used instead suggests a connection to #34266.myitcv commentedon Sep 13, 2019
I think (for some reason I didn't record the commit) this happened again at 6bfd74c. I'll be sure to log any further occurrences here.
[-]cmd/go: unknown revision error for valid pseudo version via GOPROXY=direct get[/-][+]cmd/go: "unknown revision" error for valid pseudo-version of golang.org/x/tools[/+]bcmills commentedon Sep 13, 2019
Based on the investigation in #34266 (comment), I believe this may be a bug in the server backing
go.googlesource.com
.I will wait until that bug has been investigated before pursuing this further.
bcmills commentedon Sep 18, 2019
This appears to be a bug in some (all?) versions of the
git
command, triggered when a--unshallow
fetch also expands the set of references. We will need to work around it in thego
command, presumably by splitting the “unshallow the repo” and “fetch all refs and heads” steps into two separategit
invocations.bcmills commentedon Sep 24, 2019
The
go
command at head contains a workaround for the suspectedgit
bug. Please let us know if you see this again using a newer build of thego
tool.glnsagar commentedon Apr 27, 2020