x64_recomp: find qemu through QEMU_AARCH64 or PATH, not a contributor's home folder #950
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/950"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.pyandtests/test_x64_recomp.pywas one contributor's/home/nolan/.nix-profilefolder. The tool now usesQEMU_AARCH64, elseqemu-system-aarch64onPATH, and the test reusesx64_recomp.QEMU_BINinstead of its own copy of the lookup.docs/mobile.mdnow 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.pyandtests/test_docs_python_deps.pypass 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_AARCH64is used when set (also ahead ofPATH), else the binary onPATH, else the bare name.GPUs tested: none (no GPU code changed)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.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).
Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T21:54:03Z.
Reviewed
16452e7: rantests/test_x64_recomp.pyandtests/test_docs_table_rows.pypluscompileallon both main and the PR (32 tests OK, 26 exec tests skip, no qemu here), and a stub probe of the discovery logic:QEMU_AARCH64and 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 oneQEMU_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
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
mainat6b843a4adinto the branch locally (1,001 commits behind, no conflicts).PATH,QEMU_AARCH64unset:tests/test_x64_recomp.py33/33, none skipped (the same asmain).PATH,QEMU_AARCH64unset: OK with 26 skipped, so the skip is still clean.PATH,QEMU_AARCH64set to the binary: 33/33, none skipped.tests/test_recomp_census.py: 11/11. Every standalonetests/test_*.pyunderpython -I: 510 run, 506 pass; the 4 that fail are the same 4 that fail on plainmain.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.
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:45:26Z.
Verified by OreoFR
3408969a7+ PR head16452e785python -I tests/test_x64_recomp.pyAI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T01:25:45Z.
#950 | head
16452e785f(merged cleanly onto origin/main5825b02ff8) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yesIndependent Verification (Windows 11)
docs/mobile.md,tools/x64_recomp.py(QEMU_BIN = os.environ.get("QEMU_AARCH64") or shutil.which("qemu-system-aarch64") or "qemu-system-aarch64"), andtests/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.pypassed (rc=0).origin/main5825b02ff8): WithQEMU_AARCH64=""and a syntheticqemu-system-aarch64.exeplaced in a temporary directory on WindowsPATH,x64_recomp.QEMU_BINevaluated to''(os.path.isfile(x.QEMU_BIN) == False) instead of discovering the.exeonPATH(and whenQEMU_AARCH64was unset,x64_recomp.QEMU_BINfell back to bare'qemu-system-aarch64'rather thanshutil.which(...)).#950 + origin/main):QEMU_AARCH64=""andqemu-system-aarch64.exeon WindowsPATH,shutil.which("qemu-system-aarch64")resolvedx64_recomp.QEMU_BINto<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).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) -> allOK.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T17:09:06Z.
Tested
16452e785merged (no commit) withmain4364a4fa6: Python 3.12, Windows 11 10.0.26300, CPU only.python -I tests/test_x64_recomp.pygives 47 tests OK (34 skipped) with this PR, and the same 47 OK withtools/x64_recomp.pyback tomain. 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).
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