fix(build): a compile error in a source file no longer translates the game again #2675

Closed
github-sync wants to merge 1 commit from github/pr/2675 into main
Owner

@jordanella opened this pull request on GitHub · 2026-11-12 05:48 UTC · original
Merged on GitHub in be65433858

A one-line typo in a host file makes the next build translate the whole game again. On Windows, the build after a typo in host/hos_update.c took 301 s, 276 s of it the lift, against 26 s for a normal host edit.

Why the lift was forgotten

After a failed build, forget_failed_build drops the lift key for the cases in issues 1197 and 1176: a lifted file cut short, and lifted C left by another builder. Both fail in the translated game's own files. A compile error in a repository source isn't one of them.

Change

  • make_game.py now takes the files build.py could not compile, even alone, from its FAILED <name> (...) lines.
  • When every one is a repository source, forget_failed_build keeps the translation, and the next build compiles only the files not compiled yet. A repository source here means no lifted file (code_*) and nothing the lift or build.py writes (sa/gen, sa/build/rt64, sa/build/gen).
  • Everything else forgets the translation as before: a build stopped without such a line, a failure with a generated file among the failed files, and a failed link.
  • The message says which: the build failed in hos_update.c, not in the translated game: the next one keeps the translation and compiles only the files not compiled yet.

Testing

  • tests/test_failed_compile_keeps_objects.py: a repository source that failed keeps the translation. A lifted or generated file among the failed files (code_021.c, code_hot_3.c, hos_image.c in sa/gen, a64_rt.c in rt64) forgets it. The FAILED pattern matches build.py's own line, and not its first-try "not compiled yet" line. The new cases fail without the change, and all six pass with it.
  • End to end on Windows (Ryzen 9 3900X, NVMe, main at 0ec31ff6 plus this change): the typo build failed in 16 s with the new message, and the build after it, with the typo removed, took 21 s and skipped the lift. Without the change, that build took 301 s.
  • Full run_all.py on Windows: every check that reads make_game.py (52) passes, apart from test_cpp_preflight, test_linux_update and test_prepare_stall, which fail the same way on a clean main here, and test_lift_cache, which fails here only because of a space in the checkout's path (fixed in the lift-key PR).

