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: drop support for building at Go 1.12 #50827

Closed
5 tasks done
findleyr opened this issue Jan 26, 2022 · 8 comments
Closed
5 tasks done

x/tools/gopls: drop support for building at Go 1.12 #50827

findleyr opened this issue Jan 26, 2022 · 8 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

@findleyr
Copy link
Contributor

findleyr commented Jan 26, 2022

As discovered in CL 380555, some of our dependencies no longer support building with Go 1.12. This is to be expected -- 1.12 was a long time ago.

#50825 outlines a long-term plan to remove support for building gopls at legacy Go versions, but in the meantime we need to to mark gopls@v0.7.5 as the final release supporting being built by Go 1.12. Fortunately, this is consistent with our stated support for the four latest major Go versions.

Action items:

  • check with the VS Code team to see if there's anything we can do to help users avoid breakage when upgrading gopls from VS Code (CC @hyangah @suzmue)
  • document our new compatibility matrix.
  • update the v0.7.5 release notes
  • remove Kokoro 1.12 CI
  • upgrade our dependencies, thus breaking the 1.12 build
@findleyr findleyr added this to the gopls/v0.8.0 milestone Jan 26, 2022
@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 Jan 26, 2022
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/382075 mentions this issue: gopls: document that v0.7.5 is the final version to support Go 1.12

gopherbot pushed a commit to golang/tools that referenced this issue Jan 31, 2022
For golang/go#50827

Change-Id: Ib59aa4431dcc492db9436c19f43872781679f789
Reviewed-on: https://go-review.googlesource.com/c/tools/+/382075
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/380555 mentions this issue: gopls: update dependencies post-release

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Mar 8, 2022
Go version support

Support for Go 1.18

Version 0.8.0 of gopls supports features added to Go 1.18,
specifically:

    Support for multi-module workspaces using go.work files.
    Diagnostics for Fuzz tests.  Improved support for generics.

To use these features, gopls must be installed using Go 1.18. See
go.dev/dl for the latest status of Go 1.18 -- as of writing Go 1.18
is not yet released, but Go 1.18 RC1 may be used.

Dropped support for Go 1.12

Version 0.8.0 of gopls no longer supports building at Go 1.12. See
golang/go#50827 for more details.

New Features

go.work integration

Gopls now supports multi-module workspaces using go.work files. To
use this feature, create a go.work file that includes the modules
you want to work on, and then open your editor to the directory
containing go.work. For more information, see the go.work reference,
or the gopls documentation for multi-module workspaces.

Diagnostics for Fuzz tests

When writing Fuzz tests, gopls provides diagnostics for invalid
arguments to Fuzz.

Improved support for generics

Honor the language version configured in go.mod

gopls now provides diagnostics for language features based on the
go directive in the applicable go.mod file for a package.

For some errors related to incompatible language versions, gopls
offers a quick-fix to update the go.mod Go version. (note that if
the go.mod file is open, it may need to be saved in order for
language version changes to take effect)

gomodedit

Improved completion with type parameters

Gopls autocompletion is improved in several contexts when using
generic types.

genericvarcompl

New code action to add missing method stubs

Gopls now provides a code action to implement missing methods.

Improved performance and accuracy for workspace symbol requests

Workspace symbols uses a new fuzzy matcher that is up to 3x faster
than previous, and has improved ranking. See golang/go#50016 for
more details. Note that the first time workspace symbols are
requested, there may be a delay as the symbol cache is populated.

Improved gofumpt integration

Gopls now sets the language version and module path when invoking
gofumpt, allowing more accurate formatting based on context.
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/401155 mentions this issue: internal/jsonrpc2*: remove usage of golang.org/x/xerrors

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/401097 mentions this issue: gopls: remove usage of golang.org/x/xerrors

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/401154 mentions this issue: go/packages: remove usage of golang.org/x/xerrors

gopherbot pushed a commit to golang/tools that referenced this issue Apr 20, 2022
As of golang/go#50827, gopls no longer supports building at 1.12, and so
usage of golang.org/x/xerrors can be replaced with the native support for
error wrapping introduced in Go 1.13.

Remove this usage as a step toward eliminating the xerrors dependency
from x/tools.

For golang/go#52442

Change-Id: Ibf459cc72402a30a6c2735dc620f76ed8a5e2525
Reviewed-on: https://go-review.googlesource.com/c/tools/+/401097
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
gopherbot pushed a commit to golang/tools that referenced this issue Apr 20, 2022
As of golang/go#50827, gopls no longer needs to build at Go 1.12. I
believe this was the only reason to continue using xerrors in
go/packages.

Remove this usage as a step toward eliminating the xerrors dependency
from x/tools.

For golang/go#52442

Change-Id: I8f7396491be58606be6a648ebbf2180bdbc907b5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/401154
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
gopherbot pushed a commit to golang/tools that referenced this issue Apr 20, 2022
As of golang/go#50827, gopls no longer needs to build at Go 1.12. This
was the only reason to continue using xerrors in the jsonrpc2 libraries.

Remove this usage as a step toward eliminating the xerrors dependency
from x/tools.

For golang/go#52442

Change-Id: I1a0a1bbf57e6606c66b99b27439adf6f65c26a60
Reviewed-on: https://go-review.googlesource.com/c/tools/+/401155
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
@Davidrjx
Copy link

using golang v1.12.17 with gopls v0.7.5 not working, reporting

../../../../pkg/mod/golang.org/x/tools@v0.1.9-0.20220114220130-fd7798718afd/go/analysis/passes/buildtag/buildtag.go:13:2: package go/build/constraint is not in GOROOT (/usr/local/go1.12.17/go/src/go/build/constraint)
../../../../pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/decode_go116.go:6:2: package io/fs is not in GOROOT (/usr/local/go1.12.17/go/src/io/fs)

@findleyr
Copy link
Contributor Author

@Davidrjx did you use go get -u?

The following works for me, from a directory not containing a go.mod file:

GO111MODULE=on go1.12.17 get golang.org/x/tools/gopls@v0.7.5

But also: go 1.12 is many years old at this point, and has not been supported by the Go team for some time (the Go team currently supports only Go 1.18 and Go 1.19). Is there a reason you cannot use a supported version of Go?

@Davidrjx
Copy link

Davidrjx commented Feb 6, 2023

@Davidrjx did you use go get -u?

The following works for me, from a directory not containing a go.mod file:

GO111MODULE=on go1.12.17 get golang.org/x/tools/gopls@v0.7.5

But also: go 1.12 is many years old at this point, and has not been supported by the Go team for some time (the Go team currently supports only Go 1.18 and Go 1.19). Is there a reason you cannot use a supported version of Go?

i was building calico node v3.9.1 and project source contains a go.mod file

@golang golang locked and limited conversation to collaborators Feb 6, 2024
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

3 participants