-
Notifications
You must be signed in to change notification settings - Fork 541
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
Exec py_test targets in a way that would work with --run_under=lldb #2104
Comments
idea 1 - running the command
|
I hadn't but it looks like that doesn't work. AFAICT the script produced in this case ends up being the bash script you mentioned in 1, which also isn't a valid lldb target. I think for it to work it would have to be directly python3 being run, even if the first part of that run was setting things up and running something else. Like I wonder if instead of running the shebang script if we literally just ran that with the py3 executable it would work instead |
I guess you would have to change this line to somehow inject The annoying thing is that for the python interpreter to work, we need to run some shell or C program and then the debugger needs to be somehow passed as a parameter to |
maybe a cool way to make this work could be to use something like |
Does using |
I'm thinking maybe the label we set would just be a shell / py script that did an |
I don't believe it does. Some time ago I had attempted to do bazelbuild/bazel#16540 but never got a review. It would be awesome to empower rule authors to plumb |
🚀 feature request
Description
When you're debugging python targets that load python C extensions, it can be useful in general to run something like
lldb -- python3 -m pytest path/to/tests
. In bazel I would envision this asbazel test --run_under=lldb :tests
, but this doesn't work currently since py_test execs a script with a shebang. I think in theory if py_test ran the equivalent ofpython3 path/to/script
it could "just work" but I'm not sure.Describe alternatives you've considered
You can try to catch the process by launching the debugger elsewhere like
lldb --wait-for -n python3.11
, but this is a bit fragile since you could catch the wrong processThe text was updated successfully, but these errors were encountered: