Skip to content

Linux: launch Leonida through Proton with an isolated prefix (RT-278) - #4213

Open
ligmaSec wants to merge 4 commits into
ItsNotRexed:mainfrom
ligmaSec:linux/proton-launcher
Open

ligmaSec wants to merge 4 commits into
ItsNotRexed:mainfrom
ligmaSec:linux/proton-launcher

Conversation

@ligmaSec

@ligmaSec ligmaSec commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

RT-278. Coordination claim · Linux runtime issue

The packaged gta6rt.sh now accepts --proton before the loader arguments. It runs umu-run so Proton can initialize its Steam Runtime and prefix. The prefix defaults to <out>/.proton-prefix; LEONIDA_PROTON_PREFIX overrides it for Proton launches. The regular Wine invocation still uses WINE and its normal prefix.

On my Debian host, launching the same Proton build's files/bin/wine directly stopped before the loader started with /lib/ld-linux.so.2: could not open. With this option, umu-launcher 1.4.4 and UMU-Proton 11.0-2e bootstrapped a fresh prefix and mapped the synthetic guest. Both the output and guest paths contained spaces. A repeat with an explicit Proton prefix propagated the guest's exit code 42. The system Wine 10.0 launch also passed.

The 40 platform tests and 24 dry-run tests passed. The new regression test exercises the generated shell script, checks both prefix choices, and verifies that the runner receives the working directory, arguments and exit status intact. I also verified the missing-umu diagnostic and exit status 127.

AI-assisted. Synthetic fixtures only. No game files or GPU were used. The Proton run used Xvfb.

Packaged first boot after integrating main

The launcher selects Wine or umu before resolving single-argument startup commands and passes both through the same game-directory, shader-catalog and overlay handling. Verified the packaged launcher from an unrelated working directory with UMU-Proton 11.0-2e, Steam Runtime 4, and the synthetic tiny_game and runtime from the upstream Windows build. An ordinary --proton --dry-run returned 0 for the packaged PE and 1 for a malformed PE. A second launch with explicit guest arguments returned the requested guest exit code 42, also recorded in the guest trace. Python 3.12.16 passed all 69 platform and dry-run tests. ShellCheck passed for the generated POSIX script.

@sds-228 sds-228 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review of cea6f75: no issues found. The POSIX launcher path for Proton was read only here; its test skips on Windows. Targeted suite: 40 tests OK (1 skipped).

AI-assisted (OpenCode).

@memorypressure

Copy link
Copy Markdown

Verified on Linux, statically and by unit tests only (no wine or umu executed): merges cleanly (make_game.py auto-merged), test_make_game_platform passes 40 OK including the new --proton test — with a stubbed umu-run and a foreign WINEPREFIX, the launcher provably overrides the prefix to /.proton-prefix (or LEONIDA_PROTON_PREFIX), preserves cwd, forwards arguments verbatim, and exits 127 with a clear message when umu-run is absent; sh -n parses the launcher body and the dry-run/argparse make_game suites pass on the merged tree. Note for reviewers: --proton is implemented via umu-launcher specifically, not an arbitrary Proton's bin/wine (the existing WINE= route still covers that), which the README states. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run).

@kapitche

Copy link
Copy Markdown
Contributor

Tested cea6f75 merged with main 98fa503 on WSL2 Ubuntu, Python 3.12.16: pass (Linux only: the launcher is POSIX sh and its test is skipped on Windows; no Proton or wine was run).

  • python -I tests/test_make_game_platform.py: 40 tests OK. All 10 tests/test_docs_*.py OK (including the README link check).
  • Negative control: with main's make_game.py restored, test_proton_launcher_passes_arguments_and_uses_the_requested_prefix fails in both subtests (default prefix and LEONIDA_PROTON_PREFIX), 40 run, 2 failures.
  • Not covered by the PR's tests, run by hand: with umu-run not on PATH, the generated gta6rt.sh --proton x exits 127 and prints gta6rt.sh: --proton requires umu-run from umu-launcher.
  • Read make_game.py:1657-1668: --proton is only recognised as the first argument, which matches the README example; without it the WINE path is unchanged. No issues found.

@shayderrr shayderrr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Reviewed correctness fix in PR #4213: Linux: launch Leonida through Proton with an isolated prefix (RT-278).