Part of the dev-loop proposal (#2636, A7). Classifying link failures, the rest of A7, is left for later.

🤖 Generated with Claude Code

> [@jordanella](https://github.com/jordanella) opened this pull request on GitHub · 2026-11-12 05:48 UTC · [original](https://github.com/NotRexed/Hookshot/pull/2675) > **Merged on GitHub** in https://git.magicbean.dev/MagicBeanDev/Hookshot/commit/be6543385806eea85117c60e6af38e605874a19f A one-line typo in a host file makes the next build translate the whole game again. On Windows, the build after a typo in `host/hos_update.c` took 301 s, 276 s of it the lift, against 26 s for a normal host edit. ## Why the lift was forgotten After a failed build, `forget_failed_build` drops the lift key for the cases in issues 1197 and 1176: a lifted file cut short, and lifted C left by another builder. Both fail in the translated game's own files. A compile error in a repository source isn't one of them. ## Change - `make_game.py` now takes the files `build.py` could not compile, even alone, from its `FAILED <name> (...)` lines. - When every one is a repository source, `forget_failed_build` keeps the translation, and the next build compiles only the files not compiled yet. A repository source here means no lifted file (`code_*`) and nothing the lift or `build.py` writes (`sa/gen`, `sa/build/rt64`, `sa/build/gen`). - Everything else forgets the translation as before: a build stopped without such a line, a failure with a generated file among the failed files, and a failed link. - The message says which: `the build failed in hos_update.c, not in the translated game: the next one keeps the translation and compiles only the files not compiled yet`. ## Testing - **`tests/test_failed_compile_keeps_objects.py`:** a repository source that failed keeps the translation. A lifted or generated file among the failed files (`code_021.c`, `code_hot_3.c`, `hos_image.c` in `sa/gen`, `a64_rt.c` in `rt64`) forgets it. The `FAILED` pattern matches `build.py`'s own line, and not its first-try "not compiled yet" line. The new cases fail without the change, and all six pass with it. - **End to end on Windows** (Ryzen 9 3900X, NVMe, `main` at 0ec31ff6 plus this change): the typo build failed in 16 s with the new message, and the build after it, with the typo removed, took 21 s and skipped the lift. Without the change, that build took 301 s. - **Full `run_all.py` on Windows:** every check that reads `make_game.py` (52) passes, apart from `test_cpp_preflight`, `test_linux_update` and `test_prepare_stall`, which fail the same way on a clean `main` here, and `test_lift_cache`, which fails here only because of a space in the checkout's path (fixed in the lift-key PR). Part of the dev-loop proposal (#2636, A7). Classifying link failures, the rest of A7, is left for later. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- github-sync:item:2675 -->
A failed compile made the next build translate the whole game again, whatever failed: on Windows a one-line typo in
host/hos_update.c cost 301 s on the build after it, 276 s of them the lift, against 26 s for a normal host edit. The lift
is forgotten after a failure for the cases in issues 1197 and 1176, a lifted file cut short or lifted C another builder
left, and those fail in the translated game's own files.

make_game.py now takes the files build.py could not compile, alone too, from its "FAILED <name>" lines. When every one
is a source of the repository, not a lifted file (code_*) and none the lift or build.py writes (sa/gen, sa/build/rt64,
sa/build/gen), forget_failed_build keeps the translation, and the next build compiles only the files not compiled yet. A
build stopped without such a line, one with a generated file among them, and a failed link forget it as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Author
Owner

@Joey-Magnus approved on GitHub · 2026-11-12 14:33 UTC · original

I merged this into current main and ran tests/test_failed_compile_keeps_objects.py (passes) and run_all.py make_game lift failed build compile. The only failures were test_lift_cache (fails on main here too) and two Windows-only checks the name filter forced to run (test_portable_local_builder, test_precompile_compute_guard), which fail the same way on main. CI is green.

The classification is sound. build.py prints FAILED <basename> ( only for files that failed alone too (build.py:1281), and the regex doesn't match the earlier "not compiled yet" line. A failure in code_* or anything in sa/gen, sa/build/rt64 or sa/build/gen still forgets the lift (make_game.py:1675). A link failure still forgets it, since linked is checked first.

The one case I looked for: host sources compile with -I gen, so a cut-short lifted header could make host files fail. But the lifted chunks include the same headers and every file is compiled before build.py gives up, so a code_ name would be in the list and the lift is still forgotten. The 301 s to 21 s numbers come from your own Windows build log, which is the kind of measurement we want.

> [@Joey-Magnus](https://github.com/Joey-Magnus) approved on GitHub · 2026-11-12 14:33 UTC · [original](https://github.com/NotRexed/Hookshot/pull/2675#pullrequestreview-5876229759) I merged this into current main and ran tests/test_failed_compile_keeps_objects.py (passes) and `run_all.py make_game lift failed build compile`. The only failures were test_lift_cache (fails on main here too) and two Windows-only checks the name filter forced to run (test_portable_local_builder, test_precompile_compute_guard), which fail the same way on main. CI is green. The classification is sound. build.py prints `FAILED <basename> (` only for files that failed alone too (build.py:1281), and the regex doesn't match the earlier "not compiled yet" line. A failure in `code_*` or anything in sa/gen, sa/build/rt64 or sa/build/gen still forgets the lift (make_game.py:1675). A link failure still forgets it, since `linked` is checked first. The one case I looked for: host sources compile with `-I gen`, so a cut-short lifted header could make host files fail. But the lifted chunks include the same headers and every file is compiled before build.py gives up, so a `code_` name would be in the list and the lift is still forgotten. The 301 s to 21 s numbers come from your own Windows build log, which is the kind of measurement we want. <!-- github-sync:r:5876229759 -->
github-sync closed this pull request 2026-11-12 17:58:26 +00:00
Commenting is not possible because the repository is archived.
No description provided.