mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-25 14:05:57 +00:00
The setup's builds name every path relative to the build kit, so a moved game folder rebuilds incrementally (#845)
tools/build_game.py --portable writes build.ninja paths on the tools' drive relative to the kit, also through '..' (the generated C and objects in build-cache/work), names the compiler, windres and ar the same way (backslashes: CreateProcess does not find a relative program with forward slashes), and passes clang -resource-dir and --sysroot relative to the kit, because clang names its own headers by its absolute folder whatever argv[0] says. The Ninja deps log then holds no absolute path. installer/steps.py build_args passes --portable for the build kit. Measured on an install moved after a portable build: the rebuild compiled modules.c only, 3.5 s; before, the move cost a full compile of 430 objects (335 s on 12 cores). Without --portable build.ninja is byte-identical to before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8c9c18a6d2
commit
e7c901b864
5 files changed
+61
-13
No files matched your search
+11
-2
@@ -327,7 +327,7 @@ class LiftRunTest(unittest.TestCase):
|
||||
self.dest, temp = base / 'install', base / 'temp'
|
||||
self.dest.mkdir()
|
||||
temp.mkdir()
|
||||
layout = SimpleNamespace(recomp=ROOT / 'recomp', tools=ROOT / 'tools',
|
||||
layout = SimpleNamespace(dev=True, recomp=ROOT / 'recomp', tools=ROOT / 'tools',
|
||||
patches=lambda version: base / 'patches-v143.txt')
|
||||
self.ctx = SimpleNamespace(dest=self.dest, temp=temp, layout=layout, keys={'lift': 'k'},
|
||||
state={'version': '1.4.3'}, reporter=Reporter(out=io.StringIO()))
|
||||
@@ -478,7 +478,7 @@ class CompileLockedTest(unittest.TestCase):
|
||||
dest, temp = base / 'install', base / 'temp'
|
||||
dest.mkdir()
|
||||
temp.mkdir()
|
||||
layout = SimpleNamespace(tools=ROOT / 'tools', llvm=base / 'llvm', deps=None, sysroot=None, runtime=base,
|
||||
layout = SimpleNamespace(dev=True, tools=ROOT / 'tools', llvm=base / 'llvm', deps=None, sysroot=None, runtime=base,
|
||||
ninja=base / 'ninja', dlls=[], runtime_lib_for=lambda cpu: None,
|
||||
pgo=lambda version: None, expected=lambda version: base / 'expected.json')
|
||||
self.ctx = SimpleNamespace(dest=dest, temp=temp, layout=layout, state={'version': '1.4.3'},
|
||||
@@ -715,6 +715,15 @@ class KitTest(unittest.TestCase):
|
||||
'build-kit', '--root', 'build-kit', '--rebuild', '.'])
|
||||
self.assertFalse(any(str(self.dest) in a or str(self.setup) in a for a in cmd))
|
||||
|
||||
def test_the_kits_builds_are_portable(self):
|
||||
ctx, _ = self.install()
|
||||
ctx.temp, ctx.state = self.dest / 'build-cache' / 'work', {'version': '1.4.3'}
|
||||
self.assertIn('--portable', steps.build_args(ctx, ctx.temp / 'gen'))
|
||||
ctx.layout = Layout(root=ROOT, dev=True, release='x', python=Path('python'), tools=Path('tools'),
|
||||
recomp=Path('recomp'), llvm=Path('llvm'), deps=None, runtime=Path('rt'),
|
||||
runtime_lib=Path('lib'), ninja=Path('ninja'), hactool=Path('hactool'), xlate=Path('xlate'))
|
||||
self.assertNotIn('--portable', steps.build_args(ctx, ctx.temp / 'gen'))
|
||||
|
||||
def test_dev_mode_has_no_kit(self):
|
||||
ctx = self.ctx(SimpleNamespace(dev=True, release='x', root=ROOT))
|
||||
kit = steps.Kit()
|
||||
|
||||
Reference in new issue
Block a user