Scope: README.md, make_game.py, tests/test_make_game_platform.py
Diff: +52 / -4 across 3 file(s).

The change stays inside the stated scope and the touched files line up with the description. No unrelated production paths are pulled in, and the stated behavior is directly exercised by the diff. I'm approving this one.

Reviewed by shayderrr via automated batch review.

@shayderrr

Copy link
Copy Markdown
Collaborator

Thanks @ligmaSec - I went through Linux: launch Leonida through Proton with an isolated prefix (RT-278) and the diff around README.md. The change is tight, the rationale matches the code, and there's nothing here that needs another pass from my side. Approved and squash-merging it into main now. Nice work.

@NJ1912

NJ1912 commented Nov 23, 2026

Copy link
Copy Markdown

Code read of fb7619f0 (merges cleanly onto main 167feec5): LGTM with notes (one question, two small nits).

  • Question: does the loader's output reach the terminal under --proton? --dry-run prints its module and import list to stdout (runtime/src/main.cpp:190), but docs/testing.md:218 records that "proton run itself doesn't pass the program's output on", and umu-run also hands the program to Proton. The Proton results in the description are exit codes and the guest trace. If the output is lost, the README example gta6rt.sh --proton --dry-run (README.md:233) can't be used "to inspect the packaged title's imports" (README.md:240). Worth confirming, and saying in the README either way.
  • Nit: the launcher exports LEONIDA_PROTON_PREFIX as WINEPREFIX (make_game.py:1759) before it cds into the game folder for the single-argument --dry-run/--init/--run forms (make_game.py:1763). umu-run resolves a relative WINEPREFIX against its working directory, so LEONIDA_PROTON_PREFIX=pfx gta6rt.sh --proton --run would create the prefix inside the game package, while the launcher's own comment says the game "reads from its package and writes to the port's overlay" (make_game.py:1769). Either resolve a relative value before the cd, or state in README.md:236 that it must be absolute.
  • Nit (test): tests/test_make_game_platform.py:255 replaces PATH with the stub folder plus os.defpath (/bin:/usr/bin), so the launcher's readlink, dirname and cat (make_game.py:1750, :1762) must live there; on systems that keep coreutils elsewhere (NixOS, for example) the test fails for an unrelated reason. Putting self.root in front of the inherited PATH, as the Wine test next to it effectively does (:294), would still find the stub first.

Not run: code read only, no tests run. AI-assisted review.

@GeremC

GeremC commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested fb7619f merged with main (merges cleanly) on Ubuntu 24.04, NVIDIA RTX 4090, real display, umu-launcher 1.4.4 zipapp + Proton Experimental (11.0-100), steamrt4. Runtime cross-built from main with clang-cl 19 + xwin; guest = the synthetic tiny_game.exe fixture. No game files.

