Skip to content

Commit

Permalink
Require a 5.8 compiler to conditionally compile the noasync attribute
Browse files Browse the repository at this point in the history
This grammar isn't supported in 5.7.
  • Loading branch information
jakepetroules committed Feb 7, 2023
1 parent 3d2497e commit a73a7aa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Sources/TSCBasic/Await.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
/// should be passed to the async method's completion handler.
/// - Returns: The value wrapped by the async method's result.
/// - Throws: The error wrapped by the async method's result
#if compiler(>=5.7)
#if compiler(>=5.8)
@available(*, noasync)
#endif
public func tsc_await<T, ErrorType>(_ body: (@escaping (Result<T, ErrorType>) -> Void) -> Void) throws -> T {
return try tsc_await(body).get()
}

#if compiler(>=5.7)
#if compiler(>=5.8)
@available(*, noasync)
#endif
public func tsc_await<T>(_ body: (@escaping (T) -> Void) -> Void) -> T {
Expand Down
12 changes: 6 additions & 6 deletions Sources/TSCBasic/Process.swift
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ public final class Process {
}

/// Blocks the calling process until the subprocess finishes execution.
#if compiler(>=5.7)
#if compiler(>=5.8)
@available(*, noasync)
#endif
@discardableResult
Expand Down Expand Up @@ -1060,7 +1060,7 @@ extension Process {
/// - loggingHandler: Handler for logging messages
/// - queue: Queue to use for callbacks
/// - completion: A completion handler to return the process result
#if compiler(>=5.7)
#if compiler(>=5.8)
@available(*, noasync)
#endif
static public func popen(
Expand Down Expand Up @@ -1097,7 +1097,7 @@ extension Process {
/// will be inherited.
/// - loggingHandler: Handler for logging messages
/// - Returns: The process result.
#if compiler(>=5.7)
#if compiler(>=5.8)
@available(*, noasync)
#endif
@discardableResult
Expand All @@ -1124,7 +1124,7 @@ extension Process {
/// will be inherited.
/// - loggingHandler: Handler for logging messages
/// - Returns: The process result.
#if compiler(>=5.7)
#if compiler(>=5.8)
@available(*, noasync)
#endif
@discardableResult
Expand All @@ -1144,7 +1144,7 @@ extension Process {
/// will be inherited.
/// - loggingHandler: Handler for logging messages
/// - Returns: The process output (stdout + stderr).
#if compiler(>=5.7)
#if compiler(>=5.8)
@available(*, noasync)
#endif
@discardableResult
Expand Down Expand Up @@ -1176,7 +1176,7 @@ extension Process {
/// will be inherited.
/// - loggingHandler: Handler for logging messages
/// - Returns: The process output (stdout + stderr).
#if compiler(>=5.7)
#if compiler(>=5.8)
@available(*, noasync)
#endif
@discardableResult
Expand Down
2 changes: 1 addition & 1 deletion Sources/TSCBasic/ProcessSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public final class ProcessSet {
/// Terminate all the processes. This method blocks until all processes in the set are terminated.
///
/// A process set cannot be used once it has been asked to terminate.
#if compiler(>=5.7)
#if compiler(>=5.8)
@available(*, noasync)
#endif
public func terminate() {
Expand Down
4 changes: 2 additions & 2 deletions Tests/TSCBasicTests/ProcessTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ fileprivate extension Process {
self.init(arguments: [Self.script(scriptName)] + arguments, environment: Self.env(), outputRedirection: outputRedirection)
}

#if compiler(>=5.7)
#if compiler(>=5.8)
@available(*, noasync)
#endif
static func checkNonZeroExit(
Expand All @@ -498,7 +498,7 @@ fileprivate extension Process {
return try await checkNonZeroExit(args: script(scriptName), environment: environment, loggingHandler: loggingHandler)
}

#if compiler(>=5.7)
#if compiler(>=5.8)
@available(*, noasync)
#endif
@discardableResult
Expand Down

0 comments on commit a73a7aa

Please sign in to comment.