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 {
302
302
/// Invoke `swift-parser-cli verify-round-trip` with the same arguments as this `reduce` subcommand.
303
303
/// Returns the exit code of the invocation.
304
304
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
305
312
return try withTemporaryFile ( contents: source) { tempFileURL in
306
313
let process = Process ( )
307
314
process. executableURL = URL ( fileURLWithPath: ProcessInfo . processInfo. arguments [ 0 ] )
@@ -337,6 +344,7 @@ class Reduce: ParsableCommand {
337
344
return . potentialCrash
338
345
}
339
346
}
347
+ #endif
340
348
}
341
349
342
350
/// Runs the `verify-round-trip` subcommand in process.
Original file line number Diff line number Diff line change 10
10
//
11
11
//===----------------------------------------------------------------------===//
12
12
13
- #if canImport(Darwin)
13
+ #if canImport(Darwin) && !os(iOS) && !os(tvOS) && !os(watchOS)
14
14
import Darwin
15
15
import XCTest
16
16
You can’t perform that action at this time.
0 commit comments