Skip to content

Commit

Permalink
Revert "[Wrangle] Temporarily revert noasync annotation"
Browse files Browse the repository at this point in the history
This reverts commit 3d75b96.
  • Loading branch information
jakepetroules committed Feb 10, 2023
1 parent 3d75b96 commit b82a600
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
12 changes: 6 additions & 6 deletions Sources/TSCBasic/Await.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
/// 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.8)
//@available(*, noasync)
//#endif
#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.8)
//@available(*, noasync)
//#endif
#if compiler(>=5.8)
@available(*, noasync)
#endif
public func tsc_await<T>(_ body: (@escaping (T) -> Void) -> Void) -> T {
let condition = Condition()
var result: T? = nil
Expand Down
36 changes: 18 additions & 18 deletions Sources/TSCBasic/Process.swift
Original file line number Diff line number Diff line change
Expand Up @@ -835,9 +835,9 @@ public final class Process {
}

/// Blocks the calling process until the subprocess finishes execution.
// #if compiler(>=5.8)
// @available(*, noasync)
// #endif
#if compiler(>=5.8)
@available(*, noasync)
#endif
@discardableResult
public func waitUntilExit() throws -> ProcessResult {
let group = DispatchGroup()
Expand Down Expand Up @@ -1060,9 +1060,9 @@ 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.8)
// @available(*, noasync)
// #endif
#if compiler(>=5.8)
@available(*, noasync)
#endif
static public func popen(
arguments: [String],
environment: [String: String] = ProcessEnv.vars,
Expand Down Expand Up @@ -1097,9 +1097,9 @@ extension Process {
/// will be inherited.
/// - loggingHandler: Handler for logging messages
/// - Returns: The process result.
// #if compiler(>=5.8)
// @available(*, noasync)
// #endif
#if compiler(>=5.8)
@available(*, noasync)
#endif
@discardableResult
static public func popen(
arguments: [String],
Expand All @@ -1124,9 +1124,9 @@ extension Process {
/// will be inherited.
/// - loggingHandler: Handler for logging messages
/// - Returns: The process result.
// #if compiler(>=5.8)
// @available(*, noasync)
// #endif
#if compiler(>=5.8)
@available(*, noasync)
#endif
@discardableResult
static public func popen(
args: String...,
Expand All @@ -1144,9 +1144,9 @@ extension Process {
/// will be inherited.
/// - loggingHandler: Handler for logging messages
/// - Returns: The process output (stdout + stderr).
// #if compiler(>=5.8)
// @available(*, noasync)
// #endif
#if compiler(>=5.8)
@available(*, noasync)
#endif
@discardableResult
static public func checkNonZeroExit(
arguments: [String],
Expand Down Expand Up @@ -1176,9 +1176,9 @@ extension Process {
/// will be inherited.
/// - loggingHandler: Handler for logging messages
/// - Returns: The process output (stdout + stderr).
// #if compiler(>=5.8)
// @available(*, noasync)
// #endif
#if compiler(>=5.8)
@available(*, noasync)
#endif
@discardableResult
static public func checkNonZeroExit(
args: String...,
Expand Down
6 changes: 3 additions & 3 deletions Sources/TSCBasic/ProcessSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ 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.8)
// @available(*, noasync)
// #endif
#if compiler(>=5.8)
@available(*, noasync)
#endif
public func terminate() {
// Mark a process set as cancelled.
serialQueue.sync {
Expand Down
12 changes: 6 additions & 6 deletions Tests/TSCBasicTests/ProcessTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,9 @@ fileprivate extension Process {
self.init(arguments: [Self.script(scriptName)] + arguments, environment: Self.env(), outputRedirection: outputRedirection)
}

// #if compiler(>=5.8)
// @available(*, noasync)
// #endif
#if compiler(>=5.8)
@available(*, noasync)
#endif
static func checkNonZeroExit(
scriptName: String,
environment: [String: String] = ProcessEnv.vars,
Expand All @@ -498,9 +498,9 @@ fileprivate extension Process {
return try await checkNonZeroExit(args: script(scriptName), environment: environment, loggingHandler: loggingHandler)
}

// #if compiler(>=5.8)
// @available(*, noasync)
// #endif
#if compiler(>=5.8)
@available(*, noasync)
#endif
@discardableResult
static func popen(
scriptName: String,
Expand Down

0 comments on commit b82a600

Please sign in to comment.