Merge pull request #358: Stop the Windows release on a translator older than its sources (m3rcury02)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Valiantsin DzerakhandClaude Opus 5.5 committed 2026-11-01 17:50:59 +03:00
commit a6c2c1b2e1
2 files changed
+17 -1

No files matched your search

+2 -1
View File
@@ -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
+15
View File
@@ -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/<version> (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)