child_process: spawnSync option stdio stdout support stream#62386
Open
Tseian wants to merge 1 commit intonodejs:mainfrom
Open
child_process: spawnSync option stdio stdout support stream#62386Tseian wants to merge 1 commit intonodejs:mainfrom
Tseian wants to merge 1 commit intonodejs:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #62386 +/- ##
==========================================
+ Coverage 89.67% 89.68% +0.01%
==========================================
Files 676 676
Lines 206693 206726 +33
Branches 39576 39588 +12
==========================================
+ Hits 185346 185402 +56
+ Misses 13482 13447 -35
- Partials 7865 7877 +12
🚀 New features to boost your workflow:
|
286838f to
d6d04a9
Compare
d6d04a9 to
92209f8
Compare
92209f8 to
79576d8
Compare
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.