Commit Graph

11 Commits

Author SHA1 Message Date
302f925cc3 make_game: a redirected console must not kill --find on an un-encodable path
Windows encodes a redirected stdout (make_game.py > build.log) with the console's ANSI code page, and
`python -I` ignores PYTHONUTF8, so when a found dump's path holds a character outside that code page (a
Cyrillic, Greek or CJK user name in the profile it sits under), print() raised UnicodeEncodeError and
--find / auto-discovery ended in a traceback. stderr escapes such characters (backslashreplace); stdout
was strict. cli() now reconfigures stdout with errors="replace", so the listing prints '?' where the
code page has no glyph. Interactive consoles already write Unicode and are unaffected.

The regression test runs the real `make_game.py --find` as a child process over a synthetic dump (empty
probe files with the manifest sizes, no game data) under a private-use character no ANSI code page maps:
fails before the fix on every Windows locale, passes after, and passes on UTF-8 systems either way.
2026-11-22 03:08:37 -08:00
204989e9e7 make_game: --jobs reaches the Ogg Opus step; --runtime-build may be the output folder
- assets: awc_opus.py was started without --jobs, so with --jobs 1 the bank export still ran half the CPU count
  of processes (audio_wav.py, the next step, did get it).
- runtime: with --runtime-build pointing at the output folder (a runtime build unpacked where the port goes),
  shutil.copy2 raised SameFileError and the stage stopped before game_path.txt and the launcher were written.
  A file that is already the destination is left as it is.

Tests: one in test_make_game_argparse.py and three in test_make_game_platform.py; one of each fails on the old
code.
2026-11-22 10:00:48 +00:00
a65a039cfd make_game.py: pass the versioned LLVM tools to CMake as full paths
CMake keeps the archiver and resource compiler given on the command line as
bare names (CMAKE_AR=llvm-lib-23), so a build folder configured from a
versioned set still needed those names on PATH: once a static library had to
be archived again, the runtime stage failed. The overrides are now the
resolved paths, so every entry in the cache is absolute.
2026-11-22 02:36:02 -07:00
961792cd8e make_game.py: read the cross-build's tools from CMake's compiler files
CMake keeps a toolchain-chosen compiler in CMakeFiles/<version>/
CMakeCXXCompiler.cmake, not in CMakeCache.txt, so every runtime/build/windows
configured with the plain names went unrecognised: with only a versioned set
left on PATH, preflight passed and the build failed after the long stages.
Preflight now reads the configured tools from those files and requires each
to resolve, else it says to restore them or delete the folder.

The plain names win only when their clang-cl is 19 or newer, so an old default
no longer hides a complete newer versioned set. A mixed set names the missing
versioned tool. The overrides go to every configure until the folder records
its tools, which also covers a folder whose first configure failed.
2026-11-22 02:34:50 -07:00
5e9f17c6b3 make_game.py: accept versioned LLVM tools for the Linux cross-build
Distributions that install LLVM as clang-cl-21, lld-link-21 and so on (Debian,
Ubuntu) were reported as having none of the five tools, so the runtime stage
was dropped or refused. Preflight now accepts the newest full set with one
version suffix and passes it to a new build folder as the toolchain's
CMAKE_<var> overrides (docs/testing.md). A runtime/build/windows whose cached
compiler still exists needs no tools on PATH: it keeps what it was configured
with.
2026-11-22 02:27:17 -07:00
273886db50 make_game.py: build the runtime stage on Linux with clang-cl and xwin
Off Windows the runtime stage refused to run without --runtime-build. It now
cross-builds gta6rt.exe and gta6rt_tls_host.dll into runtime/build/windows
with runtime/cmake/clang-cl-xwin.cmake (XWIN_DIR, or ~/.local/share/xwin-sdk
as in docs/testing.md), then packages them with the Wine launcher as before.

Preflight lists what the cross-build lacks (cmake, the LLVM tools, clang-cl
older than 19, an xwin splat without VC/Tools/MSVC or Windows Kits um/x64)
and then configures it, so any toolchain error stops the run before the
shader stage. Without the tools the default stages still leave runtime out;
asking for it lists what is missing. The pipelines stage's vk_pipeline_check
is built natively into runtime/build/linux at the end of preflight, for the
same reason.
2026-11-22 01:36:05 -07:00
05afb6ff82 tests/test_make_game_platform: mock sys.version_info in RuntimeBuildPreflightTest
RuntimeBuildPreflightTest::test_runtime_off_windows_passes_with_a_complete_build
errored under Python 3.11.9 because make_game.preflight checks
sys.version_info < (3, 12) and RuntimeBuildPreflightTest.preflight did not
patch it. Also assert the missing-TLS-host failure names
gta6rt_tls_host.dll.

AI-assisted
2026-11-22 06:48:10 +00:00
6eaf8b6fa8 make_game: runtime stage on Linux with --runtime-build and a Wine launcher
--runtime-build DIR takes a Windows build of runtime/ (gta6rt.exe and
gta6rt_tls_host.dll, e.g. the Runtime workflow's runtime-windows
artifact) instead of building it. Off Windows the runtime stage then
runs instead of failing: it copies both files into --out and writes
gta6rt.sh, which starts gta6rt.exe with wine (or $WINE). Without the
option nothing changes. Preflight checks the folder before any work.
README: Running the loader on Linux.
2026-11-22 02:39:10 +00:00
f951282368 Build: package the runtime TLS host DLL 2026-11-22 02:39:44 +01:00
f74528bc64 Honor explicitly requested build stages on Linux 2026-11-21 20:43:13 -03:00
c73e25f4b7 make_game.py on Linux: leave the Windows-only runtime stage out by default, refuse it up front, find the Linux vk_pipeline_check
- Without --stages, runtime (Windows only for now) is left out off Windows.
  Before, the default build ran shaders and assets (hours) and then failed
  in runtime, so pipelines never ran.
- Asked for explicitly off Windows, preflight() refuses it before any work.
- pipelines finds vk_pipeline_check where CMake builds it off Windows
  (runtime/build/linux as in the README, or runtime/build as in
  CONTRIBUTING.md) instead of only vk_pipeline_check.exe, and says how to
  build it when it is missing. Windows is unchanged.
- tests/test_make_game_platform.py (9 tests, 6 fail before this change);
  test_make_game_preflight.py's all-tools test asks for runtime only on
  Windows, since it is now refused elsewhere.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 22:48:41 +01:00