Commit Graph
2 Commits
Author SHA1 Message Date
Michael Bolin 27ace641fe Replace the npm wrapper with the native binary using execve (#57513)
## Why

Replacing the Node process lets the native binary receive signals and report its termination directly.

## What changed

- Use `process.execve` on non-Windows platforms when available, preserving CLI arguments and the prepared environment.
- Install a `SIGXFSZ` handler before replacement so the native binary gets the default signal disposition instead of inheriting Node's ignored signal.
- Retain asynchronous spawning for Windows and older Node versions.

## Testing

Extend the exit-status test to check that `execve` leaves no child process and that `SIGHUP` and `SIGXFSZ` terminate it with the original signal, while retaining coverage for the spawn fallback.

GitOrigin-RevId: 7437f15af419fce5b10c1c00425c7d38160991fc
2026-10-27 16:55:48 +00:00
Dmitriy Kovalenko 9510f36df2 Preserve child signal failures in the npm wrapper (#57352)
## Why

The npm wrapper can exit successfully after its native child is terminated by a signal if Node ignores the re-emitted signal or a forwarding handler intercepts it.

## What changed

Set a fallback exit status of `128 + signal number` and remove listeners for the terminating signal before re-emitting it, preserving signal termination where supported.

## Testing

Add a non-Windows integration test using a built Codex binary to cover numeric argument-error exits, forwarded `SIGHUP` termination, and the fallback exit status for `SIGXFSZ`, which Node ignores by default.

GitOrigin-RevId: cad18a47aa50fd78517c367f8d8aae83bbbf7843
2026-10-27 04:39:05 +00:00