-
-
Notifications
You must be signed in to change notification settings - Fork 42
[FR]: Attaching debuggers to py_binary is difficult #539
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
Comments
It's difficult to simultaneously support debuggers which want to supervise or control debuggee startup with the needs of configuring a hermetic Python interpreter. I suspect this will soon be broken in Probably the only way to harmonize the two would be to teach IDEA how to request Bazel build and run a configuration of a Python program which embeds the IDEA |
@zfy0701, in case you can take a similar approach with PyCharm, in https://youtu.be/GTsy7IfmywQ?si=2eVPMRPLPySsjoQA&t=286 @alexeagle shows how to get VSCode's Python debugger to work with a rules_py project essentially by bypassing Bazel and just using the rules_py-generated virtualenv directly, which is not difficult. You also may be interested in liking/subscribing to https://youtrack.jetbrains.com/issue/PY-63403/Support-debugpy which tracks adding support for debugpy to PyCharm. debugpy allows IDEs to set and hit breakpoints even for Python programs started via Bazel. I've tried it with VSCode and it works like a (wait for it) charm. |
@jab do you need this at work? We wish we could use a network-based debugger like in Java. We can just document how to do that. |
What happened?
when use default debugger for py_binary
the command generated is like:
notice the last parameter /../server/server is a shell instead of python file, the debugger will fail here:
switch back to official rules_python works
Version
Development (host) and target OS/architectures:
Output of
bazel --version
: 7.4.1Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file: MODULE.bazelLanguage(s) and/or frameworks involved: pyth
python plugin 1.0.0~ 1.3.2 behaviors similar
How to reproduce
Any other information?
No response
The text was updated successfully, but these errors were encountered: