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: feedback is extremely slow with large monorepo #44188

Open
csweichel opened this issue Feb 9, 2021 · 5 comments
Open

x/tools/gopls: feedback is extremely slow with large monorepo #44188

csweichel opened this issue Feb 9, 2021 · 5 comments

Comments

@csweichel
Copy link

@csweichel csweichel commented Feb 9, 2021

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

$ go version
go version go1.15 linux/amd64

Does this issue reproduce with the latest release?

Yes, it does

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/gitpod/.cache/go-build"
GOENV="/home/gitpod/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/workspace/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/workspace/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/gitpod/sdk/go1.15"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/gitpod/sdk/go1.15/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/tmp/a/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build199129901=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Opened https://github.com/gitpod-io/gitpod and tried to use gopls.
You can reproduce the exact same setup that I used by

  1. Enabling Feature Preview on https://gitpod.io/settings
  2. Opening https://gitpod.io/#github.com/gitpod-io/gitpod.
  3. Once loaded, update gopls go v0.6.5 using the IDE popup.
  4. Then try to edit/browse/interact with ws-manager/pkg/manager.go.

What did you expect to see?

I expected to get timely and swift feedback on my Go code.

What did you see instead?

The feedback (auto complete, error marker) is so slow that they're virtually unusable.
I reckon this might have to do with the multitude of workspace roots, large Go files and many modules.

Build info

golang.org/x/tools/gopls v0.6.5
    golang.org/x/tools/gopls@v0.6.5 h1:kLt9rD/dWtVdvc8LmdcxagDFih6zxYXREpKSYYZu5KE=
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/google/go-cmp@v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/mod@v0.4.0 h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8=
    golang.org/x/sync@v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=
    golang.org/x/sys@v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k=
    golang.org/x/tools@v0.1.1-0.20210201201750-4d4ee958a9b7 h1:/wdPW261t381NDQd8TBo63/FyvACfLICwtH8wMRoHJQ=
    golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
    honnef.co/go/tools@v0.0.1-2020.1.6 h1:W18jzjh8mfPez+AwGLxmOImucz/IFjpNlrKVnaj2YVc=
    mvdan.cc/gofumpt@v0.1.0 h1:hsVv+Y9UsZ/mFZTxJZuHVI6shSQCtzZ11h1JEFPAZLw=
    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=
@gopherbot gopherbot added this to the Unreleased milestone Feb 9, 2021
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Feb 9, 2021

Can you please share your gopls logs? Information on how to capture them can be found here.

It looks like this repository contains a large number of modules, and gopls requires special configuration to work with workspaces that contain multiple modules. Please take a look at https://github.com/golang/tools/blob/master/gopls/doc/workspace.md. You may be interested in trying the experimentalWorkspaceModule setting if you would prefer to avoid adding multiple workspace folders. Alternatively, if you are only working on one module, you can try opening it independently, for example, opening VS Code with just the ws-manager directory.

@csweichel
Copy link
Author

@csweichel csweichel commented Feb 10, 2021

Enabling the experimentalWorkspaceModule brought some improvement. Response feels a bit more timely. Clearly a step in the right direction, but not quite there yet.

experimentalWorkspaceModule did not improve things. Removing all other workspace roots though, did. If I remove all but one Go module as workspace folder, things become considerably quicker.

I've also attached the gopls logs below. They are from a session with experimentalWorkspaceModule: false, but with all Go modules set up as workspace root in VS Code/Gitpod.

gopls logs
[Info  - 6:42:56 AM] 2021/02/10 06:42:56 go env for /workspace/gitpod
(root /workspace/gitpod)
(go version go version go1.15 linux/amd64)
(valid build configuration = false)
(build flags: [])
GOINSECURE=
GOCACHE=/home/gitpod/.cache/go-build
GOFLAGS=
GOROOT=/home/gitpod/sdk/go1.15
GOMODCACHE=/workspace/go/pkg/mod
GOSUMDB=sum.golang.org
GOPRIVATE=
GOPROXY=https://proxy.golang.org,direct
GOMOD=
GONOPROXY=
GOPATH=/workspace/go
GO111MODULE=
GONOSUMDB=

[Info - 6:42:56 AM] 2021/02/10 06:42:56 go/packages.Load
snapshot=0
directory=/workspace/gitpod
query=[./ builtin]
packages=2

[Info - 6:42:56 AM] 2021/02/10 06:42:56 go/packages.Load
snapshot=0
directory=/workspace/gitpod
query=[./]
packages=1

[Info - 6:42:56 AM] 2021/02/10 06:42:56 go env for /workspace/gitpod/components/gitpod-protocol
(root /workspace/gitpod/components/gitpod-protocol/go)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GOFLAGS=
GONOPROXY=
GO111MODULE=
GONOSUMDB=
GOPRIVATE=
GOPROXY=https://proxy.golang.org,direct
GOSUMDB=sum.golang.org
GOMODCACHE=/workspace/go/pkg/mod
GOROOT=/home/gitpod/sdk/go1.15
GOCACHE=/home/gitpod/.cache/go-build
GOPATH=/workspace/go
GOINSECURE=
GOMOD=

[Info - 6:42:56 AM] 2021/02/10 06:42:56 go/packages.Load
snapshot=0
directory=/workspace/gitpod
query=[./]
packages=1

[Info - 6:42:56 AM] 2021/02/10 06:42:56 go/packages.Load
snapshot=0
directory=/workspace/gitpod
query=[./]
packages=1

