Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Sources/Basics/Concurrency/AsyncProcess.swift
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,8 @@ package final class AsyncProcess {

group.enter()
stdoutPipe.fileHandleForReading.readabilityHandler = { (fh: FileHandle) in
let data = (try? fh.read(upToCount: Int.max)) ?? Data()
// 4096 is default pipe buffer size so reading in that size seems most efficient and still get output as it available
let data = (try? fh.read(upToCount: 4096)) ?? Data()
if data.count == 0 {
stdoutPipe.fileHandleForReading.readabilityHandler = nil
group.leave()
Expand All @@ -532,7 +533,8 @@ package final class AsyncProcess {

group.enter()
stderrPipe.fileHandleForReading.readabilityHandler = { (fh: FileHandle) in
let data = (try? fh.read(upToCount: Int.max)) ?? Data()
// 4096 is default pipe buffer size so reading in that size seems most efficient and still get output as it available
let data = (try? fh.read(upToCount: 4096)) ?? Data()
if data.count == 0 {
stderrPipe.fileHandleForReading.readabilityHandler = nil
group.leave()
Expand Down
2 changes: 2 additions & 0 deletions Utilities/build-using-self
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ def main() -> None:
*global_args,
"--configuration",
args.config,
"--build-tests",
*ignore_args,
*args.additional_build_args.split(" ")
]
Expand All @@ -252,6 +253,7 @@ def main() -> None:
*global_args,
"--configuration",
args.config,
"--vv",
"--parallel",
"--scratch-path",
".test",
Expand Down