Draft
Conversation
Add test for stdio.wrap using child process streams
Explicitly close the wrapped stream for childA to receive EOF.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
#52776
Description
Enable
child_process.spawnSync()to accept wrapped libuv streams (stdio.wrap) as stdio targets (e.g. passing another child process’stdin), so synchronous spawns can participate in stream wiring the same wayspawn()does.This makes it possible to forward a
spawnSync()child’s output directly into an existing stream without creating intermediate pipes.Before
Passing an existing stream as a
spawnSync()stdio entry (thestdio.wrappath) would fail (e.g. rejected as invalid / not handled), preventing patterns like wiringspawnSync()output into another child process’stdin.After
spawnSync()supportsstdio.wrapby inheriting the provideduv_stream_tfor the requested fd, allowingspawnSync()output to be forwarded into an existing stream.Changes
src/spawn_sync.ccsrc/spawn_sync.htest/parallel/test-child-process-spawnsync.jsTest
test/parallel/test-child-process-spawnsync.jsspawnSync()stdio target and verifies data is forwarded correctly.