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: support gopls for 1.12 (current - 4) #39146

Closed
bvwells opened this issue May 19, 2020 · 14 comments
Closed

x/tools/gopls: support gopls for 1.12 (current - 4) #39146

bvwells opened this issue May 19, 2020 · 14 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.
Milestone

Comments

@bvwells
Copy link

bvwells commented May 19, 2020

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

$ go version
go version go1.12.17 windows/amd64

Does this issue reproduce with the latest release?

No.

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

go env Output
$ go env

set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\bwells\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\bwells\go
set GOPROXY=
set GORACE=
set GOROOT=c:\go
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\bwells\AppData\Local\Temp\go-build198506238=/tmp/go-build -gno-record-gcc-switches

What did you do?

In VSCode I updated to the latest version of gopls.

What did you expect to see?

Expected to see gopls installed correctly.

What did you see instead?

gopls failed to install due to a dependency on a package which uses a newer go language feature (errors.As) than is available in the version of go I am using (go 1.12).

gopls:
Error: Command failed: C:\Go\bin\go.exe get -v golang.org/x/tools/gopls
Fetching https://golang.org/x/tools/gopls?go-get=1
Parsing meta tags from https://golang.org/x/tools/gopls?go-get=1 (status code 200)
get "golang.org/x/tools/gopls": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/gopls?go-get=1
get "golang.org/x/tools/gopls": verifying non-authoritative meta tag
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
golang.org/x/tools/internal/jsonrpc2
# golang.org/x/tools/internal/jsonrpc2
..\..\..\..\..\go\pkg\mod\golang.org\x\tools@v0.0.0-20200513154647-78b527d18275\internal\jsonrpc2\messages.go:168:5: undefined: errors.As
Fetching https://golang.org/x/tools/gopls?go-get=1
Parsing meta tags from https://golang.org/x/tools/gopls?go-get=1 (status code 200)
get "golang.org/x/tools/gopls": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/gopls?go-get=1
get "golang.org/x/tools/gopls": verifying non-authoritative meta tag
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
golang.org/x/tools/internal/jsonrpc2
# golang.org/x/tools/internal/jsonrpc2
..\..\..\..\..\go\pkg\mod\golang.org\x\tools@v0.0.0-20200513154647-78b527d18275\internal\jsonrpc2\messages.go:168:5: undefined: errors.As
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label May 19, 2020
@gopherbot
Copy link
Contributor

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.

@ALTree
Copy link
Member

ALTree commented May 19, 2020

From the Go release policy:

Each major Go release is supported until there are two newer major releases. For example, Go 1.5 was supported until the Go 1.7 release [...]

Since Go1.14 is out, Go1.12 is no longer a supported version; which means that gopls is allowed to break compatibility with it.

I suggest upgrading your Go version.

@stamblerre stamblerre changed the title gopls: Latest version of gopls not working with go 1.12 x/tools/gopls: does not support go <= 1.12 May 19, 2020
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label May 19, 2020
@gopherbot gopherbot added this to the Unreleased milestone May 19, 2020
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.5.0 May 19, 2020
@bvwells
Copy link
Author

bvwells commented May 19, 2020

The obvious solution is for me to upgrade to the latest version, but sadly I can't at the moment.

There is still a community on go 1.12 and it would be nice to know when this happened and what the best course of action would be other than upgrade to the latest go version.

Was advised by @heschik on slack to submit an issue.

@bvwells
Copy link
Author

bvwells commented May 19, 2020

Raised an issue on the vscode-go repo for them to at least update their documentation for what versions of go it supports.

@bvwells
Copy link
Author

bvwells commented May 19, 2020

Was already submitted here: golang/vscode-go#66

@stamblerre
Copy link
Contributor

I've vacillated on my stance about supporting older Go versions, but I am now thinking that we should. To do this correctly, we will need to develop a gopls-specific policy like https://golang.org/doc/devel/release.html#policy, and we will need to configure TryBots with older versions of Go to run on golang.org/x/tools. I filed #39159 to track this work, as this will be the first step.

@FiloSottile
Copy link
Contributor

There is still a community on go 1.12 and it would be nice to know when this happened and what the best course of action would be other than upgrade to the latest go version.

Could you elaborate on this? Widespread use of a release version out of security support is a security concern for the ecosystem and I'd like to understand if there's something we can do to avoid it.

@bvwells
Copy link
Author

bvwells commented May 24, 2020

Upgrade to go 1.13 has been a bit of a protracted affair for us partly due to the opt in nature of the google proxy for modules. We are getting to the end of this and hope to upgrade soon.

From what I can see there are still services out there which require running with older versions of go. An example of this is google appengine which only supports go 1.13 as beta functionality.

I suspect that a lot of this is more a packaging problem in that as tools such as gopls are not available as binaries so tools such as vscode-go pull gopls as source and build on the fly. Not sure on the best solution here.

@bvwells
Copy link
Author

bvwells commented May 25, 2020

Another thing I was thinking about it that it is not obvious that https://github.com/golang/tools follows the same release policy as https://github.com/golang/go. Perhaps this could be made more obvious by having it documented in https://github.com/golang/tools.

@hyangah
Copy link
Contributor

hyangah commented May 26, 2020

In an ideal world, it would be nice if everyone moves timely to the new thing. But in practice, we know some platform couldn't get rid of 1.9 until recently. Google's Appengine doc is still listing go1.12 https://cloud.google.com/appengine/docs/standard/go/runtime.

And, some users may want to test their software with different versions of Go to check regression or run comparison, and I believe that is a valid use case.

@stamblerre stamblerre changed the title x/tools/gopls: does not support go <= 1.12 x/tools/gopls: support gopls for 1.11 and 1.12 (current - 4) May 28, 2020
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/243578 mentions this issue: internal/lsp: support go1.12

gopherbot pushed a commit to golang/tools that referenced this issue Jul 20, 2020
We still don't have a good way to make sure that we don't break 1.12
support, but this is an easy enough fix to start with.

Updates golang/go#39146

Change-Id: I14fe997fa1f3d60320d77e664208e25d97ae6f4f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/243578
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
@stamblerre stamblerre changed the title x/tools/gopls: support gopls for 1.11 and 1.12 (current - 4) x/tools/gopls: support gopls for 1.12 (current - 4) Jul 21, 2020
@stamblerre
Copy link
Contributor

Since Go 1.15 will be coming soon, I think we should aim to only support 1.12-1.15 (~current - 4).
https://golang.org/cl/243578 added back support for 1.12, but we aren't likely to maintain it without testing.

I imagine that it will be a while before #39159 is resolved, but in the meantime, @findleyr has said that we can add support for testing different Go versions in our GCB CI system.

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/250941 mentions this issue: internal/lsp: fix builds and tests for go1.12+

gopherbot pushed a commit to golang/tools that referenced this issue Aug 27, 2020
Seems we've drifted a bit from go1.12 support, mostly due to error
wrapping.

Fix this, as well as some assorted other failures.

I haven't tested 1.12 interactively.

For golang/go#39146

Change-Id: Id347ead2a13e89b76d2ae0047750e6b6b49911eb
Reviewed-on: https://go-review.googlesource.com/c/tools/+/250941
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/253281 mentions this issue: gopls/doc: add information about supported Go versions

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.
Projects
None yet
Development

No branches or pull requests

7 participants