docs: fix misleading debugger support section in README#1054
Open
ctcjab wants to merge 1 commit into
Open
Conversation
|
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.
Contributor
Author
|
The Buildkite failure is unrelated to this PR — all 183 tests passed, but the build failed because the macOS SDK download from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
The README's "Debugger Support" section shows a plain
py_binarywithdebugpyindepsandDEBUGPY_WAITinenv, implying this works out of the box. It doesn't —py_binary's Bash launcher has no debugpy integration, so the env var is set but nothing reads it. Users need thepy_debuggable_binarymacro fromexamples/debugger/which generates a wrapper entrypoint that actually starts the debugpy listener.This PR updates the README to:
debugpytodeps)examples/debugger/directory for the complete working setupContext
We hit this at CTC while setting up debugpy support in our monorepo. After following the README's instructions,
DEBUGPY_WAIT=1 bazelisk run //:appstarted the app without any debugger — the env var was silently ignored. We traced it to the launcher template (py_binary.tmpl.sh) which has noDEBUGPY_WAIThandling, and eventually found the working implementation inexamples/debugger/.We ended up porting the
py_debuggable_binarypattern into our build rules with one improvement: our version is runtime-gated — the debugpy listener only activates whenDEBUGPY_WAIT=1orDEBUGPY=1is set, making it safe to use on targets that are also deployed as OCI images (no open debug port in production). Happy to submit a follow-up PR to upstream this improvement, potentially as part of the ruleset itself rather than just an example, if there's interest.