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.11 and 1.12 (current - 4) #39146

Open
bvwells opened this issue May 19, 2020 · 10 comments
Open

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

bvwells opened this issue May 19, 2020 · 10 comments
Labels
Milestone

Comments

@bvwells
Copy link

@bvwells 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 label May 19, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented May 19, 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.

@ALTree
Copy link
Member

@ALTree 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 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 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 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 bvwells commented May 19, 2020

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

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented May 20, 2020

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
Member

@FiloSottile FiloSottile commented May 22, 2020

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 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 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 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
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
6 participants
You can’t perform that action at this time.