The installer's plugin service run finds its DLLs: they go beside the totk.exe it builds in temp (#845)

On the release path the service run's totk.exe in <temp>/build stopped before main with 0xc0000135 (SDL3.dll not
found): the DLLs are copied next to totk.exe in the install folder only by the compile step, after the lift. Every
plugin was skipped with warn.plugins_skipped. The fake-tool tests did not see it; installer_test now checks the copy.
exefs_plugins_test covers run()'s hang and crash reasons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Valiantsin DzerakhandClaude Opus 5.5 committed 2026-11-17 09:52:37 +03:00
1 parent 77f34a05f5
commit 81c004094d
3 files changed
+26 -1

No files matched your search

+16
View File
@@ -13,6 +13,7 @@ import struct
import sys
import tempfile
import unittest
from types import SimpleNamespace
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
@@ -398,6 +399,7 @@ class PerPlugin(unittest.TestCase):
(self.d / 'patches.txt').write_text('set fps60 TOTK_FPS60 1\n')
self.runs = []
saved = xp.run, xp.hook_impls
self.real_run = xp.run
self.addCleanup(lambda: (setattr(xp, 'run', saved[0]), setattr(xp, 'hook_impls', saved[1])))
xp.run, xp.hook_impls = self.fake_run, lambda rec: IMPLS
@@ -444,6 +446,20 @@ class PerPlugin(unittest.TestCase):
self.assertNotIn(f'mod_{key["C"].lower()}', text)
self.assertIn((out / 'plugin0' / 'run1' / 'plugin0.img').resolve().as_posix(), text)
def test_run_reasons(self):
# the real run(): a hang becomes its own reason, a crash names the FATAL line
saved = xp.subprocess.run
self.addCleanup(setattr, xp.subprocess, 'run', saved)
def hang(cmd, **kw):
raise xp.subprocess.TimeoutExpired(cmd, kw['timeout'], output=b'started', stderr=None)
xp.subprocess.run = hang
self.assertEqual(self.real_run(None, self.d / 'h', 0, 7, 'plugin0'), (None, 'its init did not return within 7 s'))
xp.subprocess.run = lambda cmd, **kw: SimpleNamespace(returncode=0xC0000005, stdout='x\nFATAL: access violation '
'(0xc0000005) at host 1\n', stderr='')
code, why = self.real_run(None, self.d / 'c', 0, 7, 'plugin0')
self.assertEqual(why, 'its init crashed the service run: access violation (0xc0000005) at host 1')
def test_ran_view_leaves_out_plugins_that_did_not_run(self):
rec = record()
rec['modules'].append(dict(rec['modules'][2], name='plugin1', base=PLUGIN + 0x100000, ran=False))