Skip to content

fix: exit with non-zero status for signal-terminated processes#118

Merged
branchseer merged 1 commit intomainfrom
01-19-fix_exit_with_non-zero_status_for_signal-terminated_processes
Jan 19, 2026
Merged

fix: exit with non-zero status for signal-terminated processes#118
branchseer merged 1 commit intomainfrom
01-19-fix_exit_with_non-zero_status_for_signal-terminated_processes

Conversation

@branchseer
Copy link
Copy Markdown
Member

@branchseer branchseer commented Jan 19, 2026

TL;DR

Improve exit status handling for processes terminated by signals on Unix systems.

What changed?

  • Added exit_status_to_code() function to properly handle processes terminated by signals on Unix systems, following the convention of returning 128 + signal number
  • Changed ExecutionEventKind::Finish to use ExitStatus instead of i32 to preserve signal information
  • Updated the reporter to handle the new exit status format and properly display exit codes
  • Fixed execution context to pass None for status when no process was spawned (cache hit or in-process execution)
  • Added e2e tests for signal-terminated processes on Unix platforms

How to test?

Run the new e2e test on a Unix system:

cd crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit
vite run abort

This should show a process terminated with exit code 134 (128 + 6 for SIGABRT).

Why make this change?

Previously, when a process was terminated by a signal on Unix systems, the exit code information was lost. This change ensures that signal terminations are properly reported with the standard convention of 128 + signal number, providing more accurate information about process failures.

@branchseer branchseer marked this pull request as ready for review January 19, 2026 10:11
Copy link
Copy Markdown
Member Author

branchseer commented Jan 19, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Copy Markdown
Member Author

branchseer commented Jan 19, 2026

Merge activity

  • Jan 19, 10:19 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jan 19, 10:20 AM UTC: Graphite rebased this pull request as part of a merge.
  • Jan 19, 10:21 AM UTC: @branchseer merged this pull request with Graphite.

@branchseer branchseer changed the base branch from 01-15-_docs_update_claude.md_with_accurate_cli_usage_and_project_guidance to graphite-base/118 January 19, 2026 10:19
@branchseer branchseer changed the base branch from graphite-base/118 to main January 19, 2026 10:19
@branchseer branchseer force-pushed the 01-19-fix_exit_with_non-zero_status_for_signal-terminated_processes branch from 800039b to b8b3df9 Compare January 19, 2026 10:20
@branchseer branchseer merged commit 348e914 into main Jan 19, 2026
5 of 6 checks passed
@branchseer branchseer deleted the 01-19-fix_exit_with_non-zero_status_for_signal-terminated_processes branch January 19, 2026 10:21
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