Save the build state before the source generation starts, so a generation cut short after it wrote layout.json runs again on the next try instead of being taken as done.

After Keep Build Cache removed the generated sources and the kit was updated, the lift ran because layout.json was
gone while its key still matched. An interruption after layout.json was back left the saved state calling the lift
complete, and the next run compiled unfinished sources. The pull request's two commits (one a merge of main) are
applied here as their net change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
DeepDaddyTTV
2026-11-10 19:19:00 -05:00
committed by chrg6
parent d991c04284
commit 87611f150c
2 changed files with 39 additions and 3 deletions

View File

@@ -2487,6 +2487,10 @@ def build_main():
for later in STEPS[STEPS.index(name):]:
if later == name or not ({name, later} & set(OWN_KEY_STEPS) or (name, later) in UNAFFECTED):
state['steps'].pop(later, None)
if name == 'lift':
# The generator writes layout.json before the sources. A retry must finish an interrupted lift
# even if the layout is back and the previous lift key still matches its inputs.
save()
say(f'{name}:')
emit('step', step=name, state='start')
if name in ('shaders', 'prompts', 'scan') and romfs_job: # they read the RomFS image