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 · 13 comments
Closed

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

paulbdavis opened this issue Feb 8, 2020 · 13 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@paulbdavis
Copy link

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 gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Feb 8, 2020
@gopherbot
Copy link

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.

@heschi
Copy link
Contributor

heschi 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
Copy link
Contributor

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
Copy link
Author

paulbdavis commented Feb 9, 2020 via email

@stamblerre
Copy link
Contributor

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
Copy link
Author

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

@stamblerre
Copy link
Contributor

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

@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.4.0 Feb 13, 2020
@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Feb 13, 2020
@stamblerre
Copy link
Contributor

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

@paulbdavis
Copy link
Author

Sorry for the inactivity, got busy and my github notifications fell behind.

Anyway, I had this issue again trying to update to v0.3.3-pre1 and I resolved it by prefixing the command with GOPROXY= since I have it set to direct in my env since I work with a lot of private modules still using the .gitconfig hack (I know...)

I'm guessing since this is not the default behavior this issue is not worth actually reopening?

@dmitshur
Copy link
Contributor

dmitshur commented Mar 2, 2020

@paulbdavis It would be helpful if you’re able to share the exact command you ran, the exact output your got, and relevant parts of your .gitconfig file.

There may be a problem in the go command that needs to be fixed, but we can’t tell without more information.

I also think you should be able to use private modules without having to resort to hacks, so if that’s not the case, it’s worth opening a separate issue about that and explain why it’s needed. See the second paragraph of https://golang.org/doc/go1.14#introduction.

Thanks.

@heschi
Copy link
Contributor

heschi commented Mar 2, 2020

Sorry, I'm confused. To me this is very clearly a duplicate of #34092. Possibly that fix should be/have been backported to 1.13, but other than that, what is there still to diagnose here?

@dmitshur
Copy link
Contributor

dmitshur commented Mar 2, 2020

The latest message just said "had this issue again". If it is exactly the same issue as in the original report, then there's nothing new to diagnose, but I couldn't be sure because there wasn't enough information to confirm that.

@paulbdavis
Copy link
Author

@dmitshur The issue was essentially the same, just the specific psuedo versions were for whatever was in the go.mod at the time. I'll try to remember to get a full output tomorrow.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants