The setup's compile step runs again when the release string changes, so totk.exe carries the version of the release that built it (#1078)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Valiantsin DzerakhandClaude Opus 5.5 committed 2026-11-18 13:32:47 +03:00
1 parent 44450a15a0
commit cedc0a63ad
2 files changed
+18 -1

No files matched your search

+4 -1
View File
@@ -1200,7 +1200,10 @@ class Compile(Step):
id = 'compile' id = 'compile'
def key(self, ctx): def key(self, ctx):
return fingerprint('compile-3', ctx.keys['lift'], runtime_key(ctx), # The release string too: build_game.py bakes the VERSION of the tools' folder into totk.exe (the menu's title
# line), and a release that leaves the lift and the runtime alone would otherwise keep the old exe and its
# old version.
return fingerprint('compile-4', ctx.keys['lift'], runtime_key(ctx), ctx.layout.release,
ctx.layout.pgo(game_version(ctx)) or 'no profile') ctx.layout.pgo(game_version(ctx)) or 'no profile')
def current(self, ctx, record): def current(self, ctx, record):
+14
View File
@@ -464,6 +464,20 @@ class LiftRunTest(unittest.TestCase):
self.assertIn('warn.plugins_skipped', self.ctx.reporter.out.getvalue()) self.assertIn('warn.plugins_skipped', self.ctx.reporter.out.getvalue())
class CompileKeyTest(unittest.TestCase):
"""The compile key follows the release string: the exe carries the port version of the release that built it."""
def key(self, release):
layout = SimpleNamespace(release=release, pgo=lambda version: None)
ctx = SimpleNamespace(layout=layout, keys={'lift': 'L'}, state={'version': '1.4.3'})
with mock.patch.object(steps, 'runtime_key', return_value='R'):
return steps.Compile().key(ctx)
def test_new_release_compiles_again(self):
self.assertEqual(self.key('0.4.2+abc'), self.key('0.4.2+abc'))
self.assertNotEqual(self.key('0.4.2+abc'), self.key('0.4.3+def'))
class CompileLockedTest(unittest.TestCase): class CompileLockedTest(unittest.TestCase):
"""Compile.run when the linker cannot write its totk.exe: another program holds the file (a game started from the """Compile.run when the linker cannot write its totk.exe: another program holds the file (a game started from the
temp build folder, an antivirus that quarantined it), which gets its own message instead of the plain failure.""" temp build folder, an antivirus that quarantined it), which gets its own message instead of the plain failure."""