Skip to content

[codex] honor child_process numeric stdio fds#4284

Merged
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-child-process-stdio-fd
Jun 4, 2026
Merged

[codex] honor child_process numeric stdio fds#4284
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-child-process-stdio-fd

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

Summary

This adds live child_process support for numeric fd entries in spawn() and fork() stdio arrays. Valid fd entries are routed to duplicated parent file descriptors, while the JS-visible stdin/stdout/stderr properties and child.stdio[] slots match Node by exposing null for those entries.

The change also parses array stdio forms before string forms so mixed arrays such as ["ignore", outFd, errFd] are not accidentally interpreted as strings, and keeps fork IPC behavior intact for ["ignore", outFd, errFd, "ipc"].

Non-goals for this slice: custom stream handles, invalid-fd validation/error shape, sync stdio fd forms, numeric stdin coverage, AbortSignal/killSignal timeout behavior, uid/gid, detached/platform flags, and broad option validation.

Validation

  • npm exec --yes --package=node@26 -- node --experimental-strip-types test-parity/node-suite/child_process/async/stdio-fd.ts
  • PERRY_NO_AUTO_OPTIMIZE=1 npm exec --yes --package=node@26 -- bash -lc './run_parity_tests.sh --suite node-suite --module child_process --filter stdio-fd'
  • PERRY_NO_AUTO_OPTIMIZE=1 npm exec --yes --package=node@26 -- bash -lc './run_parity_tests.sh --suite node-suite --module child_process --filter stdio-ignore'
  • PERRY_NO_AUTO_OPTIMIZE=1 npm exec --yes --package=node@26 -- bash -lc './run_parity_tests.sh --suite node-suite --module child_process --filter stdio-inherit'
  • PERRY_NO_AUTO_OPTIMIZE=1 npm exec --yes --package=node@26 -- bash -lc './run_parity_tests.sh --suite node-suite --module child_process' (18/18)
  • cargo fmt --all -- --check
  • git diff --check
  • ./scripts/check_file_size.sh
  • CARGO_TARGET_DIR=/tmp/perry-child-stdio-fd-check cargo check -p perry-runtime (passes with existing warnings)

@proggeramlug proggeramlug force-pushed the codex/node-compat-child-process-stdio-fd branch from 9bbacf6 to 3824ca0 Compare June 4, 2026 11:52
@proggeramlug proggeramlug marked this pull request as ready for review June 4, 2026 11:52
@proggeramlug proggeramlug merged commit 8d04cc0 into PerryTS:main Jun 4, 2026
12 checks passed
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