Repository navigation
Conversation
Proton's default launch (a Steam shortcut, `proton run`, umu's waitforexitandrun) starts the program through its steam.exe, which gives it no console: none of the loader's report, [rt] lines or errors reach the player, only an exit code. --log FILE reopens stdout on FILE in append mode, points stderr at it and sets the process's standard handles to it, so host code and a process base_reservation starts again write there too. Unbuffered, so a crash keeps what was printed. A log file that can't be opened is refused before anything is mapped. run_tiny_game_log_file checks the dry-run report and, appended after it, the guest's own printf output and exit line, nothing on the console, and the refusal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014W1f1QexoRrV2Dg68CN4cD
Desamodeth
left a comment
There was a problem hiding this comment.
On native Windows (MSVC x64 Release, 6c5581e0), starting gta6rt --run tiny_game.exe --log FILE with DETACHED_PROCESS and no output pipes exits 1 before the guest starts. An existing log stays byte-for-byte unchanged. The current CTest passes because it gives the child output pipes.
With no console, the CRT can report a negative descriptor for stderr, so duplicating stdout onto it fails. The patch gives that stream a descriptor first. Its regression test reproduced the failure on this head. With the fix, the guest writes to the log and returns 42, and a second launch with a missing image appends its diagnostic after the first run. Eight focused CTests and all 15 combinations of launch mode and logging scenario passed on Windows with synthetic fixtures. CPU only, AI-assisted.
--log (from ItsNotRexed#7329) takes a value; without it in the launcher's value list the file name counted as an image and packaged defaults were dropped. Relative --log paths now resolve against the caller's cwd like --trace.
AI-assisted-by: Codex Astra 6.2 High
|
Thanks @Desamodeth, good catch: that detached case is exactly the one AI-assisted (Claude Code). |
|
Verified at 6c5581e, clean against current main 9177299. The --log plumbing reads right: append reopen unbuffered, stderr dup2'd onto stdout, SetStdHandle refreshed so host code and base_reservation inherit, bare trailing --log falls to usage(); check_log_file.cmake asserts the "1 module(s) mapped" line lands and appends across relaunch. The cmake-run test needs the Windows job; CI pending. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run, C++ review-only). |
|
Tested 185a0c4 on Windows 11, AMD Radeon RX 9070 XT (RDNA4), driver 32.0.32029.2010: pass, with one finding
AI-assisted (Claude Code). |
|
Tested Windows build cross-compiled with clang-cl 23.1.5 + xwin (SDK 10.0.26100) on CachyOS (Linux 7.3.5), run under Wine 11.22 (builtin d3d12/vkd3d, not Proton) on an AMD Radeon RX 6700 XT, RADV Mesa 26.3.1.
That's plain Wine 11.22 next to your Proton (wine-11.0) run. I didn't try Proton's AI-assisted (Claude Code). |
|
Tested |
|
Baseline on main here: AI-assisted (Claude Code). |
|
checked: #7329 | with: WINEPREFIX=/home/SSD/GEProto13-prefix/pfx /home/SSD/GE-Proton11-13-x86_64/files/bin/wine gta6rt.exe --dry-run game_scarlett_master.exe --log Z:\tmp\run.log | on: Linux, Wine 11.13 (GE-Proton 11-13, wine-11.0), main 3470223 + PR 185a0c4 (merge-base 8575d36) | result: pass, no regression found Applied cleanly at the merge result and built with clang-cl/xwin (RelWithDebInfo, agent: yes |
Item: new RT item claimed in #6910 (claim).
Why: Proton's default launch (a Steam "non-Steam game" shortcut,
proton run, umu's defaultwaitforexitandrun) starts the program through Proton's built-insteam.exe, which gives it no console. A player who startsgta6rt.exethat way gets none of the loader's output: no dry-run report, no[rt]lines, noerror:. Only the exit code comes back. I measured this while testing #4213 (details):proton run, with or without a pty, andPROTON_LOGdon't capture it either.Change (
runtime/src/main.cpp):--log FILE, accepted in every mode, reopens stdout on FILE in append mode (_wfreopen_s),_dup2s stderr onto it, andSetStdHandles both. So the title's own CRT output, host code, and a processbase_reservationstarts again (it inherits the std handles and re-reads--log) all land in FILE.ExitProcessloses nothing. Append mode, so the relaunched process and later runs add to the file.error: cannot open the log file for appendingand exit 1 before anything is mapped. The usage text lists[--log FILE].gta6rt.sh --dry-run/--init/--run.Test:
run_tiny_game_log_file(runtime/test/check_log_file.cmake, on the synthetictiny_gamefixture) checks:--dry-run --log Fwrites1 module(s) mappedto F and not to stdout;--run --log F -- hello 42appendstiny_game: started, argc=3 … tiny_game: OK … game exited with code 0after the first report, prints nothing of the guest's on the console, and exits 0;Tested (Ubuntu 24.04, NVIDIA RTX 4090, real display; clang-cl 19.1.1 + xwin cross-build of current main with this change):
CMAKE_CROSSCOMPILING_EMULATOR:run_tiny_game_log_filepasses. All otherrun_tiny_game*andgta6rt_rejects_*tests pass too, exceptrun_tiny_game_abort_exit_codes, which fails on main too (fixed by tiny_game_abort_test: the native reference accepts Wine's abort() exit code 3 #6539).proton run gta6rt.exe --run Z:<tiny_game.exe> --log Z:<file> -- hello 42gives rc 0 and an empty console, and the file holds the guest'sstarted/OKlines andgame exited with code 0. Same withtiny_game_fixed.exe.tests/test_docs_*.py:test_docs_cli_flagsandtest_docs_linksfail on main too (docs/dev-tools.md); the rest pass.--lognothing changes.AI-assisted (Claude Code, Claude Opus 5.5).
🤖 Generated with Claude Code
https://claude.ai/code/session_014W1f1QexoRrV2Dg68CN4cD