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

Open
github-bot wants to merge 1 commit from github-bot/gh-950 into main AGit
Owner

@⁠barkodr on GitHub · 2026-11-24 15:37 UTC · original
barkodr:fix/x64-recomp-qemu-path → main · +7 −13 · 3 files · 1 commits · open

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.
**@⁠barkodr** on GitHub · 2026-11-24 15:37 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/950) `barkodr:fix/x64-recomp-qemu-path` → `main` · +7 −13 · 3 files · 1 commits · open 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:30:02 +00:00
Author
Owner

@⁠tiguan26 on GitHub · 2026-11-25 03:56 UTC · original · approved these changes

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).

**@⁠tiguan26** on GitHub · 2026-11-25 03:56 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/950#pullrequestreview-6051645865) · **approved these changes** 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).
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 21:54 UTC · original

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

**@⁠PierreEbele** on GitHub · 2026-11-25 21:54 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/950#issuecomment-7175683240) 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
Author
Owner

@⁠kevincommits on GitHub · 2026-11-25 22:04 UTC · original

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.

**@⁠kevincommits** on GitHub · 2026-11-25 22:04 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/950#issuecomment-7175901897) 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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/950/head:github-bot/gh-950'
git switch 'github-bot/gh-950'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-950'
git switch 'github-bot/gh-950'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-950'
git switch 'github-bot/gh-950'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-950'
git switch 'main'
git merge --squash 'github-bot/gh-950'
git switch 'main'
git merge --ff-only 'github-bot/gh-950'
git switch 'main'
git merge 'github-bot/gh-950'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.