Skip to main content

Iterate on one smoke test

Do not run make smoke while iterating on one test. The cp / pylon-launch -c 'import _<name>' / rm cycle is the standalone loop and takes seconds instead of minutes:

cp tests/blake3_smoke.py deps/cpython-3.14/Lib/_blake3_smoke.py
PYLON_CPYTHON_DIR=$PWD/deps/cpython-3.14 \
packaging/launcher-rs/target/release/pylon-launch \
plans/python-pylon-dynlink.json \
-c 'import _blake3_smoke'
rm deps/cpython-3.14/Lib/_blake3_smoke.py

Why this shape

  • pylon-launch needs a module import, not a script path (its stdin isn't wired to a filesystem-backed script). -c 'import _foo' works because CPython's stdlib import machinery looks in Lib/.
  • The staged filename must start with _ (or otherwise not collide with real stdlib names). By convention, prefix _smoke_ or use the pattern above.
  • PYLON_CPYTHON_DIR tells the launcher where the mounted Lib/ lives.
  • Always clean up. Leaving _blake3_smoke.py in Lib/ after a crash means the next make smoke will try to run it before staging its own copy.

The same trick is how scripts/run-smoke-tests.sh invokes every tests/*_smoke.py. Read it once; the shape will be permanently memorable.

Ad-hoc probe

If you don't want to add a real smoke, make probe FILE=<path> will stage, run, and tear down a single .py file for you:

make probe FILE=/tmp/scratch.py