diff --git a/Package.swift b/Package.swift index ec3e623..20af749 100644 --- a/Package.swift +++ b/Package.swift @@ -3,10 +3,6 @@ import PackageDescription -let availabilityMacro: SwiftSetting = .enableExperimentalFeature( - "AvailabilityMacro=SubprocessSpan: macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, visionOS 9999", -) - var dep: [Package.Dependency] = [ .package( url: "https://github.com/apple/swift-system", @@ -59,7 +55,6 @@ let package = Package( .enableExperimentalFeature("NonescapableTypes"), .enableExperimentalFeature("LifetimeDependence"), .enableExperimentalFeature("Span"), - availabilityMacro, ] ), .testTarget( @@ -72,7 +67,6 @@ let package = Package( ], swiftSettings: [ .enableExperimentalFeature("Span"), - availabilityMacro, ] ), diff --git a/Sources/Subprocess/API.swift b/Sources/Subprocess/API.swift index 3854e28..d40c747 100644 --- a/Sources/Subprocess/API.swift +++ b/Sources/Subprocess/API.swift @@ -30,9 +30,6 @@ /// - output: The method to use for redirecting the standard output. /// - error: The method to use for redirecting the standard error. /// - Returns a CollectedResult containing the result of the run. -#if SubprocessSpan -@available(SubprocessSpan, *) -#endif public func run< Input: InputProtocol, Output: OutputProtocol, @@ -76,7 +73,6 @@ public func run< /// - error: The method to use for redirecting the standard error. /// - Returns a CollectedResult containing the result of the run. #if SubprocessSpan -@available(SubprocessSpan, *) public func run< InputElement: BitwiseCopyable, Output: OutputProtocol, @@ -480,9 +476,6 @@ public func run( /// - output: The method to use for redirecting the standard output. /// - error: The method to use for redirecting the standard error. /// - Returns a CollectedResult containing the result of the run. -#if SubprocessSpan -@available(SubprocessSpan, *) -#endif public func run< Input: InputProtocol, Output: OutputProtocol, diff --git a/Sources/Subprocess/Buffer.swift b/Sources/Subprocess/Buffer.swift index e2245e7..94b8f52 100644 --- a/Sources/Subprocess/Buffer.swift +++ b/Sources/Subprocess/Buffer.swift @@ -79,9 +79,6 @@ extension AsyncBufferSequence.Buffer { #if SubprocessSpan // Access the storage backing this Buffer - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif public var bytes: RawSpan { @lifetime(borrow self) borrowing get { diff --git a/Sources/Subprocess/IO/Input.swift b/Sources/Subprocess/IO/Input.swift index 90904e8..58bfe4d 100644 --- a/Sources/Subprocess/IO/Input.swift +++ b/Sources/Subprocess/IO/Input.swift @@ -231,7 +231,6 @@ public final actor StandardInputWriter: Sendable { /// - Parameter span: The span to write /// - Returns number of bytes written #if SubprocessSpan - @available(SubprocessSpan, *) public func write(_ span: borrowing RawSpan) async throws -> Int { return try await self.diskIO.write(span) } diff --git a/Sources/Subprocess/IO/Output.swift b/Sources/Subprocess/IO/Output.swift index 4af3838..66f2dbb 100644 --- a/Sources/Subprocess/IO/Output.swift +++ b/Sources/Subprocess/IO/Output.swift @@ -28,7 +28,6 @@ public protocol OutputProtocol: Sendable, ~Copyable { #if SubprocessSpan /// Convert the output from span to expected output type - @available(SubprocessSpan, *) func output(from span: RawSpan) throws -> OutputType #endif @@ -113,7 +112,6 @@ public struct StringOutput: OutputProtocol { public let maxSize: Int #if SubprocessSpan - @available(SubprocessSpan, *) public func output(from span: RawSpan) throws -> String? { // FIXME: Span to String var array: [UInt8] = [] @@ -153,7 +151,6 @@ public struct BytesOutput: OutputProtocol { } #if SubprocessSpan - @available(SubprocessSpan, *) public func output(from span: RawSpan) throws -> [UInt8] { fatalError("Not implemented") } @@ -227,7 +224,6 @@ extension OutputProtocol where Self == BytesOutput { // MARK: - Span Default Implementations #if SubprocessSpan -@available(SubprocessSpan, *) extension OutputProtocol { public func output(from buffer: some Sequence) throws -> OutputType { guard let rawBytes: UnsafeRawBufferPointer = buffer as? UnsafeRawBufferPointer else { @@ -281,7 +277,6 @@ extension OutputProtocol where OutputType == Void { #if SubprocessSpan /// Convert the output from Data to expected output type - @available(SubprocessSpan, *) public func output(from span: RawSpan) throws { // noop } @@ -293,7 +288,6 @@ extension OutputProtocol where OutputType == Void { } #if SubprocessSpan -@available(SubprocessSpan, *) extension OutputProtocol { #if os(Windows) internal func output(from data: [UInt8]) throws -> OutputType { diff --git a/Sources/Subprocess/Platforms/Subprocess+Linux.swift b/Sources/Subprocess/Platforms/Subprocess+Linux.swift index 84210db..c03791a 100644 --- a/Sources/Subprocess/Platforms/Subprocess+Linux.swift +++ b/Sources/Subprocess/Platforms/Subprocess+Linux.swift @@ -32,9 +32,6 @@ import _SubprocessCShims // Linux specific implementations extension Configuration { - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif internal func spawn( withInput inputPipe: consuming CreatedPipe, outputPipe: consuming CreatedPipe, diff --git a/Sources/Subprocess/Platforms/Subprocess+Unix.swift b/Sources/Subprocess/Platforms/Subprocess+Unix.swift index ced3db1..5159e0a 100644 --- a/Sources/Subprocess/Platforms/Subprocess+Unix.swift +++ b/Sources/Subprocess/Platforms/Subprocess+Unix.swift @@ -446,7 +446,6 @@ extension DispatchIO { extension TrackedDispatchIO { #if SubprocessSpan - @available(SubprocessSpan, *) internal func write( _ span: borrowing RawSpan ) async throws -> Int { diff --git a/Sources/Subprocess/Platforms/Subprocess+Windows.swift b/Sources/Subprocess/Platforms/Subprocess+Windows.swift index d879de2..184b7b4 100644 --- a/Sources/Subprocess/Platforms/Subprocess+Windows.swift +++ b/Sources/Subprocess/Platforms/Subprocess+Windows.swift @@ -21,9 +21,6 @@ internal import Dispatch // Windows specific implementation extension Configuration { - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif internal func spawn( withInput inputPipe: consuming CreatedPipe, outputPipe: consuming CreatedPipe, @@ -534,9 +531,7 @@ internal func monitorProcessTermination( } // MARK: - Subprocess Control -#if SubprocessSpan -@available(SubprocessSpan, *) -#endif + extension Execution { /// Terminate the current subprocess with the given exit code /// - Parameter exitCode: The exit code to use for the subprocess. @@ -1165,7 +1160,6 @@ extension TrackedFileDescriptor { } #if SubprocessSpan - @available(SubprocessSpan, *) internal func write( _ span: borrowing RawSpan ) async throws -> Int { diff --git a/Sources/Subprocess/Result.swift b/Sources/Subprocess/Result.swift index 0d36cad..88bcc45 100644 --- a/Sources/Subprocess/Result.swift +++ b/Sources/Subprocess/Result.swift @@ -34,9 +34,6 @@ public struct ExecutionResult { /// The result of a subprocess execution with its collected /// standard output and standard error. -#if SubprocessSpan -@available(SubprocessSpan, *) -#endif public struct CollectedResult< Output: OutputProtocol, Error: OutputProtocol @@ -62,24 +59,13 @@ public struct CollectedResult< } // MARK: - CollectedResult Conformances -#if SubprocessSpan -@available(SubprocessSpan, *) -#endif + extension CollectedResult: Equatable where Output.OutputType: Equatable, Error.OutputType: Equatable {} -#if SubprocessSpan -@available(SubprocessSpan, *) -#endif extension CollectedResult: Hashable where Output.OutputType: Hashable, Error.OutputType: Hashable {} -#if SubprocessSpan -@available(SubprocessSpan, *) -#endif extension CollectedResult: Codable where Output.OutputType: Codable, Error.OutputType: Codable {} -#if SubprocessSpan -@available(SubprocessSpan, *) -#endif extension CollectedResult: CustomStringConvertible where Output.OutputType: CustomStringConvertible, Error.OutputType: CustomStringConvertible { public var description: String { @@ -94,9 +80,6 @@ where Output.OutputType: CustomStringConvertible, Error.OutputType: CustomString } } -#if SubprocessSpan -@available(SubprocessSpan, *) -#endif extension CollectedResult: CustomDebugStringConvertible where Output.OutputType: CustomDebugStringConvertible, Error.OutputType: CustomDebugStringConvertible { public var debugDescription: String { diff --git a/Sources/Subprocess/Span+Subprocess.swift b/Sources/Subprocess/Span+Subprocess.swift index 366b271..dbe5a50 100644 --- a/Sources/Subprocess/Span+Subprocess.swift +++ b/Sources/Subprocess/Span+Subprocess.swift @@ -39,7 +39,6 @@ public func _overrideLifetime< dependent } -@available(SubprocessSpan, *) extension Span where Element: BitwiseCopyable { internal var _bytes: RawSpan { @@ -55,7 +54,6 @@ extension Span where Element: BitwiseCopyable { #if canImport(Glibc) || canImport(Bionic) || canImport(Musl) internal import Dispatch -@available(SubprocessSpan, *) extension DispatchData { var bytes: RawSpan { _read { diff --git a/Sources/Subprocess/SubprocessFoundation/Output+Foundation.swift b/Sources/Subprocess/SubprocessFoundation/Output+Foundation.swift index 29129b3..1aaf157 100644 --- a/Sources/Subprocess/SubprocessFoundation/Output+Foundation.swift +++ b/Sources/Subprocess/SubprocessFoundation/Output+Foundation.swift @@ -22,9 +22,6 @@ import FoundationEssentials /// A concrete `Output` type for subprocesses that collects output /// from the subprocess as `Data`. This option must be used with /// the `run()` method that returns a `CollectedResult` -#if SubprocessSpan -@available(SubprocessSpan, *) -#endif public struct DataOutput: OutputProtocol { public typealias OutputType = Data public let maxSize: Int @@ -44,9 +41,6 @@ public struct DataOutput: OutputProtocol { } } -#if SubprocessSpan -@available(SubprocessSpan, *) -#endif extension OutputProtocol where Self == DataOutput { /// Create a `Subprocess` output that collects output as `Data` /// up to 128kb. @@ -61,9 +55,6 @@ extension OutputProtocol where Self == DataOutput { } } -#if SubprocessSpan -@available(SubprocessSpan, *) -#endif extension Data { /// Create a `Data` from `Buffer` /// - Parameter buffer: buffer to copy from @@ -74,7 +65,6 @@ extension Data { // MARK: - Workarounds #if SubprocessSpan -@available(SubprocessSpan, *) extension OutputProtocol { @_disfavoredOverload public func output(from data: some DataProtocol) throws -> OutputType { diff --git a/Sources/Subprocess/SubprocessFoundation/Span+SubprocessFoundation.swift b/Sources/Subprocess/SubprocessFoundation/Span+SubprocessFoundation.swift index b75ee71..b41cf56 100644 --- a/Sources/Subprocess/SubprocessFoundation/Span+SubprocessFoundation.swift +++ b/Sources/Subprocess/SubprocessFoundation/Span+SubprocessFoundation.swift @@ -21,7 +21,6 @@ import FoundationEssentials internal import Dispatch -@available(SubprocessSpan, *) extension Data { init(_ s: borrowing RawSpan) { self = s.withUnsafeBytes { Data($0) } @@ -37,7 +36,6 @@ extension Data { } } -@available(SubprocessSpan, *) extension DataProtocol { var bytes: RawSpan { _read { diff --git a/Tests/SubprocessTests/SubprocessTests+Darwin.swift b/Tests/SubprocessTests/SubprocessTests+Darwin.swift index c89d28c..bd2a570 100644 --- a/Tests/SubprocessTests/SubprocessTests+Darwin.swift +++ b/Tests/SubprocessTests/SubprocessTests+Darwin.swift @@ -27,9 +27,6 @@ import Testing @Suite(.serialized) struct SubprocessDarwinTests { @Test func testSubprocessPlatformOptionsProcessConfiguratorUpdateSpawnAttr() async throws { - guard #available(SubprocessSpan , *) else { - return - } var platformOptions = PlatformOptions() platformOptions.preSpawnProcessConfigurator = { spawnAttr, _ in // Set POSIX_SPAWN_SETSID flag, which implies calls @@ -50,9 +47,6 @@ struct SubprocessDarwinTests { } @Test func testSubprocessPlatformOptionsProcessConfiguratorUpdateFileAction() async throws { - guard #available(SubprocessSpan , *) else { - return - } let intendedWorkingDir = FileManager.default.temporaryDirectory.path() var platformOptions = PlatformOptions() platformOptions.preSpawnProcessConfigurator = { _, fileAttr in @@ -79,9 +73,6 @@ struct SubprocessDarwinTests { } @Test func testSuspendResumeProcess() async throws { - guard #available(SubprocessSpan , *) else { - return - } _ = try await Subprocess.run( // This will intentionally hang .path("/bin/cat"), diff --git a/Tests/SubprocessTests/SubprocessTests+Linting.swift b/Tests/SubprocessTests/SubprocessTests+Linting.swift index 8371f33..ce45119 100644 --- a/Tests/SubprocessTests/SubprocessTests+Linting.swift +++ b/Tests/SubprocessTests/SubprocessTests+Linting.swift @@ -45,9 +45,6 @@ struct SubprocessLintingTest { ) ) func runLinter() async throws { - guard #available(SubprocessSpan , *) else { - return - } // META: Use Subprocess to run `swift-format` on self // to make sure it's properly linted guard diff --git a/Tests/SubprocessTests/SubprocessTests+Unix.swift b/Tests/SubprocessTests/SubprocessTests+Unix.swift index 32c940c..582af77 100644 --- a/Tests/SubprocessTests/SubprocessTests+Unix.swift +++ b/Tests/SubprocessTests/SubprocessTests+Unix.swift @@ -47,9 +47,6 @@ struct SubprocessUnixTests {} extension SubprocessUnixTests { @Test func testExecutableNamed() async throws { - guard #available(SubprocessSpan , *) else { - return - } // Simple test to make sure we can find a common utility let message = "Hello, world!" let result = try await Subprocess.run( @@ -64,9 +61,6 @@ extension SubprocessUnixTests { } @Test func testExecutableNamedCannotResolve() async { - guard #available(SubprocessSpan , *) else { - return - } do { _ = try await Subprocess.run(.name("do-not-exist")) Issue.record("Expected to throw") @@ -80,9 +74,6 @@ extension SubprocessUnixTests { } @Test func testExecutableAtPath() async throws { - guard #available(SubprocessSpan , *) else { - return - } let expected = FileManager.default.currentDirectoryPath let result = try await Subprocess.run(.path("/bin/pwd"), output: .string) #expect(result.terminationStatus.isSuccess) @@ -94,9 +85,6 @@ extension SubprocessUnixTests { } @Test func testExecutableAtPathCannotResolve() async { - guard #available(SubprocessSpan , *) else { - return - } do { _ = try await Subprocess.run(.path("/usr/bin/do-not-exist")) Issue.record("Expected to throw SubprocessError") @@ -113,9 +101,6 @@ extension SubprocessUnixTests { // MARK: - Arguments Tests extension SubprocessUnixTests { @Test func testArgumentsArrayLiteral() async throws { - guard #available(SubprocessSpan , *) else { - return - } let result = try await Subprocess.run( .path("/bin/bash"), arguments: ["-c", "echo Hello World!"], @@ -131,9 +116,6 @@ extension SubprocessUnixTests { } @Test func testArgumentsOverride() async throws { - guard #available(SubprocessSpan , *) else { - return - } let result = try await Subprocess.run( .path("/bin/bash"), arguments: .init( @@ -152,9 +134,6 @@ extension SubprocessUnixTests { } @Test func testArgumentsFromArray() async throws { - guard #available(SubprocessSpan , *) else { - return - } let arguments: [UInt8] = Array("Data Content\0".utf8) let result = try await Subprocess.run( .path("/bin/echo"), @@ -177,9 +156,6 @@ extension SubprocessUnixTests { // MARK: - Environment Tests extension SubprocessUnixTests { @Test func testEnvironmentInherit() async throws { - guard #available(SubprocessSpan , *) else { - return - } let result = try await Subprocess.run( .path("/bin/bash"), arguments: ["-c", "printenv PATH"], @@ -196,9 +172,6 @@ extension SubprocessUnixTests { } @Test func testEnvironmentInheritOverride() async throws { - guard #available(SubprocessSpan , *) else { - return - } let result = try await Subprocess.run( .path("/bin/bash"), arguments: ["-c", "printenv HOME"], @@ -217,9 +190,6 @@ extension SubprocessUnixTests { } @Test func testEnvironmentCustom() async throws { - guard #available(SubprocessSpan , *) else { - return - } let result = try await Subprocess.run( .path("/usr/bin/printenv"), environment: .custom([ @@ -242,9 +212,6 @@ extension SubprocessUnixTests { // MARK: - Working Directory Tests extension SubprocessUnixTests { @Test func testWorkingDirectoryDefaultValue() async throws { - guard #available(SubprocessSpan , *) else { - return - } // By default we should use the working directory of the parent process let workingDirectory = FileManager.default.currentDirectoryPath let result = try await Subprocess.run( @@ -263,9 +230,6 @@ extension SubprocessUnixTests { } @Test func testWorkingDirectoryCustomValue() async throws { - guard #available(SubprocessSpan , *) else { - return - } let workingDirectory = FilePath( FileManager.default.temporaryDirectory.path() ) @@ -299,9 +263,6 @@ extension SubprocessUnixTests { // MARK: - Input Tests extension SubprocessUnixTests { @Test func testInputNoInput() async throws { - guard #available(SubprocessSpan , *) else { - return - } let catResult = try await Subprocess.run( .path("/bin/cat"), input: .none, @@ -313,9 +274,6 @@ extension SubprocessUnixTests { } @Test func testStringInput() async throws { - guard #available(SubprocessSpan , *) else { - return - } let content = randomString(length: 64) let catResult = try await Subprocess.run( .path("/bin/cat"), @@ -327,9 +285,6 @@ extension SubprocessUnixTests { } @Test func testInputFileDescriptor() async throws { - guard #available(SubprocessSpan , *) else { - return - } // Make sure we can read long text from standard input let expected: Data = try Data( contentsOf: URL(filePath: theMysteriousIsland.string) @@ -349,9 +304,6 @@ extension SubprocessUnixTests { } @Test func testInputSequence() async throws { - guard #available(SubprocessSpan , *) else { - return - } // Make sure we can read long text as Sequence let expected: Data = try Data( contentsOf: URL(filePath: theMysteriousIsland.string) @@ -368,9 +320,6 @@ extension SubprocessUnixTests { #if SubprocessSpan @Test func testInputSpan() async throws { - guard #available(SubprocessSpan , *) else { - return - } let expected: Data = try Data( contentsOf: URL(filePath: theMysteriousIsland.string) ) @@ -388,9 +337,6 @@ extension SubprocessUnixTests { #endif @Test func testInputAsyncSequence() async throws { - guard #available(SubprocessSpan , *) else { - return - } // Make sure we can read long text as AsyncSequence let fd: FileDescriptor = try .open(theMysteriousIsland, .readOnly) let expected: Data = try Data( @@ -491,9 +437,6 @@ extension SubprocessUnixTests { #endif @Test func testCollectedOutput() async throws { - guard #available(SubprocessSpan , *) else { - return - } let expected = randomString(length: 32) let echoResult = try await Subprocess.run( .path("/bin/echo"), @@ -508,9 +451,6 @@ extension SubprocessUnixTests { } @Test func testCollectedOutputWithLimit() async throws { - guard #available(SubprocessSpan , *) else { - return - } let limit = 4 let expected = randomString(length: 32) let echoResult = try await Subprocess.run( @@ -527,9 +467,6 @@ extension SubprocessUnixTests { } @Test func testCollectedOutputFileDescriptor() async throws { - guard #available(SubprocessSpan , *) else { - return - } let outputFilePath = FilePath(FileManager.default.temporaryDirectory.path()) .appending("Test.out") if FileManager.default.fileExists(atPath: outputFilePath.string) { @@ -563,9 +500,6 @@ extension SubprocessUnixTests { } @Test func testCollectedOutputFileDescriptorAutoClose() async throws { - guard #available(SubprocessSpan , *) else { - return - } let outputFilePath = FilePath(FileManager.default.temporaryDirectory.path()) .appending("Test.out") if FileManager.default.fileExists(atPath: outputFilePath.string) { @@ -642,9 +576,6 @@ extension SubprocessUnixTests { #endif @Test func testBufferOutput() async throws { - guard #available(SubprocessSpan , *) else { - return - } let expected: Data = try Data( contentsOf: URL(filePath: theMysteriousIsland.string) ) @@ -659,9 +590,6 @@ extension SubprocessUnixTests { } @Test func testCollectedError() async throws { - guard #available(SubprocessSpan , *) else { - return - } // Make sure we can capture long text on standard error let expected: Data = try Data( contentsOf: URL(filePath: theMysteriousIsland.string) @@ -677,7 +605,6 @@ extension SubprocessUnixTests { } #if SubprocessSpan -@available(SubprocessSpan, *) extension Data { init(bytes: borrowing RawSpan) { let data = bytes.withUnsafeBytes { @@ -698,9 +625,6 @@ extension SubprocessUnixTests { ) ) func testSubprocessPlatformOptionsUserID() async throws { - guard #available(SubprocessSpan , *) else { - return - } let expectedUserID = uid_t(Int.random(in: 1000...2000)) var platformOptions = PlatformOptions() platformOptions.userID = expectedUserID @@ -719,9 +643,6 @@ extension SubprocessUnixTests { ) ) func testSubprocessPlatformOptionsGroupID() async throws { - guard #available(SubprocessSpan , *) else { - return - } let expectedGroupID = gid_t(Int.random(in: 1000...2000)) var platformOptions = PlatformOptions() platformOptions.groupID = expectedGroupID @@ -740,9 +661,6 @@ extension SubprocessUnixTests { ) ) func testSubprocessPlatformOptionsSupplementaryGroups() async throws { - guard #available(SubprocessSpan , *) else { - return - } var expectedGroups: Set = Set() for _ in 0..( with result: CollectedResult< StringOutput, @@ -1159,9 +1049,6 @@ extension FileDescriptor { // MARK: - Performance Tests extension SubprocessUnixTests { @Test func testConcurrentRun() async throws { - guard #available(SubprocessSpan , *) else { - return - } // Launch as many processes as we can // Figure out the max open file limit let limitResult = try await Subprocess.run( @@ -1215,9 +1102,6 @@ extension SubprocessUnixTests { } @Test func testCaptureLongStandardOutputAndError() async throws { - guard #available(SubprocessSpan , *) else { - return - } try await withThrowingTaskGroup(of: Void.self) { group in var running = 0 for _ in 0..<10 { @@ -1244,10 +1128,6 @@ extension SubprocessUnixTests { } @Test func testCancelProcessVeryEarlyOnStressTest() async throws { - guard #available(SubprocessSpan , *) else { - return - } - for i in 0..<100 { let terminationStatus = try await withThrowingTaskGroup( of: TerminationStatus?.self, diff --git a/Tests/SubprocessTests/SubprocessTests+Windows.swift b/Tests/SubprocessTests/SubprocessTests+Windows.swift index 0f78a41..ed67810 100644 --- a/Tests/SubprocessTests/SubprocessTests+Windows.swift +++ b/Tests/SubprocessTests/SubprocessTests+Windows.swift @@ -32,9 +32,6 @@ struct SubprocessWindowsTests { // MARK: - Executable Tests extension SubprocessWindowsTests { - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testExecutableNamed() async throws { // Simple test to make sure we can run a common utility let message = "Hello, world from Swift!" @@ -53,9 +50,6 @@ extension SubprocessWindowsTests { ) } - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testExecutableNamedCannotResolve() async throws { do { _ = try await Subprocess.run(.name("do-not-exist")) @@ -70,9 +64,6 @@ extension SubprocessWindowsTests { } } - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testExecutableAtPath() async throws { let expected = FileManager.default.currentDirectoryPath let result = try await Subprocess.run( @@ -87,9 +78,6 @@ extension SubprocessWindowsTests { ) } - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testExecutableAtPathCannotResolve() async { do { // Since we are using the path directly, @@ -111,9 +99,6 @@ extension SubprocessWindowsTests { // MARK: - Argument Tests extension SubprocessWindowsTests { - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testArgumentsFromArray() async throws { let message = "Hello, World!" let args: [String] = [ @@ -136,9 +121,6 @@ extension SubprocessWindowsTests { // MARK: - Environment Tests extension SubprocessWindowsTests { - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testEnvironmentInherit() async throws { let result = try await Subprocess.run( self.cmdExe, @@ -154,9 +136,6 @@ extension SubprocessWindowsTests { #expect(pathValue.contains("C:\\Windows\\system32")) } - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testEnvironmentInheritOverride() async throws { let result = try await Subprocess.run( self.cmdExe, @@ -173,9 +152,6 @@ extension SubprocessWindowsTests { ) } - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test(.enabled(if: ProcessInfo.processInfo.environment["SystemRoot"] != nil)) func testEnvironmentCustom() async throws { let result = try await Subprocess.run( @@ -200,9 +176,6 @@ extension SubprocessWindowsTests { // MARK: - Working Directory Tests extension SubprocessWindowsTests { - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testWorkingDirectoryDefaultValue() async throws { // By default we should use the working directory of the parent process let workingDirectory = FileManager.default.currentDirectoryPath @@ -221,9 +194,6 @@ extension SubprocessWindowsTests { ) } - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testWorkingDirectoryCustomValue() async throws { let workingDirectory = FilePath( FileManager.default.temporaryDirectory._fileSystemPath @@ -247,9 +217,6 @@ extension SubprocessWindowsTests { // MARK: - Input Tests extension SubprocessWindowsTests { - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testInputNoInput() async throws { let catResult = try await Subprocess.run( self.cmdExe, @@ -262,9 +229,6 @@ extension SubprocessWindowsTests { #expect(catResult.standardOutput.isEmpty) } - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testInputFileDescriptor() async throws { // Make sure we can read long text from standard input let expected: Data = try Data( @@ -292,9 +256,6 @@ extension SubprocessWindowsTests { ) } - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testInputSequence() async throws { // Make sure we can read long text as Sequence let expected: Data = try Data( @@ -317,9 +278,6 @@ extension SubprocessWindowsTests { ) } - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testInputAsyncSequence() async throws { let chunkSize = 4096 // Make sure we can read long text as AsyncSequence @@ -352,9 +310,6 @@ extension SubprocessWindowsTests { ) } - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testInputSequenceCustomExecutionBody() async throws { let expected: Data = try Data( contentsOf: URL(filePath: theMysteriousIsland.string) @@ -376,9 +331,6 @@ extension SubprocessWindowsTests { #expect(result.value == expected) } - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testInputAsyncSequenceCustomExecutionBody() async throws { // Make sure we can read long text as AsyncSequence let chunkSize = 4096 @@ -419,9 +371,6 @@ extension SubprocessWindowsTests { // MARK: - Output Tests extension SubprocessWindowsTests { - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testCollectedOutput() async throws { let expected = randomString(length: 32) let echoResult = try await Subprocess.run( @@ -436,9 +385,6 @@ extension SubprocessWindowsTests { #expect(output == expected) } - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testCollectedOutputWithLimit() async throws { let limit = 2 let expected = randomString(length: 32) @@ -455,9 +401,6 @@ extension SubprocessWindowsTests { #expect(String(expected[targetRange]) == output) } - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testCollectedOutputFileDescriptor() async throws { let outputFilePath = FilePath( FileManager.default.temporaryDirectory._fileSystemPath @@ -489,9 +432,6 @@ extension SubprocessWindowsTests { #expect(output == expected) } - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testRedirectedOutputRedirectToSequence() async throws { // Make sure we can read long text redirected to AsyncSequence let expected: Data = try Data( @@ -516,9 +456,6 @@ extension SubprocessWindowsTests { // MARK: - PlatformOption Tests extension SubprocessWindowsTests { - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test(.enabled(if: SubprocessWindowsTests.hasAdminPrivileges())) func testPlatformOptionsRunAsUser() async throws { try await self.withTemporaryUser { username, password in @@ -555,9 +492,6 @@ extension SubprocessWindowsTests { } } - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testPlatformOptionsCreateNewConsole() async throws { let parentConsole = GetConsoleWindow() let sameConsoleResult = try await Subprocess.run( @@ -598,9 +532,6 @@ extension SubprocessWindowsTests { ) } - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testPlatformOptionsDetachedProcess() async throws { var platformOptions: Subprocess.PlatformOptions = .init() platformOptions.consoleBehavior = .detach @@ -621,9 +552,6 @@ extension SubprocessWindowsTests { #expect(detachConsoleValue.isEmpty) } - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testPlatformOptionsPreSpawnConfigurator() async throws { // Manually set the create new console flag var platformOptions: Subprocess.PlatformOptions = .init() @@ -681,9 +609,6 @@ extension SubprocessWindowsTests { // MARK: - Subprocess Controlling Tests extension SubprocessWindowsTests { - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testTerminateProcess() async throws { let stuckProcess = try await Subprocess.run( self.cmdExe, @@ -703,9 +628,6 @@ extension SubprocessWindowsTests { #expect(exitCode == 42) } - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testSuspendResumeProcess() async throws { let stuckProcess = try await Subprocess.run( self.cmdExe, @@ -755,9 +677,6 @@ extension SubprocessWindowsTests { #expect(stuckProcess.terminationStatus.isSuccess) } - #if SubprocessSpan - @available(SubprocessSpan, *) - #endif @Test func testRunDetached() async throws { let (readFd, writeFd) = try FileDescriptor.ssp_pipe() SetHandleInformation(