File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -302,6 +302,13 @@ class Reduce: ParsableCommand {
302302 /// Invoke `swift-parser-cli verify-round-trip` with the same arguments as this `reduce` subcommand.
303303 /// Returns the exit code of the invocation.
304304 private func runVerifyRoundTripInSeparateProcess( source: [ UInt8 ] ) throws -> ProcessExit {
305+ #if os(iOS) || os(tvOS) || os(watchOS)
306+ // We cannot launch a new process on iOS-like platforms.
307+ // Default to running verification in-process.
308+ // Honestly, this isn't very important because you can't launch swift-parser-cli
309+ // on iOS anyway but this fixes a compilation error of the pacakge on iOS.
310+ return try runVerifyRoundTripInCurrentProcess ( source: source) ? ProcessExit . success : ProcessExit . potentialCrash
311+ #else
305312 return try withTemporaryFile ( contents: source) { tempFileURL in
306313 let process = Process ( )
307314 process. executableURL = URL ( fileURLWithPath: ProcessInfo . processInfo. arguments [ 0 ] )
@@ -337,6 +344,7 @@ class Reduce: ParsableCommand {
337344 return . potentialCrash
338345 }
339346 }
347+ #endif
340348 }
341349
342350 /// Runs the `verify-round-trip` subcommand in process.
Original file line number Diff line number Diff line change 1010//
1111//===----------------------------------------------------------------------===//
1212
13- #if canImport(Darwin)
13+ #if canImport(Darwin) && !os(iOS) && !os(tvOS) && !os(watchOS)
1414import Darwin
1515import XCTest
1616
You can’t perform that action at this time.
0 commit comments