[Info - 6:42:56 AM] 2021/02/10 06:42:56 go env for /workspace/gitpod/components/blobserve
(root /workspace/gitpod/components/blobserve)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GOINSECURE=
GONOSUMDB=
GOCACHE=/home/gitpod/.cache/go-build
GOMODCACHE=/workspace/go/pkg/mod
GOPRIVATE=
GOPROXY=https://proxy.golang.org,direct
GO111MODULE=
GOSUMDB=sum.golang.org
GOMOD=/workspace/gitpod/components/blobserve/go.mod
GONOPROXY=
GOFLAGS=
GOPATH=/workspace/go
GOROOT=/home/gitpod/sdk/go1.15

[Info - 6:42:56 AM] 2021/02/10 06:42:56 go env for /workspace/gitpod/components/common-go
(root /workspace/gitpod/components/common-go)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GOSUMDB=sum.golang.org
GOINSECURE=
GOPATH=/workspace/go
GOPROXY=https://proxy.golang.org,direct
GOMODCACHE=/workspace/go/pkg/mod
GONOPROXY=
GOMOD=/workspace/gitpod/components/common-go/go.mod
GOPRIVATE=
GO111MODULE=
GOCACHE=/home/gitpod/.cache/go-build
GOFLAGS=
GONOSUMDB=
GOROOT=/home/gitpod/sdk/go1.15

[Info - 6:42:57 AM] 2021/02/10 06:42:57 go/packages.Load
snapshot=0
directory=/workspace/gitpod/components/gitpod-protocol/go
query=[builtin github.com/gitpod-io/gitpod/gitpod-protocol/...]
packages=4

[Info - 6:42:57 AM] 2021/02/10 06:42:57 go env for /workspace/gitpod/components/content-service
(root /workspace/gitpod/components/content-service)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GOFLAGS=
GOINSECURE=
GOMODCACHE=/workspace/go/pkg/mod
GOPRIVATE=
GONOPROXY=
GOCACHE=/home/gitpod/.cache/go-build
GOPROXY=https://proxy.golang.org,direct
GOROOT=/home/gitpod/sdk/go1.15
GOSUMDB=sum.golang.org
GOMOD=/workspace/gitpod/components/content-service/go.mod
GONOSUMDB=
GOPATH=/workspace/go
GO111MODULE=

[Info - 6:42:57 AM] 2021/02/10 06:42:57 go env for /workspace/gitpod/components/docker-up
(root /workspace/gitpod/components/docker-up)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GONOPROXY=
GOPATH=/workspace/go
GOPROXY=https://proxy.golang.org,direct
GOINSECURE=
GOCACHE=/home/gitpod/.cache/go-build
GOMOD=/workspace/gitpod/components/docker-up/go.mod
GOMODCACHE=/workspace/go/pkg/mod
GONOSUMDB=
GOPRIVATE=
GOROOT=/home/gitpod/sdk/go1.15
GOFLAGS=
GO111MODULE=
GOSUMDB=sum.golang.org

[Info - 6:42:57 AM] 2021/02/10 06:42:57 go/packages.Load
snapshot=0
directory=/workspace/gitpod/components/blobserve
query=[builtin github.com/gitpod-io/gitpod/blobserve/...]
packages=6

[Info - 6:42:57 AM] 2021/02/10 06:42:57 go env for /workspace/gitpod/components/ee/cerc
(root /workspace/gitpod/components/ee/cerc)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GO111MODULE=
GOINSECURE=
GOMODCACHE=/workspace/go/pkg/mod
GOFLAGS=
GONOPROXY=
GOROOT=/home/gitpod/sdk/go1.15
GOPROXY=https://proxy.golang.org,direct
GOSUMDB=sum.golang.org
GOCACHE=/home/gitpod/.cache/go-build
GONOSUMDB=
GOPRIVATE=
GOPATH=/workspace/go
GOMOD=/workspace/gitpod/components/ee/cerc/go.mod

[Info - 6:42:57 AM] 2021/02/10 06:42:57 go/packages.Load
snapshot=0
directory=/workspace/gitpod/components/common-go
query=[builtin github.com/gitpod-io/gitpod/common-go/...]
packages=15

[Info - 6:42:58 AM] 2021/02/10 06:42:57 go env for /workspace/gitpod/components/ee/ws-scheduler
(root /workspace/gitpod/components/ee/ws-scheduler)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GOCACHE=/home/gitpod/.cache/go-build
GOFLAGS=
GOINSECURE=
GOMOD=/workspace/gitpod/components/ee/ws-scheduler/go.mod
GOROOT=/home/gitpod/sdk/go1.15
GOMODCACHE=/workspace/go/pkg/mod
GONOSUMDB=
GOPRIVATE=
GOPATH=/workspace/go
GOPROXY=https://proxy.golang.org,direct
GOSUMDB=sum.golang.org
GO111MODULE=
GONOPROXY=

[Info - 6:42:58 AM] 2021/02/10 06:42:58 go/packages.Load
snapshot=0
directory=/workspace/gitpod/components/docker-up
query=[builtin github.com/gitpod-io/gitpod/docker-up/...]
packages=4

[Info - 6:42:58 AM] 2021/02/10 06:42:58 go env for /workspace/gitpod/components/gitpod-cli
(root /workspace/gitpod/components/gitpod-cli)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GOMOD=/workspace/gitpod/components/gitpod-cli/go.mod
GONOPROXY=
GOROOT=/home/gitpod/sdk/go1.15
GOMODCACHE=/workspace/go/pkg/mod
GOPATH=/workspace/go
GOPRIVATE=
GOPROXY=https://proxy.golang.org,direct
GOINSECURE=
GOFLAGS=
GOSUMDB=sum.golang.org
GO111MODULE=
GOCACHE=/home/gitpod/.cache/go-build
GONOSUMDB=

[Info - 6:42:58 AM] 2021/02/10 06:42:58 go env for /workspace/gitpod/components/image-builder
(root /workspace/gitpod/components/image-builder)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GOPROXY=https://proxy.golang.org,direct
GO111MODULE=
GOCACHE=/home/gitpod/.cache/go-build
GOMODCACHE=/workspace/go/pkg/mod
GONOSUMDB=
GOPRIVATE=
GOMOD=/workspace/gitpod/components/image-builder/go.mod
GOFLAGS=
GONOPROXY=
GOROOT=/home/gitpod/sdk/go1.15
GOINSECURE=
GOPATH=/workspace/go
GOSUMDB=sum.golang.org

[Info - 6:42:58 AM] 2021/02/10 06:42:58 go env for /workspace/gitpod/components/licensor
(root /workspace/gitpod/components/licensor)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GOPRIVATE=
GONOPROXY=
GONOSUMDB=
GOPROXY=https://proxy.golang.org,direct
GOROOT=/home/gitpod/sdk/go1.15
GOCACHE=/home/gitpod/.cache/go-build
GOPATH=/workspace/go
GOFLAGS=
GOMOD=/workspace/gitpod/components/licensor/go.mod
GOINSECURE=
GOMODCACHE=/workspace/go/pkg/mod
GOSUMDB=sum.golang.org
GO111MODULE=

[Info - 6:42:58 AM] 2021/02/10 06:42:58 go/packages.Load
snapshot=0
directory=/workspace/gitpod/components/content-service
query=[builtin github.com/gitpod-io/gitpod/content-service/...]
packages=19

[Info - 6:42:58 AM] 2021/02/10 06:42:58 go/packages.Load
snapshot=0
directory=/workspace/gitpod/components/ee/cerc
query=[builtin github.com/gitpod-io/gitpod/cerc/...]
packages=5

[Info - 6:42:59 AM] 2021/02/10 06:42:59 go env for /workspace/gitpod/components/registry-facade
(root /workspace/gitpod/components/registry-facade)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GO111MODULE=
GOCACHE=/home/gitpod/.cache/go-build
GOSUMDB=sum.golang.org
GOINSECURE=
GOMOD=/workspace/gitpod/components/registry-facade/go.mod
GONOSUMDB=
GOPRIVATE=
GOPATH=/workspace/go
GOMODCACHE=/workspace/go/pkg/mod
GOPROXY=https://proxy.golang.org,direct
GOROOT=/home/gitpod/sdk/go1.15
GOFLAGS=
GONOPROXY=

[Info - 6:42:59 AM] 2021/02/10 06:42:59 go/packages.Load
snapshot=0
directory=/workspace/gitpod/components/gitpod-cli
query=[builtin github.com/gitpod-io/gitpod/gitpod-cli/...]
packages=7

[Info - 6:42:59 AM] 2021/02/10 06:42:59 go env for /workspace/gitpod/components/service-waiter
(root /workspace/gitpod/components/service-waiter)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GOINSECURE=
GOMOD=/workspace/gitpod/components/service-waiter/go.mod
GOMODCACHE=/workspace/go/pkg/mod
GONOPROXY=
GOROOT=/home/gitpod/sdk/go1.15
GO111MODULE=
GONOSUMDB=
GOPRIVATE=
GOSUMDB=sum.golang.org
GOCACHE=/home/gitpod/.cache/go-build
GOPATH=/workspace/go
GOPROXY=https://proxy.golang.org,direct
GOFLAGS=

[Info - 6:42:59 AM] 2021/02/10 06:42:59 go env for /workspace/gitpod/components/supervisor
(root /workspace/gitpod/components/supervisor)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GOPATH=/workspace/go
GOPROXY=https://proxy.golang.org,direct
GO111MODULE=
GOCACHE=/home/gitpod/.cache/go-build
GOMOD=/workspace/gitpod/components/supervisor/go.mod
GOMODCACHE=/workspace/go/pkg/mod
GONOPROXY=
GOROOT=/home/gitpod/sdk/go1.15
GOFLAGS=
GOINSECURE=
GONOSUMDB=
GOSUMDB=sum.golang.org
GOPRIVATE=

[Info - 6:42:59 AM] 2021/02/10 06:42:59 go/packages.Load
snapshot=0
directory=/workspace/gitpod/components/licensor
query=[builtin github.com/gitpod-io/gitpod/licensor/...]
packages=7

[Info - 6:43:00 AM] 2021/02/10 06:43:00 go env for /workspace/gitpod/components/workspacekit
(root /workspace/gitpod/components/workspacekit)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GOMODCACHE=/workspace/go/pkg/mod
GONOPROXY=
GOFLAGS=
GOMOD=/workspace/gitpod/components/workspacekit/go.mod
GONOSUMDB=
GOPROXY=https://proxy.golang.org,direct
GO111MODULE=
GOCACHE=/home/gitpod/.cache/go-build
GOPRIVATE=
GOINSECURE=
GOPATH=/workspace/go
GOROOT=/home/gitpod/sdk/go1.15
GOSUMDB=sum.golang.org

[Info - 6:43:00 AM] 2021/02/10 06:43:00 go env for /workspace/gitpod/components/ws-daemon
(root /workspace/gitpod/components/ws-daemon)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GONOPROXY=
GOPATH=/workspace/go
GOFLAGS=
GOINSECURE=
GOMODCACHE=/workspace/go/pkg/mod
GOROOT=/home/gitpod/sdk/go1.15
GO111MODULE=
GOSUMDB=sum.golang.org
GOCACHE=/home/gitpod/.cache/go-build
GOMOD=/workspace/gitpod/components/ws-daemon/go.mod
GONOSUMDB=
GOPRIVATE=
GOPROXY=https://proxy.golang.org,direct

[Info - 6:43:00 AM] 2021/02/10 06:43:00 go/packages.Load
snapshot=0
directory=/workspace/gitpod/components/service-waiter
query=[builtin github.com/gitpod-io/gitpod/service-waiter/...]
packages=3

[Info - 6:43:00 AM] 2021/02/10 06:43:00 go/packages.Load
snapshot=0
directory=/workspace/gitpod/components/ee/ws-scheduler
query=[builtin github.com/gitpod-io/gitpod/ws-scheduler/...]
packages=11

[Info - 6:43:00 AM] 2021/02/10 06:43:00 go/packages.Load
snapshot=0
directory=/workspace/gitpod/components/registry-facade
query=[builtin github.com/gitpod-io/gitpod/registry-facade/...]
packages=12

[Info - 6:43:00 AM] 2021/02/10 06:43:00 go/packages.Load
snapshot=0
directory=/workspace/gitpod/components/image-builder
query=[builtin github.com/gitpod-io/gitpod/image-builder/...]
packages=9

[Info - 6:43:00 AM] 2021/02/10 06:43:00 go env for /workspace/gitpod/components/ws-manager
(root /workspace/gitpod/components/ws-manager)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GONOPROXY=
GONOSUMDB=
GOROOT=/home/gitpod/sdk/go1.15
GOSUMDB=sum.golang.org
GOMODCACHE=/workspace/go/pkg/mod
GOFLAGS=
GOPRIVATE=
GOCACHE=/home/gitpod/.cache/go-build
GOINSECURE=
GOMOD=/workspace/gitpod/components/ws-manager/go.mod
GOPATH=/workspace/go
GO111MODULE=
GOPROXY=https://proxy.golang.org,direct

[Info - 6:43:01 AM] 2021/02/10 06:43:01 go env for /workspace/gitpod/components/ws-proxy
(root /workspace/gitpod/components/ws-proxy)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GOROOT=/home/gitpod/sdk/go1.15
GO111MODULE=
GOMOD=/workspace/gitpod/components/ws-proxy/go.mod
GOMODCACHE=/workspace/go/pkg/mod
GONOPROXY=
GOINSECURE=
GOPATH=/workspace/go
GOSUMDB=sum.golang.org
GONOSUMDB=
GOPRIVATE=
GOCACHE=/home/gitpod/.cache/go-build
GOFLAGS=
GOPROXY=https://proxy.golang.org,direct

[Info - 6:43:01 AM] 2021/02/10 06:43:01 go env for /workspace/gitpod/install/installer
(root /workspace/gitpod/install/installer)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GOSUMDB=sum.golang.org
GOMOD=/workspace/gitpod/install/installer/go.mod
GONOSUMDB=
GOPATH=/workspace/go
GOMODCACHE=/workspace/go/pkg/mod
GONOPROXY=
GOPRIVATE=
GOROOT=/home/gitpod/sdk/go1.15
GOFLAGS=
GOINSECURE=
GOPROXY=https://proxy.golang.org,direct
GO111MODULE=
GOCACHE=/home/gitpod/.cache/go-build

[Info - 6:43:01 AM] 2021/02/10 06:43:01 go/packages.Load
snapshot=0
directory=/workspace/gitpod/components/workspacekit
query=[builtin github.com/gitpod-io/gitpod/workspacekit/...]
packages=5

[Info - 6:43:01 AM] 2021/02/10 06:43:01 go env for /workspace/gitpod/test
(root /workspace/gitpod/test)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GO111MODULE=
GOFLAGS=
GOMOD=/workspace/gitpod/test/go.mod
GONOPROXY=
GONOSUMDB=
GOSUMDB=sum.golang.org
GOCACHE=/home/gitpod/.cache/go-build
GOMODCACHE=/workspace/go/pkg/mod
GOPATH=/workspace/go
GOROOT=/home/gitpod/sdk/go1.15
GOPROXY=https://proxy.golang.org,direct
GOINSECURE=
GOPRIVATE=

[Info - 6:43:01 AM] 2021/02/10 06:43:01 go env for /workspace/gitpod/dev/blowtorch
(root /workspace/gitpod/dev/blowtorch)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GOMODCACHE=/workspace/go/pkg/mod
GOCACHE=/home/gitpod/.cache/go-build
GOMOD=/workspace/gitpod/dev/blowtorch/go.mod
GONOPROXY=
GOPRIVATE=
GOFLAGS=
GO111MODULE=
GOINSECURE=
GONOSUMDB=
GOROOT=/home/gitpod/sdk/go1.15
GOSUMDB=sum.golang.org
GOPATH=/workspace/go
GOPROXY=https://proxy.golang.org,direct

[Info - 6:43:02 AM] 2021/02/10 06:43:02 go/packages.Load
snapshot=0
directory=/workspace/gitpod/components/supervisor
query=[builtin github.com/gitpod-io/gitpod/supervisor/...]
packages=16

[Info - 6:43:02 AM] 2021/02/10 06:43:02 go env for /workspace/gitpod/dev/gpctl
(root /workspace/gitpod/dev/gpctl)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GO111MODULE=
GOINSECURE=
GOPROXY=https://proxy.golang.org,direct
GOMODCACHE=/workspace/go/pkg/mod
GOPATH=/workspace/go
GOMOD=/workspace/gitpod/dev/gpctl/go.mod
GONOSUMDB=
GOROOT=/home/gitpod/sdk/go1.15
GOSUMDB=sum.golang.org
GOCACHE=/home/gitpod/.cache/go-build
GOFLAGS=
GONOPROXY=
GOPRIVATE=

[Info - 6:43:02 AM] 2021/02/10 06:43:02 go env for /workspace/gitpod/dev/loadgen
(root /workspace/gitpod/dev/loadgen)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GOMODCACHE=/workspace/go/pkg/mod
GOPROXY=https://proxy.golang.org,direct
GOROOT=/home/gitpod/sdk/go1.15
GOMOD=/workspace/gitpod/dev/loadgen/go.mod
GONOSUMDB=
GOPATH=/workspace/go
GOCACHE=/home/gitpod/.cache/go-build
GOINSECURE=
GOSUMDB=sum.golang.org
GO111MODULE=
GONOPROXY=
GOPRIVATE=
GOFLAGS=

[Info - 6:43:02 AM] 2021/02/10 06:43:02 go/packages.Load
snapshot=0
directory=/workspace/gitpod/install/installer
query=[builtin github.com/gitpod-io/installer/...]
packages=8

[Info - 6:43:02 AM] 2021/02/10 06:43:02 go env for /workspace/gitpod/dev/poolkeeper
(root /workspace/gitpod/dev/poolkeeper)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GOMODCACHE=/workspace/go/pkg/mod
GOSUMDB=sum.golang.org
GOMOD=/workspace/gitpod/dev/poolkeeper/go.mod
GONOSUMDB=
GOPRIVATE=
GOPROXY=https://proxy.golang.org,direct
GOROOT=/home/gitpod/sdk/go1.15
GO111MODULE=
GOCACHE=/home/gitpod/.cache/go-build
GOINSECURE=
GOPATH=/workspace/go
GOFLAGS=
GONOPROXY=

[Info - 6:43:02 AM] 2021/02/10 06:43:02 go/packages.Load
snapshot=0
directory=/workspace/gitpod/components/ws-proxy
query=[builtin github.com/gitpod-io/gitpod/ws-proxy/...]
packages=6

[Info - 6:43:03 AM] 2021/02/10 06:43:03 go env for /workspace/gitpod/dev/sweeper
(root /workspace/gitpod/dev/sweeper)
(go version go version go1.15 linux/amd64)
(valid build configuration = true)
(build flags: [])
GOSUMDB=sum.golang.org
GOPATH=/workspace/go
GO111MODULE=
GOINSECURE=
GOMOD=/workspace/gitpod/dev/sweeper/go.mod
GONOPROXY=
GONOSUMDB=
GOPRIVATE=
GOCACHE=/home/gitpod/.cache/go-build
GOFLAGS=
GOPROXY=https://proxy.golang.org,direct
GOROOT=/home/gitpod/sdk/go1.15
GOMODCACHE=/workspace/go/pkg/mod

[Info - 6:43:03 AM] 2021/02/10 06:43:03 go/packages.Load
snapshot=0
directory=/workspace/gitpod/components/ws-manager
query=[builtin github.com/gitpod-io/gitpod/ws-manager/...]
packages=16

[Info - 6:43:03 AM] 2021/02/10 06:43:03 go/packages.Load
snapshot=0
directory=/workspace/gitpod/dev/blowtorch
query=[builtin github.com/gitpod-io/gitpod/blowtorch/...]
packages=4

[Info - 6:43:04 AM] 2021/02/10 06:43:04 go/packages.Load
snapshot=0
directory=/workspace/gitpod/dev/loadgen
query=[builtin github.com/gitpod-io/gitpod/loadgen/...]
packages=5

[Info - 6:43:04 AM] 2021/02/10 06:43:04 go/packages.Load
snapshot=0
directory=/workspace/gitpod/dev/sweeper
query=[builtin github.com/gitpod-io/gitpod/sweeper/...]
packages=2

[Info - 6:43:04 AM] 2021/02/10 06:43:04 go/packages.Load
snapshot=0
directory=/workspace/gitpod/test
query=[builtin github.com/gitpod-io/gitpod/test/...]
packages=15

[Info - 6:43:04 AM] 2021/02/10 06:43:04 go/packages.Load
snapshot=0
directory=/workspace/gitpod/dev/gpctl
query=[builtin github.com/gitpod-io/gitpod/gpctl/...]
packages=5

[Info - 6:43:04 AM] 2021/02/10 06:43:04 go/packages.Load
snapshot=0
directory=/workspace/gitpod/dev/poolkeeper
query=[builtin github.com/gitpod-io/gitpod/poolkeeper/...]
packages=4

