We're using pipes incorrectly so the code can deadlock

#13 · open · 1 comments

View on GitHub ↗

dabrahams

This code is wrong: https://github.com/dabrahams/SPMBuildToolSupport/blob/c270d23a9c70aa015e09a9c0ea28e36d2801adc4/SPMBuildToolSupport.swift#L510-L516 The right thing to do is here: https://github.com/hylo-lang/gyb-swift/blob/5fe38a2ec40911c3e9a951ed405dbe7ee706ebe0/Sources/gyb-swift/ProcessUtilities.swift#L125-L158

Comments

dabrahams

It [appears](https://github.com/johnno1962/Popen/issues/1#issuecomment-3631420193) this can be solved much more simply by closing the output stream. We should be doing that.