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: detect unsupported build systems and improve error messages/performance #43937

Open
andybons opened this issue Jan 27, 2021 · 1 comment

Comments

@andybons
Copy link
Member

@andybons andybons commented Jan 27, 2021

I recently ran into issues caused by bazelbuild/rules_go#512, but the error message displayed by gopls seemed unrelated. Within my editor (VS Code) I just see Error loading workspace: go [-e -json -compiled=true -test=true -export=false -deps=false -- builtin <redacted>: exit status 2: warning: ignoring symlink ....

I spoke with @stamblerre to diagnose the issue and it came down to the fact that gopls doesn’t know about generated files due to the Bazel Go rules issue linked above. It’s even stated in the README:

gopls currently only supports the go command, so if you are using a different build system, gopls will not work well. Bazel support is currently blocked on bazelbuild/rules_go#512.

I was curious of whether it would be possible to detect a WORKSPACE file at the directory root and display a more helpful error or warning. One could even disable certain features or bail early from long-running commands that repeatedly fail.

ccing @jayconrod for any insight into detecting an unsupported build system like Bazel.

Thanks, all!

@gopherbot gopherbot added this to the Unreleased milestone Jan 27, 2021
@stamblerre stamblerre removed this from the Unreleased milestone Jan 27, 2021
@stamblerre stamblerre added this to the gopls/unplanned milestone Jan 27, 2021
@adam-azarchs
Copy link
Contributor

@adam-azarchs adam-azarchs commented Aug 12, 2021

Personally I work on a project that uses bazel as the primary build system, but gopls mostly works fine, so long as you drop in a go.mod to help it along. I say mostly because it starts traversing the bazel-* symlinks, which can be more than a slight problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants