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: init project cost long time when open the go project #62715

Closed
li1234yun opened this issue Sep 19, 2023 · 2 comments
Closed

x/tools/gopls: init project cost long time when open the go project #62715

li1234yun opened this issue Sep 19, 2023 · 2 comments
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@li1234yun
Copy link

gopls version

golang.org/x/tools/gopls v0.13.2
golang.org/x/tools/gopls@v0.13.2 h1:Pyvx6MKvatbX3zzZmdGiFRfQZl0ohPlt2sFxO/5j6Ro=

go env

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/xxx/.cache/go-build'
GOENV='/home/xxx/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/xxx/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/xxx/go'
GOPRIVATE=''
GOPROXY='https://goproxy.cn,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.0'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='0'
GOMOD='/home/xxx/git/work/xxx/go.mod'
GOWORK='/home/xxx/git/work/xxx/go.work'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1429554452=/tmp/go-build -gno-record-gcc-switches'

What did you do?

I just open my go project.

What did you expect to see?

Init project more quickly.

What did you see instead?

init project cost lots of time.

Editor and settings

Logs

[Info  - 9:14:37 AM] 2023/09/19 09:14:37 go info for /home/xxx/git/work/xxx
(go dir /home/xxx/git/work/xxx)
(go version go version go1.21.0 linux/amd64)
(valid build configuration = true)
(build flags: [])
(selected go env: [GO111MODULE=, GOCACHE=/home/xxx/.cache/go-build, GOFLAGS=, GOMODCACHE=/home/xxx/go/pkg/mod, GOPATH=/home/xxx/go, GOPRIVATE=xxx.xxx.xxx, GOROOT=/usr/local/go, GOWORK=/home/xxx/git/work/xxx/go.work])


[Info  - 9:14:38 AM] 2023/09/19 09:14:38 go/packages.Load #1
	snapshot=0
	directory=file:///home/xxx/git/work/xxx
	query=[/home/xxx/git/work/xxx/... /home/xxx/git/work/xxx/plat-share/... builtin]
	packages=42

[Info  - **9:14:38** AM] 2023/09/19 09:14:38 go/packages.Load #1: updating metadata for 744 packages

[Error - **9:15:11** AM] Request textDocument/codeAction failed.
  Message: context canceled
  Code: 0 

The gopls always cost >30s before the info and the error.

@li1234yun li1234yun added gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. labels Sep 19, 2023
@gopherbot gopherbot added this to the Unreleased milestone Sep 19, 2023
@findleyr
Copy link
Contributor

Hi, can you run gopls stats -anon from the workspace root and report the initial workspace load time (or share the full payload)?

@findleyr findleyr added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Sep 20, 2023
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@gopherbot gopherbot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 20, 2023
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. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants