harden pymol-open-source install check: import _cmd, not just launcher

Launcher existed while compiled ext was missing (partial compile ->
pure-python wheel installed from poisoned uv cache). Import pymol._cmd
at install time so a broken build dies in modbuild, not at runtime.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-03 09:37:05 +02:00
co-authored by Claude Fable 5
parent 41ec3b8894
commit 9767ebbb1d
+4
View File
@@ -44,4 +44,8 @@ pbuild::install() {
"$UV" pip install --python "$PREFIX/venv/bin/python" PyQt5 || \
std::die 42 "PyQt5 install failed"
[[ -x "$PREFIX/venv/bin/pymol" ]] || std::die 42 "pymol launcher missing from venv"
# launcher can exist while the compiled ext is missing (pure-python wheel from a
# poisoned uv cache); import _cmd directly so a broken build dies here, not at runtime
"$PREFIX/venv/bin/python" -c "import pymol._cmd" || \
std::die 42 "pymol._cmd import failed - ext .so missing; try 'uv cache clean pymol-open-source' and rebuild"
}