Expand description
2026-09-26: Subprocess runner, Python preflight and venv provisioning.
BFCL provisions its venv with these during load(); run is also used to
call other tools.
A load() error becomes the run’s failed setup frame, so the failures
of find_python, ensure_venv and pip_install name the missing piece
and a fix.
Owner: bench (provisioning). Invariants:
- A command that
runsees exit unsuccessfully is an error carrying at most the last 12 lines of its stderr.
Structs§
- Output
- 2026-09-26: Captured output of a command.
Functions§
- ensure_
venv - 2026-09-26: Create
venvwithpythonif its interpreter is not already there, and return the interpreter. - find_
python - 2026-09-26: Locate a Python at least
min_major.min_minor:python3, thenpython. - pip_
install - 2026-09-26:
pip install -r <requirements>with the venv’s interpreter. - run
- 2026-09-26: Run a command to completion with stdin closed, capturing both streams. A failure carries the tail of stderr, since a bare exit code is not actionable.
- venv_
python - 2026-09-26: The interpreter inside a venv, per platform layout.