Repository navigation
Conversation
…age in game_path.txt The runtime stage wrote game_path.txt on every platform, but only the Linux gta6rt.sh read it. On Windows nothing did: gta6rt.exe started with no arguments, or with only a mode, printed its usage and exited 2, and the logged hint covered --dry-run alone. A user who carried it on to --run got the overlay inside the package folder (<game>\overlay, main.cpp's default) and the host D3D12 device instead of Vulkan. The stage now writes gta6rt.cmd next to gta6rt.exe on Windows, the counterpart of gta6rt.sh: --dry-run, --init or --run on its own changes to the package in game_path.txt and starts gta6rt.exe on the manifest's expected_exe with --overlay <out>\overlay and LEONIDA_D3D12=vulkan unless set; it points LEONIDA_SHADERS at the moved catalog when the port folder moved with its work folder inside; any other arguments go to gta6rt.exe as given. cmd reads a batch file and set /p input in the console code page, so game_path.txt (UTF-8) and the names written into the script are read in code page 65001, which is then restored. The script is CRLF, as .gitattributes keeps *.cmd. The logged hint is now `& '<out>\gta6rt.cmd' --dry-run`, and README says how to start the port on Windows. Tests, synthetic only (no game files): - tests/test_make_game_platform.py: the generated gta6rt.cmd runs with a copy of cmd.exe standing in for gta6rt.exe, in a console of its own (OEM code page), with non-ASCII and & ( ) % ! in the game and port folders: argv, working directory, LEONIDA_* defaults and overrides, pass-through, a missing executable, a moved port and the exit code. A structural check (CRLF, no BOM, % doubled) runs on every platform; the first-load hint names the launcher. - runtime/test/check_packaged_launcher.py (CTest run_packaged_launcher, Windows hosts): the runtime stage installs the built gta6rt.exe and gta6rt_tls_host.dll with tiny_game.exe as the package's executable; gta6rt.cmd --dry-run and --init exit 0, and --run reports GAME: as the package, writes to <out>\overlay and returns the game's exit code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…icit "" Addresses the three findings of the Codex review of 0463ae1 (BUILD-2813): - P1, split --out/--work drives: windows_launcher() compared the shader folder with --out through os.path.commonpath, which raises ValueError for paths on different drives (the D: output / E: work layout), and runtime() had already opened gta6rt.cmd for writing. It now uses the existing path_is_within() helper (False across drives or UNC shares), and runtime() builds the launcher text before opening the file, so a failure leaves any previous gta6rt.cmd as it was. - P2, UNC package folders: cmd cannot make a UNC path its current directory with cd /d. The launcher enters the package with pushd, which maps a temporary drive letter for a UNC path, keeps the loader's exit code in rc, runs popd (also on the missing-executable path) and exits with rc. - P2, explicit empty second argument: %~2 is empty both without a second argument and with "". The launcher also checks "%2" for "", so `gta6rt.cmd --run "" --trace trace.jsonl` passes through to gta6rt.exe with its trace flags, as gta6rt.sh's "$#" -eq 1 does. Also: runtime() now checks that gta6rt.cmd is not a directory before copying anything on Windows, as it already did for gta6rt.sh elsewhere (the guard from ItsNotRexed#6734). Tests added to tests/test_make_game_platform.py (written, not run: the director postponed test runs): explicit "" passthrough and a UNC package via the administrative share (skipped when not reachable) in the executing Windows test; structural checks for pushd/popd and the empty second argument; --out and --work on different drives; a directory named gta6rt.cmd. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…commands Addresses the Codex re-review of 5008bc5 (BUILD-2813): - P1: the generated rem above the second-argument checks mentioned %~2 and "%2". cmd expands %-references before it recognizes rem, so a quoted second argument carrying &, | or > could be parsed as syntax on a line meant as a comment. The rem now names no argument; the explanation of the two checks moved into a Python comment in windows_launcher(). - P2: the structural test searched the whole generated text, so assertNotIn("cd /d") and text.index("popd") also matched the rem lines. It now splits the text into executable command lines (no rem lines, no labels), asserts that no rem line references an argument, that no command starts with cd, and that the loader command is followed exactly by set "rc=%ERRORLEVEL%", popd and exit /b %rc%. Not run (test runs are postponed by the director): the new assertions and the earlier ones. Checked: both files compile, and the generated text was inspected in-process (no argument references in rem lines, no cd command, the loader-return sequence as above, the explicit "" check present). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The moved-port LEONIDA_SHADERS fallback sat in the launcher's :package block, so it applied only to `gta6rt.cmd --dry-run|--init|--run` on their own. With any other arguments (passthrough), a port folder moved after the build left the runtime reading the stale absolute path in shader_path.txt, and the first compute PSO found no translated shaders. The fallback, with its own code-page 65001 window for the UTF-8 names, now runs right after `set "here=%~dp0"`, before the mode dispatch, and is removed from :package. It still applies only when the shaders are inside the port folder, the folder has moved, and LEONIDA_SHADERS is not already set; arguments pass through unchanged. A split-drive --work is unaffected (shader_path.txt keeps naming it). Test added to the executing Windows launcher test (written, not run: test runs are on hold): after the port moves, a passthrough run keeps its arguments and gets the moved shader folder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: BUILD-2813 (claim, pointer in #7694)
Depends on: none. It builds on
mainonly and branches from8575d36e. #7019 and #5278 edit the sameruntime()/ launcher code inmake_game.py, so whichever lands second may need a rebase.What and why
On Windows,
make_game.pywritesgame_path.txtinto the port folder, but nothing reads it. Onlygta6rt.sh, the Wine launcher, does.gta6rt.exestarted on its own prints usage and exits 2, so the port has no documented way to start on Windows.The runtime stage now also writes
<out>\gta6rt.cmd, the Windows counterpart ofgta6rt.sh:--dry-run,--initor--run): enters the folder named ingame_path.txtand runsgta6rt.exe <mode> .\<expected_exe> --overlay <out>\overlay. It setsLEONIDA_D3D12=vulkanunless that is already set.LEONIDA_SHADERSto the shader folder in its new location, unlessLEONIDA_SHADERSis already set. This happens before the mode check, so a run with extra launcher arguments finds the shaders too, instead of the stale absolute path inshader_path.txt. The runtime prefersLEONIDA_SHADERSovershader_path.txt(runtime/shims/d3d12_vulkan_device.cpp,configured_shader_directory()). A--workoutside the port folder (e.g. on another drive) is unaffected, becauseshader_path.txtkeeps naming it.gta6rt.exeunchanged. That includes an explicitly empty second argument, sogta6rt.cmd --run "" --trace t.jsonlpasses through, asgta6rt.sh's"$#" -eq 1does.gta6rt.execomes back.game_path.txtis read in code page 65001 and the console's code page is put back, so non-ASCII paths work.pushdand left withpopd, so a UNC package path works. The exit code is kept acrosspopd.%-references before it recognizesrem.--outand--workon different drives (e.g.D:/E:) are handled with the existingpath_is_within()helper. The launcher text is built beforegta6rt.cmdis opened, so a failure leaves any previous file intact.runtime()refuses a directory namedgta6rt.cmdbefore copying anything, as the make_game: Reject directories at runtime installation file paths #6734 guard does for the other outputs.Files:
make_game.py:windows_launcher(), plusruntime()and the logged hint.README.md: one paragraph on starting the port on Windows.tests/test_make_game_platform.pyruntime/CMakeLists.txtandruntime/test/check_packaged_launcher.py: a CTest,run_packaged_launcher, that runs the realgta6rtand thetiny_gamestand-in through the generated launcher.Tested
This head,
0481e346: no test was run. Test runs are on hold on our side until the game launches and runs stably. The last commit (258c6dba..0481e346) moves the moved-port shader fallback ahead of the mode check and adds a test for it. What was checked at this SHA:py_compileofmake_game.pyandtests/test_make_game_platform.py, andgit diff --check 8575d36e..0481e346.:package; the console's code page is restored before the mode check;--outonD:and--workonE:succeeds and has no moved-port line;remline references an argument;cd;set "rc=%ERRORLEVEL%",popd,exit /b %rc%;""check is a command.Not verified live:
pushd/popd);Tests for all three are included, not yet run: the UNC one uses
\\localhost\<drive>$when that share is reachable and skips otherwise.Not verified at all: a retail boot. We have no local copy of the game, so neither this launcher nor the shader lookup has run against the real executable here.
Earlier evidence, at
0463ae19(the same launcher before the review fixes, also on8575d36e). Platform: Windows 11, NVIDIA RTX 4070 (driver 621.24), clang-cl 23.1.5 + lld-link with the MSVC 14.44 CRT / Windows SDK 10.0.26100.run_packaged_launcher,run_tiny_game*andgta6rt_rejects_*: 14/14 pass.run_packaged_launcherused game and port folder names with non-ASCII characters and& ( ) % !.tests/test_make_game_*.pyandtests/test_docs_*.py: 427 pass, 4 skipped. 5 files fail identically on unmodified8575d36e:test_make_game_paths,test_make_game_resumeandtest_make_game_empty_translation(make_game: drive-root tests pass again after #6798 (BUILD-2367 follow-up) #6957);test_docs_cli_flagsandtest_docs_links(docs/dev-tools.md).make_game.pyonmain; with the code-page switch removed, the CTest fails.Each revision after
0463ae19went through an independent static code review by a second AI reviewer, which cleared this head.AI-assisted: yes (Claude Code; independent review by Codex)
Checklist
docs/design.md, with how it was confirmed. (not a translator change)🤖 Generated with Claude Code