Skip to content

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

Merged
wan9chi merged 1 commit into
mainfrom
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
wan9chi merged 1 commit into
mainfrom
01-19-fix_exit_with_non-zero_status_for_signal-terminated_processes

Conversation

@wan9chi

@wan9chi wan9chi commented Jan 19, 2026

Copy link
Copy Markdown
Member

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.

@wan9chi
wan9chi marked this pull request as ready for review January 19, 2026 10:11

wan9chi commented Jan 19, 2026

Copy link
Copy Markdown
Member Author

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

@wan9chi wan9chi mentioned this pull request Jan 19, 2026

wan9chi commented Jan 19, 2026

Copy link
Copy Markdown
Member Author

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.

@wan9chi
wan9chi 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
@wan9chi
wan9chi changed the base branch from graphite-base/118 to main January 19, 2026 10:19
@wan9chi
wan9chi 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
@wan9chi
wan9chi merged commit 348e914 into main Jan 19, 2026
5 of 6 checks passed
@wan9chi
wan9chi 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