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: gopls was broken with the latest tip version #62163

Closed
YoshikiShibata opened this issue Aug 20, 2023 · 6 comments
Closed

x/tools/gopls: gopls was broken with the latest tip version #62163

YoshikiShibata opened this issue Aug 20, 2023 · 6 comments
Labels
gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@YoshikiShibata
Copy link

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

$ go version
go version go1.21.0 darwin/arm64

Does this issue reproduce with the latest release?

go1.21.0 doesn't reproduce the problem, but the lastest tip version reproduces it

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

go env Output
$ go env
GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/yoshikishibata/Library/Caches/go-build'
GOENV='/Users/yoshikishibata/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/yoshikishibata/gocode/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/yoshikishibata/gocode'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/yoshikishibata/tools/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/yoshikishibata/tools/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.21.0'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/fs/3c1rlryd2v3_z5m04g3lnd580000gn/T/go-build2516750516=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOROOT/bin/go version: go version go1.21.0 darwin/arm64
GOROOT/bin/go tool compile -V: compile version go1.21.0
uname -v: Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:19 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T8103
ProductName:		macOS
ProductVersion:		13.4.1
ProductVersionExtra:	(c)
BuildVersion:		22F770820d
lldb --version: lldb-1403.0.17.67
Apple Swift version 5.8.1 (swiftlang-5.8.0.124.5 clang-1403.0.22.11.100)

What did you do?

When I recompiled the latest tip version from the source code with src/all.bash and rebuilt gopls with the tip version, vim-go doesn't work with the gopls (for example, :GoDef command)

What did you expect to see?

vim-go works with gopls

What did you see instead?

vim-go deosn't work with gopls.

Using git bisect command, I found that the following commit produces the problem.

% git bisect bad                            
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[5fa4aac0cec637fd9415fb260e3fbc2975377e00] go/types, types2: add Sizes computation to match gc behavior
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Aug 20, 2023
@YoshikiShibata YoshikiShibata changed the title gopls was broken with the latest tip version x/tools/gopls: gopls was broken with the latest tip version Aug 20, 2023
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Aug 20, 2023
@gopherbot gopherbot added this to the Unreleased milestone Aug 20, 2023
@dmitshur
Copy link
Contributor

Can you elaborate on what you mean by "vim-go deosn't work with gopls."? In what way does it not work? If there's an error printed, what is its text? Or is there no error, just no functionality?

CC @cuonglm, @findleyr.

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 20, 2023
@cuonglm
Copy link
Member

cuonglm commented Aug 20, 2023

Also, do you build gopls latest version or master?

@YoshikiShibata
Copy link
Author

I built it by go install command:

go install golang.org/x/tools/gopls@latest

@YoshikiShibata
Copy link
Author

YoshikiShibata commented Aug 20, 2023

with :GoDef , the following messages were shown, but didn't jump to the definition of a function.

vim-go: initializing gopls
vim-go: initialized gopls
vim-go: Finished loading packages.

@cuonglm
Copy link
Member

cuonglm commented Aug 20, 2023

I built it by go install command:


go install golang.org/x/tools/gopls@latest

Then you probably need to use gopls@master, to pull in the fix in gopls.

@YoshikiShibata
Copy link
Author

I rebuilt gopls from it source and the problem didn't appear. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants