mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-19 04:15:57 +00:00
Merge task/verfix: the setup recompiles when the release changes, so the menu shows the installed version (#1078)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
13ff0d7b52
2 files changed
+18
-1
No files matched your search
+4
-1
@@ -1200,7 +1200,10 @@ class Compile(Step):
|
||||
id = 'compile'
|
||||
|
||||
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')
|
||||
|
||||
def current(self, ctx, record):
|
||||
|
||||
@@ -464,6 +464,20 @@ class LiftRunTest(unittest.TestCase):
|
||||
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):
|
||||
"""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."""
|
||||
|
||||
Reference in new issue
Block a user