Skip to content

Commit 4f164ee

Browse files
xangcastlectcjab
andauthored
docs: fix misleading debugger support section in README (#1132)
The README showed a plain py_binary with debugpy in deps and DEBUGPY_WAIT in env, implying this works out of the box. It doesn't — py_binary's launcher has no debugpy integration, so the env var is ignored. Users need the py_debuggable_binary macro from examples/debugger/ which generates a wrapper entrypoint that actually starts the debugpy listener. Update the README to clarify that a wrapper is required and point to the example for the full working setup. Close #1054 ### Changes are visible to end-users: no ### Test plan - Covered by existing test cases Co-authored-by: Joshua Bronson <joshua.bronson@chicagotrading.com>
1 parent cb89aa7 commit 4f164ee

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -368,16 +368,25 @@ the link target on a subset of binaries.
368368
369369
### Debugger Support (VSCode/PyCharm)
370370

371-
Attach debuggers using `debugpy`:
371+
Attach DAP-compatible debuggers (VSCode, PyCharm, Neovim, etc.) using
372+
[debugpy](https://github.com/microsoft/debugpy). This requires a wrapper
373+
entrypoint that starts a debugpy listener before running your application —
374+
simply adding `debugpy` to `deps` is not enough.
372375

373-
```starlark
374-
# In debug mode, wraps the binary with debugpy listener
375-
py_binary(
376-
name = "app_debug",
377-
srcs = ["main.py"],
378-
deps = ["//:lib", "@pypi//debugpy"],
379-
env = {"DEBUGPY_WAIT": "1"}, # Wait for IDE attachment
380-
)
376+
See the [complete debugger example](examples/debugger/) for a working
377+
setup, including a `py_debuggable_binary` macro that handles the wrapper
378+
generation automatically.
379+
380+
Quick overview:
381+
382+
```sh
383+
cd examples/debugger
384+
385+
# Start with debugpy listener, wait for IDE to attach:
386+
DEBUGPY_WAIT=1 bazel run //:app
387+
388+
# Release mode — no debugpy, runs directly:
389+
bazel run //:app --config=release
381390
```
382391

383392
VSCode `launch.json`:

0 commit comments

Comments
 (0)