|
@@ -40,6 +40,21 @@ REFERENCE_REGENERATION_REPLAY = "not_packaged_by_policy"
|
|
|
HARDWARE_VALIDATION = "not_run"
|
|
HARDWARE_VALIDATION = "not_run"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+def _safe_python() -> str:
|
|
|
|
|
+ """Avoid bare oss-cad libexec (needs ld-linux + libpython)."""
|
|
|
|
|
+ override = os.environ.get("PRODU2_VERIFY_PYTHON", "").strip()
|
|
|
|
|
+ if override:
|
|
|
|
|
+ return override
|
|
|
|
|
+ wrapper = Path("/data/prod2u/venvs/verify/bin/python")
|
|
|
|
|
+ exe = Path(sys.executable)
|
|
|
|
|
+ if "libexec" in exe.as_posix() and wrapper.is_file():
|
|
|
|
|
+ return str(wrapper)
|
|
|
|
|
+ if wrapper.is_file():
|
|
|
|
|
+ return str(wrapper)
|
|
|
|
|
+ return str(exe)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
class ReplayError(RuntimeError):
|
|
class ReplayError(RuntimeError):
|
|
|
"""Replay orchestration failure."""
|
|
"""Replay orchestration failure."""
|
|
|
|
|
|
|
@@ -105,7 +120,7 @@ def _run_unittest_modules(software_root: Path, modules: list[str]) -> dict[str,
|
|
|
)
|
|
)
|
|
|
continue
|
|
continue
|
|
|
completed = subprocess.run(
|
|
completed = subprocess.run(
|
|
|
- [sys.executable, "-B", "-m", "unittest", module, "-q"],
|
|
|
|
|
|
|
+ [_safe_python(), "-B", "-m", "unittest", module, "-q"],
|
|
|
cwd=str(software_root),
|
|
cwd=str(software_root),
|
|
|
env=env,
|
|
env=env,
|
|
|
stdout=subprocess.PIPE,
|
|
stdout=subprocess.PIPE,
|
|
@@ -198,7 +213,7 @@ def _board_detached_check(cpld_root: Path) -> dict[str, Any]:
|
|
|
|
|
|
|
|
completed = subprocess.run(
|
|
completed = subprocess.run(
|
|
|
[
|
|
[
|
|
|
- sys.executable,
|
|
|
|
|
|
|
+ _safe_python(),
|
|
|
"-B",
|
|
"-B",
|
|
|
str(validator),
|
|
str(validator),
|
|
|
"--generated",
|
|
"--generated",
|