Repository navigation
fix(build-engine): name the signal when the cache kills a compiler - #2255
Merged
Merged
Conversation
…1630) zccache encodes a signal kill as -(128+signal) (SIGKILL -> -137); termination() read every negative code as -signal, and the parallel compile report dropped the exit code entirely. Recognise the negated shell convention and append the kill line to the failure message.
Closed
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.
Name the signal when the compile cache kills a compiler
What was wrong
The embedded compile cache (zccache) encodes a Unix signal kill as
-(128 + signal)—zccache'splatform::process::exitsetsexit_code = -128 - signal, so a SIGKILL'd compiler reaches fbuild as-137, not-9.fbuild_core::termination::termination()read every negative code as the plain-signalform, so-137became "signal 137". Worse, the parallel compile loopnever asked at all: a failed compile was reported as
with the exit code dropped entirely — which is why a watchdog kill (fbuild#1630
cell 2, "zccache reports 137 rather than the child's true signal") looked like a
silent source failure.
What changed (additive)
fbuild_core::termination:termination()now recognises the thirdconvention,
-(128 + signal), mapping-137->SIGKILL (signal 9). TheTerminationstruct gainsnegated_shell_codeandlog_line()names theconvention.
-signaland128 + signalare unchanged; Windows still answersNone(no signal number exists there).fbuild_build_engine::parallel: the failure report is built bycompile_failure_message(), which appends the signal kill line(
was killed by SIGKILL (signal 9) — …not a source or compiler error…) whenthe exit code classifies as a kill. An ordinary
exit code 1failure withrustc diagnostics is byte-identical to before.
Tests (RED first)
termination::tests::negated_shell_codes_name_the_true_signalanda_negated_shell_code_is_still_a_kill_on_windows— failed to compile beforethe field existed.
parallel::tests::a_killed_compile_names_the_signalandan_ordinary_compile_failure_is_unchanged.cargo clippy -p fbuild-core -p fbuild-build-engine --all-targets -- -D warningsclean;
cargo fmtapplied.Scope
Client-side reporting only — the kill itself was fixed upstream (zccache 1.15.22
flush guard + 1.15.23 no-abort lock watchdog, pinned here by #2254; #1866 is
closed). #1630 stays open for the upstream failure-caching half.