Rewrite wiki regarding editor support for debugging
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 ?
+10 to doing this
-
Do people have working setups for debugging a Go program built with rules_go?
-
For VS Code in particular, are rules_go-specific enhancements in scope for https://github.com/bazel-contrib/vscode-bazel?
-
It seems that dlv works if a) The user builds the target binary (or test binary?) with
bazel build -c dbg //path/to/:my-binaryb) 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 ago_pathtarget and operates the IDE withinbazel-bin/path/to/go_path
Yeah. More instructions on using Delve could be found here https://github.com/bazelbuild/rules_go/issues/1708
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?
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.
It's good for Go too and debugging also works. CLion also got pretty good with Bazel.