run_wine_session: initialize and stop the prefix with $WINE #217

Closed
Andretuta wants to merge 1 commit from upstream-pr/217 into main
Andretuta commented 2026-11-24 02:46:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-24T02:46:24Z.


Carried over from old PR 9952 by SkippySteve in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9952, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
SkippySteve: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Claim: https://github.com/ItsNotRexed/Leonida/issues/9677#issuecomment-7116873558

scripts/run_wine_session.sh ran wineboot and wineserver from PATH, while run_wine_tests.py runs the tests with $WINE. With WINE set to Proton's or UMU-Proton's files/bin/wine:

  • on a host without a system Wine, the script stopped at timeout: failed to run command 'wineboot' (exit 127), and the exit trap printed wineserver: command not found;
  • on a host with a system Wine, the prefix was initialized by that other Wine, and the trap stopped the wrong wineserver.

The script now runs "$WINE" wineboot --init (default wine, as run_wine_tests.py does) and, at exit, stops $WINESERVER, else the wineserver next to $WINE, else wineserver on PATH (the same lookup winetricks uses). A WINE that can't be found is reported with status 127. CI doesn't set WINE, so it still uses the Wine on PATH and its wineserver. docs/testing.md says so in one sentence.

Tests

  • tests/test_run_wine_session.py (new, fake wine/wineserver scripts, including a path with a space): 4 tests pass; against the old script all 4 fail.
  • Arch Linux, UMU-Proton 11.0-2e, no system Wine: WINE=<UMU-Proton>/files/bin/wine WINEPREFIX=$(mktemp -d) bash scripts/run_wine_session.sh "$WINE" cmd /c echo … initializes the prefix, prints the echo, exits 0, and leaves no wineserver running. The old script exits 127 here.
  • bash -n, scripts/check_no_game_data.py clean.

No game files used. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5465117473 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/217). Originally posted by [Andretuta](https://github.com/Andretuta) on 2026-11-24T02:46:24Z. --- > Carried over from **old PR 9952** by `SkippySteve` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9952`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `SkippySteve`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Claim: https://github.com/ItsNotRexed/Leonida/issues/9677#issuecomment-7116873558 `scripts/run_wine_session.sh` ran `wineboot` and `wineserver` from `PATH`, while `run_wine_tests.py` runs the tests with `$WINE`. With `WINE` set to Proton's or UMU-Proton's `files/bin/wine`: - on a host without a system Wine, the script stopped at `timeout: failed to run command 'wineboot'` (exit 127), and the exit trap printed `wineserver: command not found`; - on a host with a system Wine, the prefix was initialized by that other Wine, and the trap stopped the wrong wineserver. The script now runs `"$WINE" wineboot --init` (default `wine`, as `run_wine_tests.py` does) and, at exit, stops `$WINESERVER`, else the `wineserver` next to `$WINE`, else `wineserver` on `PATH` (the same lookup winetricks uses). A `WINE` that can't be found is reported with status 127. CI doesn't set `WINE`, so it still uses the Wine on `PATH` and its `wineserver`. `docs/testing.md` says so in one sentence. ### Tests - `tests/test_run_wine_session.py` (new, fake wine/wineserver scripts, including a path with a space): 4 tests pass; against the old script all 4 fail. - Arch Linux, UMU-Proton 11.0-2e, no system Wine: `WINE=<UMU-Proton>/files/bin/wine WINEPREFIX=$(mktemp -d) bash scripts/run_wine_session.sh "$WINE" cmd /c echo …` initializes the prefix, prints the echo, exits 0, and leaves no wineserver running. The old script exits 127 here. - `bash -n`, `scripts/check_no_game_data.py` clean. No game files used. AI-assisted.
MoonEyes commented 2026-11-27 19:43:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-27T19:43:56Z.


Thanks a lot for carrying this over, @Andretuta. The same change is in #1241: it carries SkippySteve's commit from old-pr/9952 with the same diff to scripts/run_wine_session.sh, docs/testing.md and tests/test_run_wine_session.py, and it was claimed in #14 as OLD-9952.

I am closing this draft so the review happens in one place. Please continue the discussion on #1241, or reopen this one if you see something it misses.

AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7226815997 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/217#issuecomment-7226815997). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-27T19:43:56Z. --- Thanks a lot for carrying this over, @Andretuta. The same change is in #1241: it carries SkippySteve's commit from `old-pr/9952` with the same diff to `scripts/run_wine_session.sh`, `docs/testing.md` and `tests/test_run_wine_session.py`, and it was claimed in #14 as OLD-9952. I am closing this draft so the review happens in one place. Please continue the discussion on #1241, or reopen this one if you see something it misses. AI-assisted (Claude Code, Claude Opus 5.5)

Pull request closed

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!217
No description provided.