Skip to content

[codex] honor child_process detached process groups#4295

Draft
andrewtdiz wants to merge 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-child-process-detached
Draft

[codex] honor child_process detached process groups#4295
andrewtdiz wants to merge 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-child-process-detached

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

Summary

  • add a child_process parity fixture for detached: true process-group behavior across spawn, spawnSync, and fork
  • wire options.detached === true into shared spawn/spawnSync command construction
  • apply the same detached setup to the fork command path before launching IPC-enabled children

Root Cause

Perry already exposed the documented child_process option surface, but the live and sync command builders ignored options.detached. On Unix, Node makes a detached child the leader of a new session and process group, so the child shell's process group ID should match its PID. Perry left children in the parent process group.

Validation

  • npm exec --yes --package=node@26 -- node --experimental-strip-types test-parity/node-suite/child_process/async/detached-process-group.ts
  • Baseline check before the fix: focused parity reported Node.js: spawn detached same pgid: true and Perry: spawn detached same pgid: false
  • npm exec --yes --package=node@26 -- bash -lc './run_parity_tests.sh --suite node-suite --module child_process --filter detached-process-group' (1 pass, 0 compile failures)
  • npm exec --yes --package=node@26 -- bash -lc './run_parity_tests.sh --suite node-suite --module child_process' (18 pass, 0 compile failures)
  • cargo fmt --all -- --check
  • git diff --check
  • ./scripts/check_file_size.sh

Covers the detached option slice of #2555.

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.

1 participant