[PR #1964] Keep Wine runner resources scoped to one prefix owner #1971

Open
opened 2026-11-26 21:19:35 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1964
Author: @lgr123
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: lgr123/wine-prefix-ownership


📝 Commits (1)

  • 7bb0237 Keep Wine runner resources scoped to one prefix owner

📊 Changes

2 files changed (+87 additions, -1 deletions)

View changed files

📝 scripts/run_wine_tests.py (+33 -1)
📝 tests/test_run_wine_tests.py (+54 -0)

📄 Description

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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1964 **Author:** [@lgr123](https://github.com/lgr123) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `lgr123/wine-prefix-ownership` --- ### 📝 Commits (1) - [`7bb0237`](https://github.com/ubiquitarianism/leonida/commit/7bb023788b599b72df767cc92b50c44df46d5492) Keep Wine runner resources scoped to one prefix owner ### 📊 Changes **2 files changed** (+87 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `scripts/run_wine_tests.py` (+33 -1) 📝 `tests/test_run_wine_tests.py` (+54 -0) </details> ### 📄 Description Claimed in the coordination issue as [WINE-PREFIX-RUNNER-OWNERSHIP](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7168516497). ### 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1971
No description provided.