x64_recomp: find qemu through QEMU_AARCH64 or PATH, not a contributor's home folder #950

Merged
barkodr merged 1 commit from upstream-pr/950 into main 2026-11-30 08:13:23 +00:00
barkodr commented 2026-11-24 15:37:08 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by barkodr on 2026-11-24T15:37:08Z.


Claimed in the coordination issue as: claiming: tools/x64_recomp.py and tests/test_x64_recomp.py hard-code a contributor's /home/nolan/.nix-profile qemu path; use QEMU_AARCH64 or PATH only, and have the test reuse x64_recomp.QEMU_BIN. Tools only. AI-assisted.

What and why

The default qemu path in tools/x64_recomp.py and tests/test_x64_recomp.py was one contributor's /home/nolan/.nix-profile folder. The tool now uses QEMU_AARCH64, else qemu-system-aarch64 on PATH, and the test reuses x64_recomp.QEMU_BIN instead of its own copy of the lookup. docs/mobile.md now says where the exec tests look for qemu.

Tested

On macOS 26.6.2 with Python 3.12.16 and on Ubuntu 26.04 (WSL2) with Python 3.14.4, from the checkout root with python -I: tests/test_x64_recomp.py, tests/test_text_write_line_endings.py and tests/test_docs_python_deps.py pass on both. On macOS qemu is not installed, so 26 qemu tests skip (6 run). Not run against a real qemu. The lookup was checked by hand with a stand-in binary, outside the test file: QEMU_AARCH64 is used when set (also ahead of PATH), else the binary on PATH, else the bare name.

GPUs tested: none (no GPU code changed)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5475315555 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/950). Originally posted by [barkodr](https://github.com/barkodr) on 2026-11-24T15:37:08Z. --- Claimed in the coordination issue as: claiming: tools/x64_recomp.py and tests/test_x64_recomp.py hard-code a contributor's /home/nolan/.nix-profile qemu path; use QEMU_AARCH64 or PATH only, and have the test reuse x64_recomp.QEMU_BIN. Tools only. AI-assisted. ### What and why The default qemu path in `tools/x64_recomp.py` and `tests/test_x64_recomp.py` was one contributor's `/home/nolan/.nix-profile` folder. The tool now uses `QEMU_AARCH64`, else `qemu-system-aarch64` on `PATH`, and the test reuses `x64_recomp.QEMU_BIN` instead of its own copy of the lookup. `docs/mobile.md` now says where the exec tests look for qemu. ### Tested On macOS 26.6.2 with Python 3.12.16 and on Ubuntu 26.04 (WSL2) with Python 3.14.4, from the checkout root with `python -I`: `tests/test_x64_recomp.py`, `tests/test_text_write_line_endings.py` and `tests/test_docs_python_deps.py` pass on both. On macOS qemu is not installed, so 26 qemu tests skip (6 run). Not run against a real qemu. The lookup was checked by hand with a stand-in binary, outside the test file: `QEMU_AARCH64` is used when set (also ahead of `PATH`), else the binary on `PATH`, else the bare name. GPUs tested: none (no GPU code changed) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed.
tiguan26 commented 2026-11-25 03:56:53 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by tiguan26 on 2026-11-25T03:56:53Z.

Review: APPROVED


Approving. Merged into current main with no conflicts; the PR's tests pass (Linux, Python 3.13). QEMU_AARCH64 first, then shutil.which, then the bare name (which gives a clear "not found" error) replaces a contributor's home-folder path.

AI-assisted (Claude).

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6051645865 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/950#pullrequestreview-6051645865). Originally posted by [tiguan26](https://github.com/tiguan26) on 2026-11-25T03:56:53Z. **Review:** APPROVED --- Approving. Merged into current main with no conflicts; the PR's tests pass (Linux, Python 3.13). QEMU_AARCH64 first, then shutil.which, then the bare name (which gives a clear "not found" error) replaces a contributor's home-folder path. AI-assisted (Claude).
PierreEbele commented 2026-11-25 21:54:03 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T21:54:03Z.


Reviewed 16452e7: ran tests/test_x64_recomp.py and tests/test_docs_table_rows.py plus compileall on both main and the PR (32 tests OK, 26 exec tests skip, no qemu here), and a stub probe of the discovery logic: QEMU_AARCH64 and PATH binaries are found and executed, absent ones leave the bare name and the tests skip. Nice side effect worth stating in the PR body: the tool and its test now share one QEMU_BIN — on main the test could enable exec tests for a qemu the tool itself would resolve differently (the tool never looked at PATH). No findings.
AI-assisted review.

Recommendation: Merge

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7175683240 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/950#issuecomment-7175683240). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T21:54:03Z. --- Reviewed 16452e7: ran `tests/test_x64_recomp.py` and `tests/test_docs_table_rows.py` plus `compileall` on both main and the PR (32 tests OK, 26 exec tests skip, no qemu here), and a stub probe of the discovery logic: `QEMU_AARCH64` and PATH binaries are found and executed, absent ones leave the bare name and the tests skip. Nice side effect worth stating in the PR body: the tool and its test now share one `QEMU_BIN` — on main the test could enable exec tests for a qemu the tool itself would resolve differently (the tool never looked at PATH). No findings. AI-assisted review. **Recommendation:** Merge
kevincommits commented 2026-11-25 22:04:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kevincommits on 2026-11-25T22:04:29Z.


Independent run. Apple M5 Pro, macOS 27.2.1 (26B131), Python 3.14.2, QEMU 11.1.3 from Homebrew, so the 26 exec tests ran rather than skipped. I merged main at 6b843a4ad into the branch locally (1,001 commits behind, no conflicts).

  • QEMU on PATH, QEMU_AARCH64 unset: tests/test_x64_recomp.py 33/33, none skipped (the same as main).
  • QEMU not on PATH, QEMU_AARCH64 unset: OK with 26 skipped, so the skip is still clean.
  • QEMU not on PATH, QEMU_AARCH64 set to the binary: 33/33, none skipped.
  • tests/test_recomp_census.py: 11/11. Every standalone tests/test_*.py under python -I: 510 run, 506 pass; the 4 that fail are the same 4 that fail on plain main.

No behaviour change found on this machine in any of the three lookups, and the home-folder path is gone from both files. No game files used. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7175901897 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/950#issuecomment-7175901897). Originally posted by [kevincommits](https://github.com/kevincommits) on 2026-11-25T22:04:29Z. --- Independent run. Apple M5 Pro, macOS 27.2.1 (26B131), Python 3.14.2, QEMU 11.1.3 from Homebrew, so the 26 exec tests ran rather than skipped. I merged `main` at `6b843a4ad` into the branch locally (1,001 commits behind, no conflicts). - QEMU on `PATH`, `QEMU_AARCH64` unset: `tests/test_x64_recomp.py` 33/33, none skipped (the same as `main`). - QEMU not on `PATH`, `QEMU_AARCH64` unset: OK with 26 skipped, so the skip is still clean. - QEMU not on `PATH`, `QEMU_AARCH64` set to the binary: 33/33, none skipped. - `tests/test_recomp_census.py`: 11/11. Every standalone `tests/test_*.py` under `python -I`: 510 run, 506 pass; the 4 that fail are the same 4 that fail on plain `main`. No behaviour change found on this machine in any of the three lookups, and the home-folder path is gone from both files. No game files used. AI-assisted.
OreoFR commented 2026-11-28 21:45:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:45:26Z.


Verified by OreoFR

  • Base: main 3408969a7 + PR head 16452e785
  • Test: python -I tests/test_x64_recomp.py
  • Red on main: 45 OK (32 skipped)
  • Green with the PR: 45 OK (32 skipped)
  • Verdict: NO RED (no qemu-aarch64 on this machine)
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246249206 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/950#issuecomment-7246249206). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-28T21:45:26Z. --- **Verified by OreoFR** - Base: main `3408969a7` + PR head `16452e785` - Test: `python -I tests/test_x64_recomp.py` - Red on main: 45 OK (32 skipped) - Green with the PR: 45 OK (32 skipped) - Verdict: NO RED (no qemu-aarch64 on this machine) - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
zmasi commented 2026-11-29 01:25:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T01:25:45Z.


#950 | head 16452e785f (merged cleanly onto origin/main 5825b02ff8) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yes

Independent Verification (Windows 11)

  • Diff & safety audit: Inspected 100% of the diff across docs/mobile.md, tools/x64_recomp.py (QEMU_BIN = os.environ.get("QEMU_AARCH64") or shutil.which("qemu-system-aarch64") or "qemu-system-aarch64"), and tests/test_x64_recomp.py (HAS_QEMU = os.path.isfile(x.QEMU_BIN)). python -I scripts/check_no_game_data.py docs/mobile.md tools/x64_recomp.py tests/test_x64_recomp.py passed (rc=0).
  • Red -> Green on Windows 11:
    • Red (origin/main 5825b02ff8): With QEMU_AARCH64="" and a synthetic qemu-system-aarch64.exe placed in a temporary directory on Windows PATH, x64_recomp.QEMU_BIN evaluated to '' (os.path.isfile(x.QEMU_BIN) == False) instead of discovering the .exe on PATH (and when QEMU_AARCH64 was unset, x64_recomp.QEMU_BIN fell back to bare 'qemu-system-aarch64' rather than shutil.which(...)).
    • Green (#950 + origin/main):
      • With QEMU_AARCH64="" and qemu-system-aarch64.exe on Windows PATH, shutil.which("qemu-system-aarch64") resolved x64_recomp.QEMU_BIN to <tempdir>/qemu-system-aarch64.EXE (os.path.isfile(x.QEMU_BIN) == True).
      • python -I tests/test_x64_recomp.py -> 45 ran, OK (skipped=32) (0.001s; the 13 non-QEMU decoder/translator/kernel-image tests passed and the 32 QEMU execution tests skipped cleanly).
      • Doc verification suites: test_docs_table_rows.py (2/2), test_docs_repo_paths.py (5/5), test_docs_encoding.py (1/1), test_docs_env_vars.py (5/5) -> all OK.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248776014 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/950#issuecomment-7248776014). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-29T01:25:45Z. --- #950 | head 16452e785f52801fd5b17e5936c26f0eb2edad03 (merged cleanly onto origin/main 5825b02ff8) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yes ### Independent Verification (Windows 11) - **Diff & safety audit**: Inspected 100% of the diff across `docs/mobile.md`, `tools/x64_recomp.py` (`QEMU_BIN = os.environ.get("QEMU_AARCH64") or shutil.which("qemu-system-aarch64") or "qemu-system-aarch64"`), and `tests/test_x64_recomp.py` (`HAS_QEMU = os.path.isfile(x.QEMU_BIN)`). `python -I scripts/check_no_game_data.py docs/mobile.md tools/x64_recomp.py tests/test_x64_recomp.py` passed (`rc=0`). - **Red -> Green on Windows 11**: - **Red (`origin/main` `5825b02ff8`)**: With `QEMU_AARCH64=""` and a synthetic `qemu-system-aarch64.exe` placed in a temporary directory on Windows `PATH`, `x64_recomp.QEMU_BIN` evaluated to `''` (`os.path.isfile(x.QEMU_BIN) == False`) instead of discovering the `.exe` on `PATH` (and when `QEMU_AARCH64` was unset, `x64_recomp.QEMU_BIN` fell back to bare `'qemu-system-aarch64'` rather than `shutil.which(...)`). - **Green (`#950 + origin/main`)**: - With `QEMU_AARCH64=""` and `qemu-system-aarch64.exe` on Windows `PATH`, `shutil.which("qemu-system-aarch64")` resolved `x64_recomp.QEMU_BIN` to `<tempdir>/qemu-system-aarch64.EXE` (`os.path.isfile(x.QEMU_BIN) == True`). - `python -I tests/test_x64_recomp.py` -> `45 ran, OK (skipped=32)` (`0.001s`; the 13 non-QEMU decoder/translator/kernel-image tests passed and the 32 QEMU execution tests skipped cleanly). - Doc verification suites: `test_docs_table_rows.py` (`2/2`), `test_docs_repo_paths.py` (`5/5`), `test_docs_encoding.py` (`1/1`), `test_docs_env_vars.py` (`5/5`) -> all `OK`.
MoonEyes commented 2026-11-29 17:09:06 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T17:09:06Z.


Tested 16452e785 merged (no commit) with main 4364a4fa6: Python 3.12, Windows 11 10.0.26300, CPU only.

  • python -I tests/test_x64_recomp.py gives 47 tests OK (34 skipped) with this PR, and the same 47 OK with tools/x64_recomp.py back to main. No red: the test does not cover the change, or the change is covered only by the 34 skipped tests. Which test fails without the fix?

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7259463037 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/950#issuecomment-7259463037). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-29T17:09:06Z. --- Tested `16452e785` merged (no commit) with `main` `4364a4fa6`: Python 3.12, Windows 11 10.0.26300, CPU only. - `python -I tests/test_x64_recomp.py` gives 47 tests OK (34 skipped) with this PR, and the same 47 OK with `tools/x64_recomp.py` back to `main`. No red: the test does not cover the change, or the change is covered only by the 34 skipped tests. Which test fails without the fix? AI-assisted (Claude Code).
MoonEyes commented 2026-11-30 08:13:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-30T08:13:42Z.


Merged. Tested by @zmasi on head 16452e785 (CPU only (Windows 11)): x64_recomp QEMU_BIN: red on main (QEMU_AARCH64 empty + qemu on PATH not found), green PR resolves; test_x64_recomp 45 OK. Correction: the only check run on this head passed; there was no red job, so my earlier sentence about red jobs did not apply. Thanks @barkodr!

AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7272641112 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/950#issuecomment-7272641112). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-30T08:13:42Z. --- Merged. Tested by @zmasi on head 16452e785 (CPU only (Windows 11)): x64_recomp QEMU_BIN: red on main (QEMU_AARCH64 empty + qemu on PATH not found), green PR resolves; test_x64_recomp 45 OK. Correction: the only check run on this head passed; there was no red job, so my earlier sentence about red jobs did not apply. Thanks @barkodr! AI-assisted: yes
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
ProjectLeonida/mandy!950
No description provided.