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

x/tools/gopls: Cannot install 0.3.1 with go get #37140

Closed
paulbdavis opened this issue Feb 8, 2020 · 8 comments
Closed

x/tools/gopls: Cannot install 0.3.1 with go get #37140

paulbdavis opened this issue Feb 8, 2020 · 8 comments

Comments

@paulbdavis
Copy link

@paulbdavis paulbdavis commented Feb 8, 2020

What did you do?

go get -u golang.org/x/tools/gopls@gopls/v0.3.1

What did you expect to see?

Expected gopls to be installed at the newest tagged version

What did you see instead?

go get: golang.org/x/tools/gopls@v0.3.1 requires
        golang.org/x/tools@v0.0.0-20200204151227-34c67990bfe7: invalid version: unknown revision 34c67990bfe7

Seeing this is odd since that revision does seem to exist as the commit just before the tag

Cloning the repo and checking out the tag and building worked fine.

Build info

golang.org/x/tools/gopls v0.3.1
    golang.org/x/tools/gopls@(devel)
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/sergi/go-diff@v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
    golang.org/x/mod@v0.1.1-0.20191105210325-c90efee705ee h1:WG0RUwxtNT4qqaXX3DPA8zHFNm/D9xaBpxzHt1WcA/E=
    golang.org/x/sync@v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
    golang.org/x/tools@v0.0.0-20200204151227-34c67990bfe7 => ../
    golang.org/x/xerrors@v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
    honnef.co/go/tools@v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM=
    mvdan.cc/xurls/v2@v2.1.0 h1:KaMb5GLhlcSX+e+qhbRJODnUUBvlw01jt4yrjFIHAuA=

Go info

go version go1.13.7 linux/amd64

GO111MODULE="on"
GOARCH="amd64"
GOBIN="/home/paul/dev/go/bin"
GOCACHE="/home/paul/.cache/go-build"
GOENV="/home/paul/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY="bitbucket.org/getcoinshub/*"
GONOSUMDB="bitbucket.org/getcoinshub/*"
GOOS="linux"
GOPATH="/home/paul/dev/go"
GOPRIVATE="bitbucket.org/getcoinshub/*"
GOPROXY="direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/paul/dev/golang-tools/gopls/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-build329549544=/tmp/go-build -gno-record-gcc-switches"
@gopherbot gopherbot added this to the Unreleased milestone Feb 8, 2020
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Feb 8, 2020

Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here.

@heschik

This comment has been minimized.

Copy link
Contributor

@heschik heschik commented Feb 8, 2020

You're on Fedora, I presume, which disables proxy.golang.org by default, making the go command vulnerable to #34092. You can temporarily avoid the bug by setting GOPROXY=proxy.golang.org,direct, running with GOPATH=$(mktemp -d), or clearing your cache with go clean -modcache. The issue should be fixed in 1.14.

@dmitshur

This comment has been minimized.

Copy link
Member

@dmitshur dmitshur commented Feb 8, 2020

If your goal is to install gopls at the newest tagged version, then instead of:

go get -u golang.org/x/tools/gopls@gopls/v0.3.1

You should run:

go get golang.org/x/tools/gopls@v0.3.1

Notably, don't include the -u flag. You can also drop the "gopls/" prefix before the version (both work, but it's shorter not to include it).

See canonical gopls installation instructions here.

If you got the command you ran from some documentation, please let us know where it was so we can update it.

@paulbdavis

This comment has been minimized.

Copy link
Author

@paulbdavis paulbdavis commented Feb 9, 2020

@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Feb 10, 2020

I think the real issue here was the use of the -u flag, as @dmitshur said.
@paulbdavis: Does go get golang.org/x/tools/gopls@v0.3.1 work?

@paulbdavis

This comment has been minimized.

Copy link
Author

@paulbdavis paulbdavis commented Feb 10, 2020

@stamblerre I tried both and they both failed with the same error

@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Feb 10, 2020

Did any of @heschik's suggestions above resolve the issue (#37140 (comment))?

@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Feb 26, 2020

Closing this issue due to lack of activity. @paulbdavis: If you're still having this problem, please reopen.

@stamblerre stamblerre closed this Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.