Skip to content

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

Merged
hckrman101 merged 1 commit into
NotRexed:mainfrom
jordanella:fix/compile-error-keeps-lift
Nov 12, 2026
Merged

hckrman101 merged 1 commit into
NotRexed:mainfrom
jordanella:fix/compile-error-keeps-lift

Conversation

@jordanella

Copy link
Copy Markdown
Contributor

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 0ec31ff 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

… game again

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) <noreply@anthropic.com>
dazemc added a commit to dazemc/Hookshot-rs that referenced this pull request Nov 12, 2026
Upstream NotRexed/Hookshot fixed four builder problems the fork shares, on
the path its Flutter builder and Rust engine use. Ported semantically,
with the Rust engine's own layout and failure handling:

- e7f5581: scripts/oot_saves.py finds Lichii's own data folder
  (~/.local/share/lichii, %APPDATA%\lichii) before Eden's, where a Lichii
  before build 150 still keeps its saves. `list` groups programs by the
  folder import and export use; the fork's `saves` list for the Flutter
  launcher follows the same rule, so Lichii is not offered from Eden's.
- 6c529a2: a Btrfs folder has a device number no disk has, so the hard
  drive warning could not tell; nx2/disk.py and builder/rust/src/disk.rs
  now read /proc/self/mountinfo for the deepest mount and every disk of a
  multi-disk Btrfs (/sys/fs/btrfs/<id>/devices).
- c544828 (+ NotRexed#2686, NotRexed#2675): the lift key is taken again after the lift
  and split_hot, from image/chunks.txt that the first lift writes, so a
  new work folder's second build no longer translates the game again; the
  new key is kept only when nothing else the lift reads changed while it
  ran. A compile that failed only in repository sources keeps the
  translation (a host typo no longer costs a lift); a lifted or generated
  file that failed still forgets it. The Rust driver never had a key but
  had no such distinction: compile failures now follow the same rule, a
  link failure forgets the lift, and a failed host source keeps it.
- a740d67: host_mtune()/host::mtune() detect a Steam Deck APU (0405 or
  0932) or RX_STEAMDECK=1 and add -mtune=znver2 beside -march, in
  nx2/build.py and the Rust driver's game and host compiles; RX_MTUNE
  names a tune. The fork's lift and host builds both get it.

Tests: the upstream ones adapted (test_oot_saves, test_disk_warning,
test_cpu_target, test_lift_cache, test_lift_cleanup_error), new
tests/test_failed_compile_keeps_lift.py, and Rust tests for the Btrfs
mount walk, the lift failure rule and the Zen 2 tune. No game files or
generated game data.

Assisted-by: opencode (DeepSeek V4.1 Flash 1017)

@Joey-Magnus Joey-Magnus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@hckrman101
hckrman101 merged commit be65433 into NotRexed:main Nov 12, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants