Skip to main content

exit_code_for

Function exit_code_for 

Source
pub fn exit_code_for(
    outcome: &RunGraphOutcome,
    signal: Option<CancellationSignal>,
) -> i32
Expand description

Compute the process exit code for a finished RunGraphOutcome per EXEC-021.

  • signal: Some(_) ALWAYS wins: returns 128 + signal.posix_number() (130 for SIGINT, 143 for SIGTERM). The user’s cancellation intent dominates any concurrent task failure (POSIX convention).
  • Otherwise, returns EXIT_TASK_FAILURE when any of the following holds:
  • Otherwise, returns 0.

See the module-level documentation for the design rationale, particularly around Skipped and Cancelled entries not being independent failure indicators.