Skip to content

gopls installation works only with go 1.13+ #66

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

Closed
hyangah opened this issue May 17, 2020 · 10 comments
Closed

gopls installation works only with go 1.13+ #66

hyangah opened this issue May 17, 2020 · 10 comments
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.

Comments

@hyangah
Copy link
Contributor

hyangah commented May 17, 2020

Recent versions of gopls (v0.4.1+) depends on new APIs available only after go1.13+

../../../../pkg/mod/golang.org/x/[email protected]/internal/jsonrpc2/messages.go:168:5: undefined: errors.As

We have a couple of options to consider

  • suggest a compatible version of gopls for users with old versions of Go or
  • ask to use the latest version of Go to build the gopls or
  • ask to upgrade Go (this may not be desirable for users who need to use old versions, e.g. comparison, regression testing, etc)
  • download prebuilt language servers (properly signed and should be verifiable)

@stamblerre @ianthehat

@hyangah hyangah added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label May 17, 2020
@stamblerre
Copy link
Contributor

I like the idea of marking certain versions of gopls for different versions of Go. We should clearly document the x/tools policy of supporting the current and 1 previous version so there is less confusion, but I think overall I'd like to stick to that policy.

@hyangah
Copy link
Contributor Author

hyangah commented May 18, 2020

The current way of vscode Go extension building underlying tools from the latest versions of sources needs fixing. Now the main question is how and where we store and maintain the mapping.

Note: the version required to build a tool and the version the tool can analyze can be different. Often the latter is wider.

@stamblerre
Copy link
Contributor

Let's close this issue in favor of the upstream one: golang/go#39146. I'll mention your suggestions on #47, which is probably more relevant here.

@Davidrjx
Copy link

in my environment, Go1.13.14 still not work for gopls in VSCode latest.

@stamblerre
Copy link
Contributor

@Davidrjx: Can you please share the error message you see when you try to install gopls?

@Davidrjx
Copy link

@stamblerre also i have a try on local PC and Go, it is OK. But on Remote-WSL and Go with same version, failed to install gopls extension, report similar ERROR message "../golang.org/x/tools/internal/jsonrpc2...: undefined error.as".
refering some issues like golang/go#39146 and official doc, they say imcompatiable Go version. Afterwards, upgrade go1.12.* in WSL to 1.13.14, that still not work.

@stamblerre
Copy link
Contributor

We haven't yet released the version of gopls that has the fix for 1.12 compatibility, but that's coming soon (GO111MODULE=on go get golang.org/x/tools/[email protected] if you want to install it now). With 1.13 you should not see those errors, so make sure you are using the right version.

@Davidrjx
Copy link

Davidrjx commented Jul 30, 2020

@stamblerre Go v1.13.14 seems problematic too. when installing gopls inot WSL:Debian-Distribution in VSCode, output show error like

Tools environment: GOPATH=/home/{USERNAME}/go
Installing 1 tool at /home/{USERNAME}/go/bin in module mode.
  gopls

Installing golang.org/x/tools/gopls FAILED

1 tools failed to install.

gopls: failed to install [object Object]: Error: Command failed: /usr/local/go/bin/go get -v golang.org/x/tools/gopls
go: finding golang.org/x/tools latest
go: downloading golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7
go: extracting golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7
runtime
# runtime
/usr/local/go/src/runtime/stubs_x86.go:10:6: stackcheck redeclared in this block
	previous declaration at /usr/local/go/src/runtime/stubs_amd64x.go:10:6
/usr/local/go/src/runtime/unaligned1.go:11:6: readUnaligned32 redeclared in this block
	previous declaration at /usr/local/go/src/runtime/alg.go:321:40
/usr/local/go/src/runtime/unaligned1.go:15:6: readUnaligned64 redeclared in this block
	previous declaration at /usr/local/go/src/runtime/alg.go:329:40
 undefined

@Davidrjx
Copy link

furthermore,
Code Version:

1.47.3
91899dcef7b8110878ea59626991a18c8a6a1b3e
x64

Go extension Version:

v0.15.2

Remote - WSL Version:

v0.44.4

@Davidrjx
Copy link

Now, uninstalling Go v1.13.14, and install v1.13.12, gopls can be installed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

4 participants