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: "unknown revision" error for valid pseudo-version of golang.org/x/tools #34092

Open
myitcv opened this issue Sep 4, 2019 · 4 comments

Comments

@myitcv
Copy link
Member

commented Sep 4, 2019

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, a4fdb3a8b281700221c3bd18a4e4ea48d2becf10 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

cc @bcmills @jayconrod

@bcmills bcmills added this to the Go1.14 milestone Sep 4, 2019

@hyangah

This comment has been minimized.

Copy link
Contributor

commented Sep 4, 2019

More interestingly, if try the last go get command again, it succeeds

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
go: finding golang.org/x/tools master
go: finding golang.org/x/tools/gopls master
go: downloading golang.org/x/tools v0.0.0-20190904213738-958971f5c2bf
go: downloading golang.org/x/tools/gopls v0.0.0-20190904213738-958971f5c2bf
go: extracting golang.org/x/tools/gopls v0.0.0-20190904213738-958971f5c2bf
go: extracting golang.org/x/tools v0.0.0-20190904213738-958971f5c2bf
go get: golang.org/x/tools/gopls@v0.0.0-20190904213738-958971f5c2bf requires
	golang.org/x/tools@v0.0.0-20190904201204-7dc6b39912d7: invalid version: unknown revision 7dc6b39912d7


GOPROXY=direct go get golang.org/x/tools/gopls@master
go: finding golang.org/x/tools master
go: finding golang.org/x/tools/gopls master
go: downloading golang.org/x/tools/gopls v0.1.4-0.20190904213738-958971f5c2bf
go: extracting golang.org/x/tools/gopls v0.1.4-0.20190904213738-958971f5c2bf
go: downloading golang.org/x/tools v0.0.0-20190904201204-7dc6b39912d7
go: extracting golang.org/x/tools v0.0.0-20190904201204-7dc6b39912d7
go: downloading golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7
go: downloading golang.org/x/sync v0.0.0-20190423024810-112230192c58
go: extracting golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7
go: extracting golang.org/x/sync v0.0.0-20190423024810-112230192c58
go: finding golang.org/x/tools v0.0.0-20190904201204-7dc6b39912d7
go: finding golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7
go: finding golang.org/x/sync v0.0.0-20190423024810-112230192c58
@bcmills

This comment has been minimized.

Copy link
Member

commented Sep 13, 2019

This no longer reproduces at head, presumably due to changes in the golang.org/x/tools repo.

At the time of writing, a4fdb3a8b281700221c3bd18a4e4ea48d2becf10 is the commit at master

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 a v0.0.0- prefix, even though that commit has the commit tagged gopls/v0.1.3 as an ancestor. A more appropriate pseudo-version (per #27171) would have been v0.1.4-0.20190904211325-a4fdb3a8b281. The fact that v0.0.0- was used instead suggests a connection to #34266.


~/src/golang.org/x/tools$ git merge-base --is-ancestor -- gopls/v0.1.3 a4fdb3a8b281700221c3bd18a4e4ea48d2becf10 && echo yes || echo no
yes

~/src/golang.org/x/tools$ git merge-base --is-ancestor -- gopls/v0.1.4 a4fdb3a8b281700221c3bd18a4e4ea48d2becf10 && echo yes || echo no
no
@myitcv

This comment has been minimized.

Copy link
Member Author

commented Sep 13, 2019

I think (for some reason I didn't record the commit) this happened again at 6bfd74cf029c99138aa1bb5b7e0d6b57c9d4eb49. I'll be sure to log any further occurrences here.

@bcmills bcmills changed the title 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 Sep 13, 2019

@bcmills

This comment has been minimized.

Copy link
Member

commented 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.

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