rules_go icon indicating copy to clipboard operation
rules_go copied to clipboard

Rewrite wiki regarding editor support for debugging

Open sluongng opened this issue 4 years ago • 5 comments

In a conversation with my colleague, this link came up to be a bit misleading.

https://github.com/bazelbuild/rules_go/wiki/Editor-setup#debugging

The section is written to guide 'contributor' personas on how to debug the gopackagesdriver, not IDE integration for debugging Go code being built with rules_go.

Further more, we need/should a doc on guiding users on how to debug their code. Currently the link closest to 'Debugging' in https://github.com/bazelbuild/rules_go#overview section points to https://github.com/bazelbuild/rules_go/wiki/Editor-and-tool-integration which contain zero info about debugging.

Unfortunately, afaik, Github Wiki is not PR friendly. Thoughts on moving the docs from wiki to https://github.com/bazelbuild/rules_go/tree/master/docs ?

sluongng avatar Dec 10 '21 11:12 sluongng

+10 to doing this

  1. Do people have working setups for debugging a Go program built with rules_go?

  2. For VS Code in particular, are rules_go-specific enhancements in scope for https://github.com/bazel-contrib/vscode-bazel?

  3. It seems that dlv works if a) The user builds the target binary (or test binary?) with bazel build -c dbg //path/to/:my-binary b) The user configures substitutePath appropriae in the config for launching c) In the case of VS code, one creates a debug configuration JSON. d) As an alternative to the above steps, the user writes a go_path target and operates the IDE within bazel-bin/path/to/go_path

gonzojive avatar Oct 04 '24 01:10 gonzojive

Yeah. More instructions on using Delve could be found here https://github.com/bazelbuild/rules_go/issues/1708

sluongng avatar Oct 04 '24 09:10 sluongng

I've personally found that trying to use bazel with any IDE outside of Google has been a really not great experience. Am I holding it wrong?

aaomidi avatar Oct 04 '24 17:10 aaomidi

I've personally found that trying to use bazel with any IDE outside of Google has been a really not great experience. Am I holding it wrong?

The Bazel plugin for Intellij IDEA works quite well for Java/Kotlin projects. I recall it being strong for Go, too, though you need ultimate edition for that (or GoLand). VS Code support for bazel is more limited.

gonzojive avatar Oct 06 '24 15:10 gonzojive

It's good for Go too and debugging also works. CLion also got pretty good with Bazel.

fmeum avatar Oct 06 '24 16:10 fmeum