bazel-contrib / bazel-contrib/rules_python

Exec py_test targets in a way that would work with --run_under=lldb

Offen
#2,104 7 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Starlark
Sterne
688
Forks
721
Ø Merge
15 Std. 7 Min.
Gemergte PRs (30 T.)
76

Beschreibung

# 🚀 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 as `bazel 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 of `python3 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 process

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start at the py_test execution path and trace how `bazel test --run_under=lldb :tests` invokes the generated test script. Compare the current shebang-based execution with the requested `python3 path/to/script` behavior, then verify that a Python C-extension test starts under LLDB while ordinary py_test execution remains unchanged.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
build-system, testing
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.