Skip to content

Commit 95a15a9

Browse files
committed
Treat stderr from XCbuild that shouldn't lead to build failure as warnings instaed of errors in SwiftPM
1 parent be4822e commit 95a15a9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Sources/XCBuildSupport/XcodeBuildSystem.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,13 @@ public final class XcodeBuildSystem: SPMBuildCore.BuildSystem {
104104
arguments += buildParameters.xcbuildFlags
105105

106106
let delegate = createBuildDelegate()
107+
107108
let redirection: Process.OutputRedirection = .stream(stdout: delegate.parse(bytes:), stderr: { bytes in
108-
self.diagnostics.emit(StringError(String(bytes: bytes, encoding: .utf8)!))
109+
if let str = String(bytes: bytes, encoding: .utf8) {
110+
self.diagnostics.emit(warning: str)
111+
}
109112
})
110-
113+
111114
let process = Process(arguments: arguments, outputRedirection: redirection)
112115
try process.launch()
113116
let result = try process.waitUntilExit()

0 commit comments

Comments
 (0)