Skip to content

fix(child_process): support stream-backed stdio#4401

Merged
proggeramlug merged 3 commits into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-child-process-stream-stdio
Jun 4, 2026
Merged

fix(child_process): support stream-backed stdio#4401
proggeramlug merged 3 commits into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-child-process-stream-stdio

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

Summary

  • Recognize opened fs.ReadStream/fs.WriteStream entries in child_process stdio arrays and route them through the existing fd-backed stdio path.
  • Preserve Node's fd-backed surface shape for these entries: child stdio properties and captured sync result slots become null while bytes go to the supplied files.
  • Add Node parity coverage for async spawn/fork and sync spawnSync/execSync/execFileSync stream-backed stdio.

Issue Cluster

Refs #2555.
Refs #2130.

This is batched as one slice because async spawn/fork and sync helpers share cp_read_stdio, and the implementation can reuse the existing fd routing path once fs stream objects are normalized to registered fds.

Validation

  • CARGO_TARGET_DIR=/tmp/perry-child-stream-stdio-check cargo check -p perry-runtime
  • cargo build -p perry-runtime -p perry --release
  • cargo fmt -p perry-runtime -- --check
  • git diff --check
  • git diff --cached --check
  • ./scripts/check_file_size.sh
  • jq empty test-parity/known_failures.json
  • PATH=/root/.npm/_npx/bac97da9607b7ef2/node_modules/node/bin:$PATH PERRY_NO_AUTO_OPTIMIZE=1 PERRY_NO_CACHE=1 ./run_parity_tests.sh --suite node-suite --module child_process --filter stdio-stream
  • Adjacent stdio filters: stdio-fd, stdio-ignore, stdio-inherit, spawn-sync-stdio, child_process/sync/sync-stdio
  • Full child_process parity module: 26 pass, 0 fail, 0 compile fail, 0 skipped

Note: cargo fmt --all -- --check currently reports an unrelated formatting diff in crates/perry-stdlib/src/webcrypto/jwk.rs:494; this PR keeps that file untouched and uses the package-scoped perry-runtime format check for the touched Rust code.

Non-Goals

@proggeramlug proggeramlug merged commit 283656d into PerryTS:main Jun 4, 2026
13 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