diff --git a/installer/steps.py b/installer/steps.py index 3d16825e..69a12e55 100644 --- a/installer/steps.py +++ b/installer/steps.py @@ -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): diff --git a/tests/installer_test.py b/tests/installer_test.py index ae5c2685..d7b3243b 100644 --- a/tests/installer_test.py +++ b/tests/installer_test.py @@ -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."""