startup: run the debugger with the repository Python #1528

Merged
lambirou merged 1 commit from upstream-pr/1535 into main 2026-11-24 15:07:05 +00:00
lambirou commented 2026-11-24 13:44:27 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-24T13:44:27Z.


Problem

tools/startup/run.ps1 starts debug_launch.py with python from PATH. The documented setup creates out/pe-env from requirements-dev.txt, but the launcher did not use it.

That matters for -HostCpu. debug_launch.py imports host_cpu.py, which needs iced-x86 when a short rewritten instruction has to move the following bytes. With a system Python that lacks the package, the first illegal instruction is logged as host-cpu no replacement ... No module named 'iced_x86', no rewrite happens, and the process stops on the second chance instead of continuing.

Change

run.ps1 now uses out/pe-env/Scripts/python.exe when that interpreter exists, and keeps python from PATH as the fallback. No other launcher behaviour changes.

docs/startup-runtime.md states the interpreter selection and why -HostCpu needs the venv.

Validation

  • 25 s startup run on Windows 11 26H2 build 26300, Radeon RX 9060 XT (driver 32.0.32029.2010), release build. The run ended by timeout after 25.03 s with host-cpu sites rewritten: clzero x5, monitorx x1, mwaitx x1; it no longer stopped on the illegal instruction.
  • python -B tests/docs_links_check.py: 16 Markdown files and 339 links checked, self-test passed.
  • git diff --check: clean.

The run needs local package files, so it is a manual check rather than a CTest case. Without out/pe-env, the fallback is the previous python from PATH.

Follow-up to #1274.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6583175260 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1535). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-24T13:44:27Z. --- ## Problem `tools/startup/run.ps1` starts `debug_launch.py` with `python` from `PATH`. The documented setup creates `out/pe-env` from `requirements-dev.txt`, but the launcher did not use it. That matters for `-HostCpu`. `debug_launch.py` imports `host_cpu.py`, which needs `iced-x86` when a short rewritten instruction has to move the following bytes. With a system Python that lacks the package, the first illegal instruction is logged as `host-cpu no replacement ... No module named 'iced_x86'`, no rewrite happens, and the process stops on the second chance instead of continuing. ## Change `run.ps1` now uses `out/pe-env/Scripts/python.exe` when that interpreter exists, and keeps `python` from `PATH` as the fallback. No other launcher behaviour changes. `docs/startup-runtime.md` states the interpreter selection and why `-HostCpu` needs the venv. ## Validation - 25 s startup run on Windows 11 26H2 build 26300, Radeon RX 9060 XT (driver `32.0.32029.2010`), release build. The run ended by timeout after 25.03 s with `host-cpu sites rewritten: clzero x5, monitorx x1, mwaitx x1`; it no longer stopped on the illegal instruction. - `python -B tests/docs_links_check.py`: 16 Markdown files and 339 links checked, self-test passed. - `git diff --check`: clean. The run needs local package files, so it is a manual check rather than a CTest case. Without `out/pe-env`, the fallback is the previous `python` from `PATH`. Follow-up to #1274.
upstream-sync closed this pull request 2026-11-24 16:03:02 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!1528
No description provided.