Repository navigation
fix(esp32): retry a framework library whose compiler was killed by a signal - #2103
Merged
Merged
Conversation
A killed compiler reached no verdict about the library: nothing was compiled and no diagnostic was written. The failure was still remembered in both negative caches (the build-dir `.lib.failed` marker and the persistent global framework-library cache), so every later build skipped that library and replayed the kill — a retry could never recover (#1628 ask 2, #1630). - `FbuildError::ProcessTerminated` carries a signal kill as its own kind (`is_signal_kill()`); an ordinary compiler error stays `BuildFailed`. The aggregator in `compile_library_link_inputs_gated` keeps the first error itself instead of flattening it to a string, which had erased the distinction before any caller could see it. - `FwLibsPlan::finish` records neither marker for a kill and says so in the log, so the next build recompiles.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A compiler killed by a signal never reaches a verdict about the source — it compiles nothing and writes no diagnostic. fbuild still remembered that failure in both negative caches, so every later build skipped the library and replayed the kill, and a retry could never recover. That is #1630's remaining item 3 (#1628 ask 2) on fbuild's own side: a cache-side invalidation rule.
Two places kept the memory:
<build>/fw_libs/.<lib>.failedframework-library-artifacts/<key>/failed/<lib>Both were written for any non-zero compile exit, and
FwLibsPlan::newconsults both before compiling. So one SIGKILL on a loaded host (or the daemon's containment, or the OOM killer) silently removed a framework library from every future build of every project sharing that key, with no way back except--clean-all.Change
FbuildError::ProcessTerminated { message, exit_code }(is_signal_kill()), produced bycompile_exit_errorwhenfbuild_core::termination::host_terminationrecognises the exit code (-9, or the shell form137that zccache forwards). An ordinary compiler error staysBuildFailed, so nothing about existing behaviour changes.compile_library_link_inputs_gatedcollected the first failure into anOption<String>; the kind was gone before any caller could see it. It now keeps theFbuildErrorand returns it (itsDisplayis unchanged, so the message is byte-identical).FwLibsPlan::finishrefuses to remember a kill — neither marker is written, and a WARN says the failure was not remembered so the next build retries.Receipts
soldr cargo test -p fbuild-build-esp --lib esp32::orchestrator— 102 passed / 0 failed, including the newsignal_killed_framework_lib_is_not_remembered_so_the_next_build_retries: a-9backend leaves no build-dir marker, leavescache.has_failedfalse, and the next build calls the backend again; the existing deterministic-failure test still shows both markers recorded and the second build skipping.soldr cargo test -p fbuild-library --lib— 367 passed / 0 failed / 9 ignored (new:a_signal_kill_is_a_termination_error_and_a_source_error_is_not).soldr cargo test -p fbuild-core --lib— 448 passed / 0 failed / 2 ignored.soldr cargo clippy -p fbuild-core -p fbuild-library -p fbuild-build-esp --all-targets --no-deps -- -D warnings— clean;cargo fmt --checkclean;cargo check --workspace --all-targets --exclude fbuild-python— clean (the new enum variant breaks no exhaustive match);ci/enforce_platform_boundary.py --print-totals— 44/43.Scope: this makes fbuild's own cache stop replaying a kill. It does not change what kills a compiler, and zccache's separate failure caching (and its 137-instead-of-the-child's-signal attribution, #1866) stays upstream.
#1630 stays open (remaining cells: root cause #1631 — already on main; zccache's own kill attribution; the embedded holder's under #1866).