You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using gopackagesdriver with gopls in VSCode for a Go project built with Bazel. Followed the rules_go Editor Setup for VSCode to get VSCode intellisense. It worked when I first set it up yesterday, however today it started failing.
It seems like gopackagesdriver is telling gopls to reference a nonexistent path. Checking the gopls (server) output shows messages like:
[Error - 9:12:06 PM] 2025/02/05 21:12:06 warning: diagnostics failed: stat /home/user/.cache/bazel/_bazel_user/b35369edf9c0f7898c0f9d8e0d24f857/execroot/_main/bazel-out/k8-fastbuild/bin/external/rules_go~/stdlib_/gocache/c6/c689520eead32197b36815d0861427bae887a9d3ff84e35d3e6528696e32b7f1-d: no such file or directory
view_id="1"
snapshot=1
directory=/home/user/repos/company
There's a bunch more of these errors, and they all complain about not finding this c689520eead32197b36815d0861427bae887a9d3ff84e35d3e6528696e32b7f1-d file. I see that everything up until gocache exists on my filesystem. It's just that the cache is empty:
user@dev-user0 ~/./b/_/b/e/_/b/k/b/e/r/stdlib_> pwd
/home/user/.cache/bazel/_bazel_user/b35369edf9c0f7898c0f9d8e0d24f857/execroot/_main/bazel-out/k8-fastbuild/bin/external/rules_go~/stdlib_
user@dev-user0 ~/./b/_/b/e/_/b/k/b/e/r/stdlib_> ls -lah gocache
total 8.0K
dr-xr-xr-x 2 user user 4.0K Feb 5 21:04 .
drwxr-xr-x 4 user user 4.0K Feb 5 21:04 ..
Full gopls server log (as pulled from the VSCode output tab): gopls-log.txt. I've run bazel clean --expunge and restarted the gopls language server to have a "clean" environment before producing this log.
With this no intellisense works in VSCode. All gopls functions error out.
Environment
rules_go version 0.51:
bazel_dep(name = "rules_go", version = "0.51.0", repo_name = "io_bazel_rules_go")
./tools/gopackagesdriver.sh (we import the rules_go repo as io_bazel_rules_go):
#!/usr/bin/env bash
exec bazel run -- @io_bazel_rules_go//go/tools/gopackagesdriver "${@}"
I'm using
gopackagesdriver
withgopls
in VSCode for a Go project built with Bazel. Followed therules_go
Editor Setup for VSCode to get VSCode intellisense. It worked when I first set it up yesterday, however today it started failing.It seems like
gopackagesdriver
is tellinggopls
to reference a nonexistent path. Checking thegopls (server)
output shows messages like:There's a bunch more of these errors, and they all complain about not finding this
c689520eead32197b36815d0861427bae887a9d3ff84e35d3e6528696e32b7f1-d
file. I see that everything up untilgocache
exists on my filesystem. It's just that the cache is empty:Full
gopls
server log (as pulled from the VSCode output tab): gopls-log.txt. I've runbazel clean --expunge
and restarted thegopls
language server to have a "clean" environment before producing this log.With this no intellisense works in VSCode. All
gopls
functions error out.Environment
rules_go
version 0.51:./tools/gopackagesdriver.sh
(we import therules_go
repo asio_bazel_rules_go
):.vscode/settings.json
:The text was updated successfully, but these errors were encountered: