swiftlang / swiftlang/swift-subprocess
[Feature] Support for synchronous use.
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 734
- Forks
- 68
- Avg merge
- 9d 2h
- Merged PRs (30d)
- 6
Description
I learned recently if you Foundation.Process.waitUntilExit without first draining the standard output and error streams the system can deadlock, because it refuses to allow more data to be streamed out of the child process when its output buffers become full. I don't see any code for handling that situation here.
Here's an example of how it's done. The number of examples of doing this wrong out there are astounding. I know the new hotness is to await everything but I have synchronous code that really does need to block until another process completes, and I'd rather use an off-the-shelf package than repeat my own code. It would be great if this package could provide an answer for these situations, but I don't see one.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the package's existing process-spawning and stream-handling APIs, then compare them with the linked ProcessUtilities.swift example. Define the synchronous use case around Foundation.Process.waitUntilExit and verify that stdout and stderr are drained without deadlock. Done means callers can block until completion while safely consuming both output streams.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100