[Info - 6:43:13 AM] 2021/02/10 06:43:13 go/packages.Load
snapshot=1
directory=/workspace/gitpod/test
query=[builtin github.com/gitpod-io/gitpod/test/...]
packages=15

[Info - 6:43:14 AM] 2021/02/10 06:43:14 go/packages.Load
snapshot=2
directory=/workspace/gitpod/test
query=[builtin github.com/gitpod-io/gitpod/test/...]
packages=15

[Info - 6:43:15 AM] 2021/02/10 06:43:15 go/packages.Load
snapshot=0
directory=/workspace/gitpod/test
query=[file=/workspace/gitpod/components/ws-manager/pkg/manager/cache.go]
packages=1

[Info - 6:43:15 AM] 2021/02/10 06:43:15 go/packages.Load
snapshot=0
package="command-line-arguments"
files=[/workspace/gitpod/components/ws-manager/pkg/manager/cache.go]

[Info - 6:43:17 AM] 2021/02/10 06:43:17 go/packages.Load
snapshot=0
directory=/workspace/gitpod/dev/blowtorch
query=[file=/workspace/gitpod/components/ws-manager/pkg/manager/cache.go]
packages=1

[Info - 6:43:17 AM] 2021/02/10 06:43:17 go/packages.Load
snapshot=0
package="command-line-arguments"
files=[/workspace/gitpod/components/ws-manager/pkg/manager/cache.go]

[Error - 6:43:17 AM] 2021/02/10 06:43:17 command-line-arguments: no dep handle for github.com/gitpod-io/gitpod/common-go/kubernetes: no metadata for github.com/gitpod-io/gitpod/common-go/kubernetes
snapshot=0

[Error - 6:43:17 AM] 2021/02/10 06:43:17 command-line-arguments: no dep handle for golang.org/x/xerrors: no metadata for golang.org/x/xerrors
snapshot=0

[Error - 6:43:17 AM] 2021/02/10 06:43:17 k8s.io/apimachinery/pkg/util/cache: no dep handle for github.com/hashicorp/golang-lru: no metadata for github.com/hashicorp/golang-lru
snapshot=0

[Info - 6:43:18 AM] 2021/02/10 06:43:18 go/packages.Load
snapshot=0
directory=/workspace/gitpod/dev/gpctl
query=[file=/workspace/gitpod/components/ws-manager/pkg/manager/cache.go]
packages=1

[Info - 6:43:18 AM] 2021/02/10 06:43:18 go/packages.Load
snapshot=0
package="command-line-arguments"
files=[/workspace/gitpod/components/ws-manager/pkg/manager/cache.go]

[Info - 6:43:19 AM] 2021/02/10 06:43:19 go/packages.Load
snapshot=0
directory=/workspace/gitpod/dev/loadgen
query=[file=/workspace/gitpod/components/ws-manager/pkg/manager/cache.go]
packages=1

[Info - 6:43:19 AM] 2021/02/10 06:43:19 go/packages.Load
snapshot=0
package="command-line-arguments"
files=[/workspace/gitpod/components/ws-manager/pkg/manager/cache.go]

[Info - 6:43:20 AM] 2021/02/10 06:43:20 go/packages.Load
snapshot=0
directory=/workspace/gitpod/dev/poolkeeper
query=[file=/workspace/gitpod/components/ws-manager/pkg/manager/cache.go]
packages=1

[Info - 6:43:20 AM] 2021/02/10 06:43:20 go/packages.Load
snapshot=0
package="command-line-arguments"
files=[/workspace/gitpod/components/ws-manager/pkg/manager/cache.go]

[Info - 6:43:20 AM] 2021/02/10 06:43:20 go/packages.Load
snapshot=0
directory=/workspace/gitpod/dev/sweeper
query=[file=/workspace/gitpod/components/ws-manager/pkg/manager/cache.go]
packages=1

[Error - 6:43:20 AM] 2021/02/10 06:43:20 command-line-arguments: no dep handle for github.com/gitpod-io/gitpod/common-go/kubernetes: no metadata for github.com/gitpod-io/gitpod/common-go/kubernetes
snapshot=0

[Info - 6:43:20 AM] 2021/02/10 06:43:20 go/packages.Load
snapshot=0
package="command-line-arguments"
files=[/workspace/gitpod/components/ws-manager/pkg/manager/cache.go]

[Error - 6:43:20 AM] 2021/02/10 06:43:20 command-line-arguments: no dep handle for k8s.io/client-go/tools/cache: no metadata for k8s.io/client-go/tools/cache
snapshot=0

[Error - 6:43:20 AM] 2021/02/10 06:43:20 command-line-arguments: no dep handle for golang.org/x/xerrors: no metadata for golang.org/x/xerrors
snapshot=0

[Error - 6:43:20 AM] 2021/02/10 06:43:20 command-line-arguments: no dep handle for k8s.io/api/core/v1: no metadata for k8s.io/api/core/v1
snapshot=0

[Error - 6:43:20 AM] 2021/02/10 06:43:20 command-line-arguments: no dep handle for k8s.io/apimachinery/pkg/runtime: no metadata for k8s.io/apimachinery/pkg/runtime
snapshot=0

[Error - 6:43:20 AM] 2021/02/10 06:43:20 command-line-arguments: no dep handle for k8s.io/apimachinery/pkg/watch: no metadata for k8s.io/apimachinery/pkg/watch
snapshot=0

