Commit 13764f73 by PLN (Algolia)

fix(doctor): it was asking the wrong interpreter, about the wrong binding

Two faults that hid each other, both found by reading the journal — which is
exactly the work this doctor exists to save.

It probed sys.executable. PLN's PATH starts with a pyenv shim, so the natural
`python3 tools/rig-doctor.py` answered for pyenv 3.11.10 — an interpreter no unit
ever uses; all five python units run /usr/bin/python3. That made the doctor wrong
in both directions at once: it called mido and PyQt5 MISSING while every unit
using them ran fine, and it still could not see the dep that was genuinely gone.
A check that cries wolf is a check nobody reads the day it is right. So it now
asks the interpreter the rig actually runs on.

And the dep it could not see: midiviz imports PySide6, and has since it was born
(30a704ec), but the table listed "perf-tray, midiviz GUIs" against PyQt5 alone.
So the doctor asked about a binding midiviz does not import, found it, and
reported green while midiviz crash-looped at RestartSec=5 on ModuleNotFoundError
for a whole session, PLN's lens simply absent. Two GUIs, two bindings, two rows.

Run the natural way it now says: CAN THIS BOX PLAY A SET? no — python: PySide6.
parent 5e030c78
......@@ -161,10 +161,24 @@ def path_state(p: Path) -> str:
return "unknown"
# The interpreter to ASK ABOUT — every python unit in the rig runs this one
# (`grep ExecStart ~/.config/systemd/user/*.service` → 5×/usr/bin/python3), so it
# is the only interpreter whose imports decide whether the rig runs.
#
# NOT sys.executable, which is what this used to probe. PLN's PATH starts with a
# pyenv shim, so the natural `python3 tools/rig-doctor.py` answered for pyenv
# 3.11.10 — an interpreter no unit ever uses. Measured 2026-09-06, that made the
# doctor wrong in BOTH directions at once: it reported mido and PyQt5 MISSING
# (both present for the rig, absent in pyenv) while every unit ran fine, and it
# still could not see the one dep that was genuinely gone. A check that cries
# wolf is a check nobody reads the day it is right.
RIG_PYTHON = "/usr/bin/python3" if Path("/usr/bin/python3").exists() else sys.executable
def import_ok(module: str) -> tuple[bool, str]:
"""Import in a SUBPROCESS — a missing/broken module must never kill the
doctor itself (this file imports nothing third-party at module scope)."""
rc, out, err = run_cmd([sys.executable, "-c", f"import {module}"], timeout=10)
rc, out, err = run_cmd([RIG_PYTHON, "-c", f"import {module}"], timeout=10)
return rc == 0, (err.strip().splitlines()[-1] if err.strip() else "")
......@@ -397,7 +411,16 @@ def check_python_modules() -> None:
"numpy": "audio-lens, gig-log analysis",
"scipy": "audio analysis",
"PIL": "midiviz, lcxl3-probe-display (pillow)",
"PyQt5": "perf-tray, midiviz GUIs",
"PyQt5": "perf-tray GUI",
# midiviz is PySide6, NOT PyQt5 — it has been since it was born
# (30a704e). This row said "perf-tray, midiviz GUIs" against PyQt5 alone,
# so the doctor asked about the binding midiviz does not import, found it,
# and reported green while midiviz crash-looped at RestartSec=5 on
# `ModuleNotFoundError: No module named 'PySide6'` — for a whole session,
# with PLN's lens simply absent and every check passing. Found 2026-09-06
# by reading the journal, which is precisely the work this doctor exists
# to save. Two GUIs, two bindings, two rows.
"PySide6": "midiviz GUI (the MIDI lens)",
}
for mod, why in mods.items():
ok, err = import_ok(mod)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment