From 33c2a1ac63085371c3ae7a310d789f4a3bdd2969 Mon Sep 17 00:00:00 2001 From: m3rcury02 <74795556+m3rcury02@users.noreply.github.com> Date: Sun, 1 Nov 2026 16:03:41 +0530 Subject: [PATCH] Stop the Windows release on a translator older than its sources. make_release.py copied build/xlate as it found it, so a translator change reached no Windows release until someone rebuilt it by hand, and nothing failed when they did not: 0.2.1 and 0.2.8 shipped a translator from before the gather bias while the runtime logged that the bias was on. The Linux release builds its own. Co-Authored-By: Claude Opus 5.5 --- docs/building.md | 3 ++- tools/make_release.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/building.md b/docs/building.md index e63b60d3..9bb704b1 100644 --- a/docs/building.md +++ b/docs/building.md @@ -78,7 +78,8 @@ of them. .venv-py314\Scripts\python tools\extract.py ``` -4. Shader translator (once; no game files). This publishes `build\xlate\totk_xlate.exe`: +4. Shader translator (no game files; again after a change to its sources, and `tools\make_release.py` stops on an older + one). This publishes `build\xlate\totk_xlate.exe`: ```powershell .venv\Scripts\python tools\build_xlate.py diff --git a/tools/make_release.py b/tools/make_release.py index 4b9bf12f..8dd9f600 100644 --- a/tools/make_release.py +++ b/tools/make_release.py @@ -25,6 +25,8 @@ Both need one game version extracted and lifted first (tools/extract.py, recomp/ it, generated/v143, and for --prove its build/extracted/ (they are read, nothing is written to them). The runtime library reads only what both versions' layout.h share (MOD_COUNT, MOD_MAIN_BASE), so either serves. +A release also needs build/xlate built from the current sources (tools/build_xlate.py); the script stops first if not. + The folder contains nothing derived from the game: check_content runs over it before the script finishes. Then the folder's own python runs a check-only installer pass (no game files: it must get through the release, toolchain and host checks and stop at the missing game files) and the window's --selftest. @@ -45,6 +47,7 @@ import zipfile from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parent)) +import build_xlate # noqa: E402 import check_content # noqa: E402 import shader_list # noqa: E402 @@ -293,6 +296,17 @@ def build_llvm(out): # ---- bin/ and deps --------------------------------------------------------------------------------------------------- +def check_translator(): + """Stop on a translator older than the sources. build/xlate is built by hand and only copied here (the Linux release + builds its own), so without a rebuild a translator change reaches no Windows release, and nothing fails: the runtime + sends job fields the old exe ignores, as happened to gather_bias.""" + idf = MAIN_ROOT / 'build' / 'xlate' / 'totk_xlate.id' + have = idf.read_text(encoding='ascii').strip() if idf.is_file() else 'none' + want = build_xlate.identity() + if have != want: + sys.exit(f'build/xlate has translator {have[:16]}, the sources are {want[:16]}: run tools/build_xlate.py') + + def build_bin(out): b = out / 'bin' b.mkdir(parents=True, exist_ok=True) @@ -545,6 +559,7 @@ def main(): if args.prove: prove(out, args.cpu) return + check_translator() if out.exists(): shutil.rmtree(out) out.mkdir(parents=True)