run_guest_scene: take the Wine from $WINE when --wine is not given (OLD-10047) #1239

Open
github-bot wants to merge 2 commits from github-bot/gh-1239 into main AGit
Owner

@⁠IlyassRS3 on GitHub · 2026-11-24 20:42 UTC · original
IlyassRS3:carry/old-10047-run-guest-scene-wine → main · +129 −4 · 2 files · 2 commits · open

What changed

Carries forward old-pr/10047 (draft #313, original commit by @⁠SkippySteve) rebased cleanly onto main (2e026b03e), preserving the original author commit and adding a follow-up fix for native Windows:

  1. Original commit (@SkippySteve):
    • scripts/run_guest_scene.py: default --wine to $WINE when --wine is omitted (blank counts as unset; --wine still overrides), include the missing binary path in --wine: not found: ..., and update CLI/docstring messages.
    • tests/test_run_guest_scene_wine.py: 5 unit tests covering $WINE pickup, --wine-arg with $WINE, --wine overriding $WINE, missing/empty $WINE refusal outside Windows, and nonexistent $WINE reporting.
  2. Follow-up commit (df763ce9f, addressing @⁠xel1uz's review):
    • scripts/run_guest_scene.py: only read $WINE as the default outside Windows (os.name != "nt"), qualify the docstring / --wine help text (default: $WINE outside Windows), and keep --wine-arg requires --wine on Windows.
    • tests/test_run_guest_scene_wine.py: add RunGuestSceneWindowsEnvTest (3 tests, runs on every platform via a SimpleNamespace stub on runner.os) confirming ambient WINE (existing or missing) is ignored on Windows, explicit --wine still works, and --wine-arg requires explicit --wine.

Item ID

  • Coordination issue #14 item: OLD-10047 (carries forward old-pr/10047 / draft #313, #17)
  • Depends on: none

Verification

Tested on macOS 27.2.1 (Apple M5 arm64), Python 3.14 (no game files, no GPU, standard library only):

  • TMPDIR=/var/tmp python3 -I tests/test_run_guest_scene_wine.py -v -> 8/8 OK (5 POSIX + 3 Windows-mode tests)
  • python3 -I tests/test_guest_scene_reference.py -v -> 6/6 OK
  • Mutation check vs HEAD~1 (without the Windows guard) -> FAILED (3 failures) across all 3 Windows ambient-WINE checks; mutation check vs main -> FAILED (3 failures, 2 errors); restoring HEAD returns to 8/8 OK.
  • python3 -m compileall -q scripts/run_guest_scene.py tests/test_run_guest_scene_wine.py -> OK
  • python3 -I scripts/check_no_game_data.py scripts/run_guest_scene.py tests/test_run_guest_scene_wine.py -> OK
  • python3 -I tests/test_ci_registration.py -> 15/15 OK
  • python3 -I tests/test_text_write_line_endings.py -> 3/3 OK

Checklist

  • No game files, binaries, shaders, textures, audio, or logs quoting them
  • No keys, decryption, or online services
  • Claimed in the coordination issue (#14) before opening this PR
  • AI-assisted: yes (carried forward, audited, rebased, updated per review, and regression-verified with AI assistance; original commit by @⁠SkippySteve preserved)
**@⁠IlyassRS3** on GitHub · 2026-11-24 20:42 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1239) `IlyassRS3:carry/old-10047-run-guest-scene-wine` → `main` · +129 −4 · 2 files · 2 commits · open ## What changed Carries forward `old-pr/10047` (draft #313, original commit by @⁠SkippySteve) rebased cleanly onto `main` (`2e026b03e`), preserving the original author commit and adding a follow-up fix for native Windows: 1. **Original commit (`@SkippySteve`)**: - `scripts/run_guest_scene.py`: default `--wine` to `$WINE` when `--wine` is omitted (blank counts as unset; `--wine` still overrides), include the missing binary path in `--wine: not found: ...`, and update CLI/docstring messages. - `tests/test_run_guest_scene_wine.py`: 5 unit tests covering `$WINE` pickup, `--wine-arg` with `$WINE`, `--wine` overriding `$WINE`, missing/empty `$WINE` refusal outside Windows, and nonexistent `$WINE` reporting. 2. **Follow-up commit (`df763ce9f`, addressing @⁠xel1uz's review)**: - `scripts/run_guest_scene.py`: only read `$WINE` as the default outside Windows (`os.name != "nt"`), qualify the docstring / `--wine` help text (`default: $WINE outside Windows`), and keep `--wine-arg requires --wine` on Windows. - `tests/test_run_guest_scene_wine.py`: add `RunGuestSceneWindowsEnvTest` (3 tests, runs on every platform via a `SimpleNamespace` stub on `runner.os`) confirming ambient `WINE` (existing or missing) is ignored on Windows, explicit `--wine` still works, and `--wine-arg` requires explicit `--wine`. ## Item ID - Coordination issue #14 item: `OLD-10047` (carries forward `old-pr/10047` / draft #313, #17) - Depends on: none ## Verification Tested on macOS 27.2.1 (Apple M5 arm64), Python 3.14 (no game files, no GPU, standard library only): - `TMPDIR=/var/tmp python3 -I tests/test_run_guest_scene_wine.py -v` -> **8/8 OK** (5 POSIX + 3 Windows-mode tests) - `python3 -I tests/test_guest_scene_reference.py -v` -> **6/6 OK** - Mutation check vs `HEAD~1` (without the Windows guard) -> **FAILED (3 failures)** across all 3 Windows ambient-`WINE` checks; mutation check vs `main` -> **FAILED (3 failures, 2 errors)**; restoring `HEAD` returns to 8/8 OK. - `python3 -m compileall -q scripts/run_guest_scene.py tests/test_run_guest_scene_wine.py` -> OK - `python3 -I scripts/check_no_game_data.py scripts/run_guest_scene.py tests/test_run_guest_scene_wine.py` -> OK - `python3 -I tests/test_ci_registration.py` -> **15/15 OK** - `python3 -I tests/test_text_write_line_endings.py` -> **3/3 OK** ## Checklist - [x] No game files, binaries, shaders, textures, audio, or logs quoting them - [x] No keys, decryption, or online services - [x] Claimed in the coordination issue (#14) before opening this PR - [x] AI-assisted: yes (carried forward, audited, rebased, updated per review, and regression-verified with AI assistance; original commit by @⁠SkippySteve preserved)
On Linux the script stopped at '--wine is required outside Windows' even
with WINE naming the Wine to use (e.g. UMU-Proton's files/bin/wine), while
run_wine_tests.py already defaults --wine to $WINE. --wine now defaults to
$WINE (blank counts as unset); --wine still wins when both are given.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:44:06 +00:00
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-11-24 20:42 UTC · original · reviewed

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-11-24 20:42 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1239#pullrequestreview-6047074020) · **reviewed** Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Author
Owner

@⁠xel1uz on GitHub · 2026-11-24 20:48 UTC · original · requested changes

The Linux precedence cases pass, but on native Windows an ambient WINE now changes a launch even when the caller omits --wine. With a missing binary the parser exits 2; with an existing one, the guest path builder prefixes an already native drive path with Z:. All five new Wine tests skip on Windows.

The inline change restored native paths in the Windows check while preserving the five Wine tests and six reference tests on Ubuntu. Please add a native-Windows regression case and qualify the CLI help accordingly. The original Wine change is draft #313; the description currently points to #312. AI-assisted review, CPU only.

**@⁠xel1uz** on GitHub · 2026-11-24 20:48 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1239#pullrequestreview-6047150440) · **requested changes** The Linux precedence cases pass, but on native Windows an ambient `WINE` now changes a launch even when the caller omits `--wine`. With a missing binary the parser exits 2; with an existing one, the guest path builder prefixes an already native drive path with `Z:`. All five new Wine tests skip on Windows. The inline change restored native paths in the Windows check while preserving the five Wine tests and six reference tests on Ubuntu. Please add a native-Windows regression case and qualify the CLI help accordingly. The original Wine change is [draft #313](https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/313); the description currently points to #312. AI-assisted review, CPU only.
Author
Owner

@⁠xel1uz on GitHub · 2026-11-24 20:48 UTC · original
On scripts/run_guest_scene.py line 329 (outdated):

@@ -324,13 +326,14 @@ def parse_args() -> argparse.Namespace:
     ap.add_argument("--guest", type=Path, required=True)
     ap.add_argument("--shaders", type=Path, required=True, help="shader root containing spirv/")
     ap.add_argument("--out", type=Path, help="new or empty folder (default: a temporary folder, removed afterwards)")
-    ap.add_argument("--wine", help="run the loader through this Wine binary")
+    ap.add_argument("--wine", default=os.environ.get("WINE") or None,

Read the environment default on hosts that use Wine for the guest. An explicit --wine still takes precedence.

    ap.add_argument("--wine", default=(os.environ.get("WINE") or None) if os.name != "nt" else None,
**@⁠xel1uz** on GitHub · 2026-11-24 20:48 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1239#discussion_r4686338944) On `scripts/run_guest_scene.py` line 329 (outdated): ```diff @@ -324,13 +326,14 @@ def parse_args() -> argparse.Namespace: ap.add_argument("--guest", type=Path, required=True) ap.add_argument("--shaders", type=Path, required=True, help="shader root containing spirv/") ap.add_argument("--out", type=Path, help="new or empty folder (default: a temporary folder, removed afterwards)") - ap.add_argument("--wine", help="run the loader through this Wine binary") + ap.add_argument("--wine", default=os.environ.get("WINE") or None, ``` Read the environment default on hosts that use Wine for the guest. An explicit `--wine` still takes precedence. ```suggestion ap.add_argument("--wine", default=(os.environ.get("WINE") or None) if os.name != "nt" else None, ```
Author
Owner

@⁠IlyassRS3 on GitHub · 2026-11-24 21:00 UTC · original

Thank you for catching that, @⁠xel1uz! Pushed follow-up commit df763ce9f (preserving @⁠SkippySteve's original commit):

  • Restricted the $WINE default to os.name != "nt", updated the docstring and --wine help text (default: $WINE outside Windows), and kept --wine-arg requires --wine on Windows.
  • Added RunGuestSceneWindowsEnvTest (3 tests, runs on both POSIX and Windows via a SimpleNamespace stub for runner.os) verifying that ambient WINE (existing or missing) is ignored on Windows, explicit --wine still takes precedence, and --wine-arg requires explicit --wine (verified 3 failures against HEAD~1, 8/8 OK on HEAD).
  • Fixed the draft PR reference in the description (#313).
**@⁠IlyassRS3** on GitHub · 2026-11-24 21:00 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1239#issuecomment-7144350398) Thank you for catching that, @⁠xel1uz! Pushed follow-up commit `df763ce9f` (preserving @⁠SkippySteve's original commit): - Restricted the `$WINE` default to `os.name != "nt"`, updated the docstring and `--wine` help text (`default: $WINE outside Windows`), and kept `--wine-arg requires --wine` on Windows. - Added `RunGuestSceneWindowsEnvTest` (3 tests, runs on both POSIX and Windows via a `SimpleNamespace` stub for `runner.os`) verifying that ambient `WINE` (existing or missing) is ignored on Windows, explicit `--wine` still takes precedence, and `--wine-arg` requires explicit `--wine` (verified 3 failures against `HEAD~1`, 8/8 OK on `HEAD`). - Fixed the draft PR reference in the description (`#313`).
Author
Owner

@⁠lixonik on GitHub · 2026-11-25 05:33 UTC · original · reviewed

Rechecked the follow-up at df763ce9 on native Windows and Ubuntu under WSL. With the same inherited WINE pointing to a missing path and no explicit flag, the first PR head exited 2 on native Windows and the follow-up left the native launch selected. The three Windows cases passed, and all eight tests passed under Ubuntu. A separate CLI run on Ubuntu launched a synthetic wrapper from a relative WINE path containing spaces, forwarded --wine-arg, and preserved an explicit --wine override. The wrapper was launched after the runner switched into its output overlay.

AI-assisted review. CPU-only checks with synthetic inputs and launchers.

**@⁠lixonik** on GitHub · 2026-11-25 05:33 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1239#pullrequestreview-6052341647) · **reviewed** Rechecked the follow-up at `df763ce9` on native Windows and Ubuntu under WSL. With the same inherited `WINE` pointing to a missing path and no explicit flag, the first PR head exited 2 on native Windows and the follow-up left the native launch selected. The three Windows cases passed, and all eight tests passed under Ubuntu. A separate CLI run on Ubuntu launched a synthetic wrapper from a relative `WINE` path containing spaces, forwarded `--wine-arg`, and preserved an explicit `--wine` override. The wrapper was launched after the runner switched into its output overlay. AI-assisted review. CPU-only checks with synthetic inputs and launchers.
Author
Owner

@⁠xel1uz on GitHub · 2026-11-25 19:35 UTC · original · approved these changes

Approving df763ce9: the follow-up resolves what I requested.

  • Native Windows (Python 3.12, WINE set to a missing path, no --wine): tests/test_run_guest_scene_wine.py 8 tests OK (the 3 Windows-mode cases pass, the 5 POSIX cases skip), tests/test_guest_scene_reference.py 6/6 OK.
    • Bite check: with scripts/run_guest_scene.py from the first head (f3cd82af), the 3 Windows-mode cases fail.
      • Linux (Ubuntu 26.04, Python 3.14): both files OK on the PR head and on the PR merged with current main (merges without conflicts).
        AI-assisted review, CPU only.
**@⁠xel1uz** on GitHub · 2026-11-25 19:35 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1239#pullrequestreview-6063812223) · **approved these changes** Approving `df763ce9`: the follow-up resolves what I requested. - Native Windows (Python 3.12, `WINE` set to a missing path, no `--wine`): `tests/test_run_guest_scene_wine.py` 8 tests OK (the 3 Windows-mode cases pass, the 5 POSIX cases skip), `tests/test_guest_scene_reference.py` 6/6 OK. - - Bite check: with `scripts/run_guest_scene.py` from the first head (`f3cd82af`), the 3 Windows-mode cases fail. - - - Linux (Ubuntu 26.04, Python 3.14): both files OK on the PR head and on the PR merged with current `main` (merges without conflicts). AI-assisted review, CPU only.
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/1239/head:github-bot/gh-1239'
git switch 'github-bot/gh-1239'

Merge

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