From 67e3d7a969227d742273d6a15aedea6ff80fe718 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Thu, 24 Apr 2025 10:32:06 -0700 Subject: [PATCH] Block the package from building on iOS-derived platforms Process spawning is not available there. Also remove a couple overly-specific platform conditions in tests that would be incorrect on other Unix-like platforms such as Android and FreeBSD. --- Package.swift | 4 ++-- Tests/SubprocessTests/SubprocessTests+Linting.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Package.swift b/Package.swift index 46c74f7..ec3e623 100644 --- a/Package.swift +++ b/Package.swift @@ -4,7 +4,7 @@ import PackageDescription let availabilityMacro: SwiftSetting = .enableExperimentalFeature( - "AvailabilityMacro=SubprocessSpan: macOS 9999", + "AvailabilityMacro=SubprocessSpan: macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, visionOS 9999", ) var dep: [Package.Dependency] = [ @@ -31,7 +31,7 @@ defaultTraits.insert("SubprocessSpan") let package = Package( name: "Subprocess", - platforms: [.macOS(.v13)], + platforms: [.macOS(.v13), .iOS("99.0")], products: [ .library( name: "Subprocess", diff --git a/Tests/SubprocessTests/SubprocessTests+Linting.swift b/Tests/SubprocessTests/SubprocessTests+Linting.swift index b847f2c..8371f33 100644 --- a/Tests/SubprocessTests/SubprocessTests+Linting.swift +++ b/Tests/SubprocessTests/SubprocessTests+Linting.swift @@ -25,7 +25,7 @@ private func enableLintingTest() -> Bool { } catch { return false } - #elseif os(Linux) || os(Windows) + #else // Use swift-format directly do { _ = try Executable.name("swift-format") @@ -66,7 +66,7 @@ struct SubprocessLintingTest { executable: .path("/usr/bin/xcrun"), arguments: ["swift-format", "lint", "-s", "--recursive", sourcePath] ) - #elseif os(Linux) || os(Windows) + #else let configuration = Configuration( executable: .name("swift-format"), arguments: ["lint", "-s", "--recursive", sourcePath]