 ///   - arguments: A list of strings to pass to the process as arguments.
 /// - Returns: A ProcessResult containing stdout, stderr, and the exit code.
 func run(_ executable: URL, arguments: [String] = []) -> ProcessResult {
+#if _runtime(_ObjC)
   // Use an autoreleasepool to prevent memory- and file-descriptor leaks.
-  return autoreleasepool {
-    () -> ProcessResult in
-    
-    let stdoutPipe = Pipe()
-    var stdoutData = Data()
-    stdoutPipe.fileHandleForReading.readabilityHandler = { file in
-      stdoutData.append(file.availableData)
-    }
-    
-    let stderrPipe = Pipe()
-    var stderrData = Data()
-    stderrPipe.fileHandleForReading.readabilityHandler = { file in
-      stderrData.append(file.availableData)
-    }
-    
-    let process = Process()
-    
-    process.terminationHandler = { process in
-      stdoutPipe.fileHandleForReading.readabilityHandler = nil
-      stderrPipe.fileHandleForReading.readabilityHandler = nil
-    }
-    
-    process.launchPath = executable.path
-    process.arguments = arguments
-    process.standardOutput = stdoutPipe
-    process.standardError = stderrPipe
-    process.launch()
-    process.waitUntilExit()
-    return ProcessResult(exitCode: Int(process.terminationStatus),
-                         stdoutData: stdoutData,
-                         stderrData: stderrData)
-  }
+  return autoreleasepool { () -> ProcessResult in
+    runCore(executable, arguments)
+  }
+#else
+  return runCore(executable, arguments)
+#endif
 }
 
 /// Finds the dylib or executable which the provided address falls in.

  ///           - lib/
  ///             - swift/
  ///               - ${target}/
  ///                 - libswiftSwiftSyntax.[dylib|so]
  ///         ```
  static func locateSwiftc() -> URL? {
    guard let libraryPath = findFirstObjectFile() else { return nil }
    let swiftcURL = libraryPath.deletingLastPathComponent()
                               .deletingLastPathComponent()
                               .deletingLastPathComponent()
                               .deletingLastPathComponent()
                               .appendingPathComponent("bin")
                               .appendingPathComponent("swiftc")
    guard FileManager.default.fileExists(atPath: swiftcURL.path) else {
      return nil
    }

  var wasSuccessful: Bool {
    return exitCode == 0
  }
}

internal func runCore(_ executable: URL, _ arguments: [String] = [])
    -> ProcessResult {
  let stdoutPipe = Pipe()
  var stdoutData = Data()
  stdoutPipe.fileHandleForReading.readabilityHandler = { file in
    stdoutData.append(file.availableData)
  }

  let stderrPipe = Pipe()
  var stderrData = Data()
  stderrPipe.fileHandleForReading.readabilityHandler = { file in
    stderrData.append(file.availableData)
  }

  let process = Process()
  process.terminationHandler = { process in
    stdoutPipe.fileHandleForReading.readabilityHandler = nil
    stderrPipe.fileHandleForReading.readabilityHandler = nil
  }
  process.launchPath = executable.path
  process.arguments = arguments
  process.standardOutput = stdoutPipe
  process.standardError = stderrPipe
  process.launch()
  process.waitUntilExit()

  return ProcessResult(exitCode: Int(process.terminationStatus),
                       stdoutData: stdoutData,
                       stderrData: stderrData)
}

/// Runs the provided executable with the provided arguments and returns the
