From 495549c20d1e10ddcd0994162a211a1d96bb98fa Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 10:36:15 -0700 Subject: [PATCH] CLI: build emitters incrementally whenever framework sources are present A staged binary could predate a moved submodule and emit code for the old framework silently. Co-Authored-By: Claude Opus 5.5 (1M context) --- psxrecomp_cli.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/psxrecomp_cli.py b/psxrecomp_cli.py index b148a05c..c7a35fcd 100755 --- a/psxrecomp_cli.py +++ b/psxrecomp_cli.py @@ -409,12 +409,24 @@ def ensure_emitters( Generate & rebuild without a pre-staged setup-host SDK. """ if not force: + # With the framework's recompiler sources present, always run the + # (incremental) build: a binary that merely exists may predate the + # sources -- a submodule moved to another revision -- and would emit + # code for the old framework without a word (a hook site listed in + # game.toml silently missing). Ninja makes the up-to-date case cheap. + # Without sources (an SDK pack), the staged binaries are the only ones. try: - game, bios = find_emitters(project_root) - progress.log(f"Emitters ready: {game}, {bios}") - return game, bios + recompiler_source_dir(project_root) + have_sources = True except FileNotFoundError: - pass + have_sources = False + if not have_sources: + try: + game, bios = find_emitters(project_root) + progress.log(f"Emitters ready: {game}, {bios}") + return game, bios + except FileNotFoundError: + pass progress.phase( "emitters",