[Error - 6:43:20 AM] 2021/02/10 06:43:20 command-line-arguments: no dep handle for k8s.io/apimachinery/pkg/api/meta: no metadata for k8s.io/apimachinery/pkg/api/meta
snapshot=0

[Info - 6:43:44 AM] 2021/02/10 06:43:44 background imports cache refresh starting

[Info - 6:43:45 AM] 2021/02/10 06:43:45 background refresh finished after 539.005334ms

[Info - 6:44:16 AM] 2021/02/10 06:44:16 background imports cache refresh starting

[Info - 6:44:17 AM] 2021/02/10 06:44:17 background refresh finished after 327.197555ms

[Error - 6:44:20 AM] 2021/02/10 06:44:20 no signature help: cannot find an enclosing function
position={108 1}

[Error - 6:44:46 AM] 2021/02/10 06:44:46 no signature help: cannot find an enclosing function
position={107 89}

[Error - 6:44:49 AM] 2021/02/10 06:44:49 warning: diagnose package: analysis fillreturns for package github.com/gitpod-io/gitpod/ws-manager/pkg/manager panicked: unknown basic type
snapshot=57
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager"

[Info - 6:44:49 AM] 2021/02/10 06:44:49 analysis panicked: unknown basic type
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager"

[Info - 6:44:49 AM] 2021/02/10 06:44:49 analysis panicked: unknown basic type
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager [github.com/gitpod-io/gitpod/ws-manager/pkg/manager.test]"

[Error - 6:44:49 AM] 2021/02/10 06:44:49 warning: diagnose package: analysis fillreturns for package github.com/gitpod-io/gitpod/ws-manager/pkg/manager panicked: unknown basic type
snapshot=57
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager [github.com/gitpod-io/gitpod/ws-manager/pkg/manager.test]"

[Error - 6:44:49 AM] 2021/02/10 06:44:49 warning: diagnose package: analysis fillreturns for package github.com/gitpod-io/gitpod/ws-manager/pkg/manager panicked: unknown basic type
snapshot=58
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager [github.com/gitpod-io/gitpod/ws-manager/pkg/manager.test]"

[Error - 6:44:49 AM] 2021/02/10 06:44:49 warning: diagnose package: analysis fillreturns for package github.com/gitpod-io/gitpod/ws-manager/pkg/manager panicked: unknown basic type
snapshot=58
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager"

[Info - 6:44:50 AM] 2021/02/10 06:44:50 background imports cache refresh starting

[Error - 6:44:51 AM] 2021/02/10 06:44:51 warning: diagnose package: analysis fillreturns for package github.com/gitpod-io/gitpod/ws-manager/pkg/manager panicked: unknown basic type
snapshot=59
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager"

[Info - 6:44:51 AM] 2021/02/10 06:44:51 analysis panicked: unknown basic type
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager"

[Info - 6:44:51 AM] 2021/02/10 06:44:51 analysis panicked: unknown basic type
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager [github.com/gitpod-io/gitpod/ws-manager/pkg/manager.test]"

[Error - 6:44:51 AM] 2021/02/10 06:44:51 warning: diagnose package: analysis fillreturns for package github.com/gitpod-io/gitpod/ws-manager/pkg/manager panicked: unknown basic type
snapshot=59
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager [github.com/gitpod-io/gitpod/ws-manager/pkg/manager.test]"

[Info - 6:44:51 AM] 2021/02/10 06:44:51 background refresh finished after 308.20047ms

[Error - 6:44:51 AM] 2021/02/10 06:44:51 warning: diagnose package: analysis fillreturns for package github.com/gitpod-io/gitpod/ws-manager/pkg/manager panicked: unknown basic type
snapshot=60
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager [github.com/gitpod-io/gitpod/ws-manager/pkg/manager.test]"

[Info - 6:44:51 AM] 2021/02/10 06:44:51 analysis panicked: unknown basic type
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager [github.com/gitpod-io/gitpod/ws-manager/pkg/manager.test]"

[Info - 6:44:51 AM] 2021/02/10 06:44:51 analysis panicked: unknown basic type
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager"

[Error - 6:44:51 AM] 2021/02/10 06:44:51 warning: diagnose package: analysis fillreturns for package github.com/gitpod-io/gitpod/ws-manager/pkg/manager panicked: unknown basic type
snapshot=60
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager"

[Info - 6:44:52 AM] 2021/02/10 06:44:52 analysis panicked: unknown basic type
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager"

[Error - 6:44:52 AM] 2021/02/10 06:44:52 warning: diagnose package: analysis fillreturns for package github.com/gitpod-io/gitpod/ws-manager/pkg/manager panicked: unknown basic type
snapshot=61
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager"

[Info - 6:44:52 AM] 2021/02/10 06:44:52 analysis panicked: unknown basic type
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager [github.com/gitpod-io/gitpod/ws-manager/pkg/manager.test]"

[Error - 6:44:52 AM] 2021/02/10 06:44:52 warning: diagnose package: analysis fillreturns for package github.com/gitpod-io/gitpod/ws-manager/pkg/manager panicked: unknown basic type
snapshot=61
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager [github.com/gitpod-io/gitpod/ws-manager/pkg/manager.test]"

[Error - 6:45:03 AM] 2021/02/10 06:45:03 no signature help: cannot find an enclosing function
position={108 19}

[Error - 6:45:09 AM] Request textDocument/codeAction failed.
Message: context canceled
Code: 0
[Error - 6:45:10 AM] 2021/02/10 06:45:10 no signature help: cannot find an enclosing function
position={108 43}