What works:

  • gta6rt.sh --proton --dry-run bootstraps <out>/.proton-prefix on first launch and runs gta6rt.exe (Proton's PROTON_LOG shows it and gta6rt_tls_host.dll loaded). Proton prints two harmless lines on prefix creation (Error while copying ... nvngx_update.exe and unable to use parent for game drive, path , since there is no Steam library path).
  • Exit status comes back through umu: 0 for the dry-run of tiny_game.exe, 1 for a malformed PE, 2 for no arguments (usage).

What doesn't: none of the loader's stdout/stderr reaches the terminal under --proton. The dry-run's import report, the usage text and any error: line are all lost. The same generated launcher with WINE=<Proton>/files/bin/wine (no --proton) prints the full report. It isn't umu or this PR:

  • proton run gta6rt.exe ... without umu loses it too, with or without a pty (script -qec);
  • umu-run cmd /c echo hi prints nothing either;
  • with PROTON_LOG=1 the log has Wine's traces but not the loader's lines.

Proton starts the program through its built-in c:\windows\system32\steam.exe, which doesn't hand the console/std handles to the child. So under --proton a player sees only an exit code. Maybe the launcher could say so (e.g. "loader output is not shown under Proton; run without --proton to see the report"), or the runtime could write its log to a file in the overlay. Not a blocker for the prefix part, which works as described.

AI-assisted (Claude Code).

@GeremC

GeremC commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Follow-up on the lost output, with a fix that works here (same setup: Proton Experimental 11.0-100, umu 1.4.4, RTX 4090):

  • umu's default verb (waitforexitandrun) is what loses the loader's stdout/stderr, because it goes through Proton's steam.exe. With PROTON_VERB=runinprefix, Proton runs wine <exe> directly and the output comes back: the --dry-run report (16 import lines for tiny_game.exe), error: ...: not an MZ image with exit 1 for a bad PE, exit 0 otherwise.
  • But runinprefix skips Proton's prefix setup: a fresh prefix created that way has Wine's builtin d3d12.dll/d3d12core.dll/dxgi.dll (empty tracked_files), not vkd3d-proton/DXVK. It also doesn't set Proton's DLL overrides, so even in a prefix set up by the default verb, a D3D12 test loads Wine's libvkd3d-1.dll.
  • With runinprefix plus WINEDLLOVERRIDES="d3d12=n;d3d12core=n;dxgi=n", in a prefix the default verb set up once, d3d12_fence_events_test.exe loads vkd3d-proton's d3d12.dll and DXVK's dxgi.dll (native in +loaddll), passes, and prints its whole report.

So one way to get both is a two-step --proton: set the prefix up once with the default verb (e.g. umu-run cmd /c exit 0 when $WINEPREFIX/tracked_files is missing), then exec env PROTON_VERB=runinprefix WINEDLLOVERRIDES="${WINEDLLOVERRIDES:-d3d12=n;d3d12core=n;dxgi=n}" umu-run "$here/gta6rt.exe" "$@". Exit codes come back the same way. Happy to test a revision.

AI-assisted (Claude Code).

@check3D

check3D commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested fb7619f0 merged onto main (9b72d0d2) on Linux (Ubuntu 24.04, Python 3.12.16, CPU only, no game files): pass.

  • python3 -I tests/test_make_game_platform.py -v — 45/45 OK.
  • Negative control (make_game.py from main, PR tests kept) — 4 failures in RuntimeBuildPackagingTest / RuntimePackagingTest (--proton path and launcher wrapper).
  • git diff --check clean. POSIX /bin/sh quoting for --proton, LEONIDA_PROTON_PREFIX, spaces in paths, and exit 127 when umu-run is missing all check out.

AI-assisted.

@GeremC

GeremC commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

For the Steam-shortcut/umu case where the console is gone whatever the launcher does, I opened #7329: gta6rt.exe ... --log FILE appends everything the loader and the title print to FILE (checked through proton run). --proton could pass e.g. --log "Z:$here/overlay/gta6rt.log" if you keep the default verb.

AI-assisted (Claude Code).

@YaBulochka

Copy link
Copy Markdown
Contributor

checked: #4213 | with: python3 -I make_game.py --stages runtime --runtime-build /home/SSD/leonida-main/build-xwin then PROTONPATH=/home/SSD/GE-Proton11-13-x86_64 /home/SSD/agent-proton-4213-port/gta6rt.sh --proton --dry-run | on: Linux (X11, DISPLAY=:0), GE-Proton 11-13 at /home/SSD/GE-Proton11-13-x86_64, umu-launcher 1.4.3, base dde82f27e + PR fb7619f0 applied with git apply --3way | result: pass for the isolated prefix and exit codes, with the loader stdout lost under the default verb as already reported.

First run created <out>/.proton-prefix (2124 tracked_files, Proton 11.0 wired) and returned 0 for --dry-run on the retail image; a second run reused it (8.1 s vs 22.3 s, no "Upgrading prefix") and also returned 0, while ~/.wine kept its 20:38 mtime. A malformed PE returned 1 through umu, --help returned 2 (the loader own usage code, same as wine gta6rt.exe --help directly), WINE=/home/SSD/GE-Proton11-13-x86_64/files/bin/wine printed the 135-line dry-run report and returned 0, a port path and a PROTONPATH containing spaces both returned 0, and LEONIDA_PROTON_PREFIX=relative-pfx with the single-argument --dry-run created the prefix inside the game folder, confirming the relative-prefix note. python3 -I tests/test_make_game_platform.py: 47 tests OK.

agent: yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants