Keep Wine runner resources scoped to one prefix owner #1964

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

@⁠lgr123 on GitHub · 2026-11-25 16:53 UTC · original
lgr123:lgr123/wine-prefix-ownership → main · +87 −1 · 2 files · 1 commits · open

Claimed in the coordination issue as WINE-PREFIX-RUNNER-OWNERSHIP.

What and why

Two direct invocations of the Wine runner can share a temporary mapping in the same prefix. On main, two independent processes both read a synthetic fixture through D:. The first passed and removed its link on exit. The second then failed because the link was gone. Separately, an owner stopping its kept wineserver can interrupt a borrower.

On POSIX, hold an exclusive nonblocking lock on the Wine prefix directory from before mapping or server setup through teardown. A simultaneous invocation gets a usage error. A symlink to the same prefix shares the lock. Distinct prefixes can still run in parallel, --jobs within a run is unchanged, and the lock leaves no file behind. The runner creates an empty prefix directory if it needs one for the lock. This scopes ownership among direct runner invocations. The session wrapper continues to call for its own dedicated test prefix.

Tested

  • Linux x86-64, Python 3.11.17 in Docker. The standalone reproduction failed on public main 9e7720c9 and passed after the change. The new integration regression failed on main, then confirmed that the symlink alias was rejected, a separate prefix could run, and the original prefix could be reused after teardown.
  • All 73 runner tests and all 6 fixture tests passed with disposable prefixes. Tests substitute Python children or synthetic wineserver processes. No real Wine execution or game files were needed.
  • git diff --check and the source-only policy check passed.

GPUs tested: n/a.

AI-assisted: yes.

Checklist

  • Based on current main.
  • One topic.
  • No game data, keys or decryption.
**@⁠lgr123** on GitHub · 2026-11-25 16:53 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1964) `lgr123:lgr123/wine-prefix-ownership` → `main` · +87 −1 · 2 files · 1 commits · open Claimed in the coordination issue as [WINE-PREFIX-RUNNER-OWNERSHIP](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608). ### What and why Two direct invocations of the Wine runner can share a temporary mapping in the same prefix. On main, two independent processes both read a synthetic fixture through D:. The first passed and removed its link on exit. The second then failed because the link was gone. Separately, an owner stopping its kept wineserver can interrupt a borrower. On POSIX, hold an exclusive nonblocking lock on the Wine prefix directory from before mapping or server setup through teardown. A simultaneous invocation gets a usage error. A symlink to the same prefix shares the lock. Distinct prefixes can still run in parallel, --jobs within a run is unchanged, and the lock leaves no file behind. The runner creates an empty prefix directory if it needs one for the lock. This scopes ownership among direct runner invocations. The session wrapper continues to call for its own dedicated test prefix. ### Tested - Linux x86-64, Python 3.11.17 in Docker. The standalone reproduction failed on public main 9e7720c9 and passed after the change. The new integration regression failed on main, then confirmed that the symlink alias was rejected, a separate prefix could run, and the original prefix could be reused after teardown. - All 73 runner tests and all 6 fixture tests passed with disposable prefixes. Tests substitute Python children or synthetic wineserver processes. No real Wine execution or game files were needed. - git diff --check and the source-only policy check passed. GPUs tested: n/a. AI-assisted: yes. ### Checklist - [x] Based on current main. - [x] One topic. - [x] No game data, keys or decryption.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:12:59 +00:00
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/1964/head:github-bot/gh-1964'
git switch 'github-bot/gh-1964'

Merge

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