[Error - 6:45:11 AM] 2021/02/10 06:45:11 no signature help: cannot find an enclosing function
position={109 1}

[Error - 6:45:12 AM] 2021/02/10 06:45:12 unable to compute error positions: invalid position for type error -: missing return
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager"

[Error - 6:45:12 AM] 2021/02/10 06:45:12 unable to compute error positions: invalid position for type error -: missing return
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager [github.com/gitpod-io/gitpod/ws-manager/pkg/manager.test]"

[Error - 6:45:13 AM] 2021/02/10 06:45:13 unable to compute error positions: invalid position for type error -: missing return
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager"

[Error - 6:45:13 AM] 2021/02/10 06:45:13 unable to compute error positions: invalid position for type error -: missing return
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager [github.com/gitpod-io/gitpod/ws-manager/pkg/manager.test]"

[Error - 6:45:16 AM] 2021/02/10 06:45:16 unable to compute error positions: invalid position for type error -: missing return
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager"

[Error - 6:45:16 AM] 2021/02/10 06:45:16 unable to compute error positions: invalid position for type error -: missing return
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager [github.com/gitpod-io/gitpod/ws-manager/pkg/manager.test]"

[Error - 6:45:17 AM] 2021/02/10 06:45:17 unable to compute error positions: invalid position for type error -: missing return
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager"

[Error - 6:45:17 AM] 2021/02/10 06:45:17 unable to compute error positions: invalid position for type error -: missing return
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager [github.com/gitpod-io/gitpod/ws-manager/pkg/manager.test]"

[Error - 6:45:17 AM] 2021/02/10 06:45:17 unable to compute error positions: invalid position for type error -: missing return
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager"

[Error - 6:45:17 AM] 2021/02/10 06:45:17 unable to compute error positions: invalid position for type error -: missing return
package="github.com/gitpod-io/gitpod/ws-manager/pkg/manager [github.com/gitpod-io/gitpod/ws-manager/pkg/manager.test]"

[Error - 6:45:34 AM] 2021/02/10 06:45:34 no signature help: cannot find an enclosing function
position={113 12}

[Info - 6:45:34 AM] 2021/02/10 06:45:34 background imports cache refresh starting

[Info - 6:45:34 AM] 2021/02/10 06:45:34 background refresh finished after 115.755765ms

[Error - 6:45:35 AM] 2021/02/10 06:45:35 no signature help: cannot find an enclosing function
position={113 16}

[Info - 6:46:04 AM] 2021/02/10 06:46:04 background imports cache refresh starting

[Info - 6:46:05 AM] 2021/02/10 06:46:05 background refresh finished after 95.224677ms

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Feb 10, 2021

experimentalWorkspaceModule did not improve things. Removing all other workspace roots though, did. If I remove all but one Go module as workspace folder, things become considerably quicker.

To confirm, when you set experimentalWorkspaceModule, did you remove the workspace roots? I should've confirmed, but you have to do that to set it up correctly, otherwise there will be no change. You will also need to reload the editor after configuring that setting.

Also, it looks like you're missing the "go.languageServerFlags": ["-rpc.trace"] setting needed for verbose logs, if you don't mind sharing logs with that set.

@csweichel
Copy link
Author

@csweichel csweichel commented Feb 10, 2021

To confirm, when you set experimentalWorkspaceModule, did you remove the workspace roots? I should've confirmed, but you have to do that to set it up correctly, otherwise there will be no change. You will also need to reload the editor after configuring that setting.

Good point. I have set things up that way now, made sure to reload the editor and for good measure restarted gopls (Go: Restart Language Server command). Configured like this gopls cannot resolve any module-imported package (i.e. fmt works, k8s.io/client-go/kubernetes does not). That which it can resolve, it will show swiftly though.

Also, it looks like you're missing the "go.languageServerFlags": ["-rpc.trace"] setting needed for verbose logs, if you don't mind sharing logs with that set.

Sorry, I missed that the firs way 'round. I've attached the gzipped gopls logs with rpc.trace enabled: gopls-2021-02-10.txt.gz

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Feb 12, 2021

A few things I noticed in the log you shared:

This error message in the /workspace/gitpod/components/ws-daemon module: err: exit status 1: stderr: go: updates to go.sum needed, disabled by -mod=readonly--I think you should see diagnostics and quick fixes suggested on /workspace/gitpod/components/ws-daemon/go.mod, and you may have to apply those fixes before working in that module.

This message may indicate that gopls doesn't think that the /workspace/gitpod/components/ws-manager/pkg/test/client.go file is in a module:

[Info  - 6:10:08 PM] 2021/02/10 18:10:08 go/packages.Load
	snapshot=0
	package="command-line-arguments"
	files=[/workspace/gitpod/components/ws-manager/pkg/test/client.go]

Does gopls work in that module if you open it up independently?

Good point. I have set things up that way now, made sure to reload the editor and for good measure restarted gopls (Go: Restart Language Server command). Configured like this gopls cannot resolve any module-imported package (i.e. fmt works, k8s.io/client-go/kubernetes does not). That which it can resolve, it will show swiftly though.

Do you mind sharing a log? I was actually able to use gopls with this repository with experimentalWorkspaceModule.

@stamblerre stamblerre added this to To Do in gopls: v1.0.0 Feb 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants