Skip to content

Commit 243c601

Browse files
Adjust API Availability for Structured Concurrency Backport (#58)
* Change API availability for concurrency backport * Adjust all relevant availibiltiy checks
1 parent 7ee6ac3 commit 243c601

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Sources/Tracing/Tracer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ extension Tracer {
9797
// ==== ----------------------------------------------------------------------------------------------------------------
9898
// MARK: Starting spans: Task-local Baggage propagation
9999

100-
#if swift(>=5.5)
101-
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
100+
#if swift(>=5.5) && canImport(_Concurrency)
101+
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
102102
extension Tracer {
103103
/// Execute the given operation within a newly created `Span`,
104104
/// started as a child of the currently stored task local `Baggage.current` or as a root span if `nil`.

Tests/TracingTests/TracerTests.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ final class TracerTests: XCTestCase {
9898
}
9999

100100
func testWithSpan_automaticBaggagePropagation_sync() throws {
101-
#if swift(>=5.5)
102-
guard #available(macOS 12, iOS 15, tvOS 15, watchOS 8, *) else {
101+
#if swift(>=5.5) && canImport(_Concurrency)
102+
guard #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) else {
103103
throw XCTSkip("Task locals are not supported on this platform.")
104104
}
105105

@@ -127,8 +127,8 @@ final class TracerTests: XCTestCase {
127127
}
128128

129129
func testWithSpan_automaticBaggagePropagation_sync_throws() throws {
130-
#if swift(>=5.5)
131-
guard #available(macOS 12, iOS 15, tvOS 15, watchOS 8, *) else {
130+
#if swift(>=5.5) && canImport(_Concurrency)
131+
guard #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) else {
132132
throw XCTSkip("Task locals are not supported on this platform.")
133133
}
134134

@@ -157,8 +157,8 @@ final class TracerTests: XCTestCase {
157157
}
158158

159159
func testWithSpan_automaticBaggagePropagation_async() throws {
160-
#if swift(>=5.5)
161-
guard #available(macOS 12, iOS 15, tvOS 15, watchOS 8, *) else {
160+
#if swift(>=5.5) && canImport(_Concurrency)
161+
guard #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) else {
162162
throw XCTSkip("Task locals are not supported on this platform.")
163163
}
164164

@@ -188,8 +188,8 @@ final class TracerTests: XCTestCase {
188188
}
189189

190190
func testWithSpan_automaticBaggagePropagation_async_throws() throws {
191-
#if swift(>=5.5)
192-
guard #available(macOS 12, iOS 15, tvOS 15, watchOS 8, *) else {
191+
#if swift(>=5.5) && canImport(_Concurrency)
192+
guard #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) else {
193193
throw XCTSkip("Task locals are not supported on this platform.")
194194
}
195195

@@ -219,8 +219,8 @@ final class TracerTests: XCTestCase {
219219
#endif
220220
}
221221

222-
#if swift(>=5.5)
223-
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
222+
#if swift(>=5.5) && canImport(_Concurrency)
223+
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
224224
/// Helper method to execute async operations until we can use async tests (currently incompatible with the generated LinuxMain file).
225225
/// - Parameter operation: The operation to test.
226226
func testAsync(_ operation: @escaping () async throws -> Void) rethrows {

0 commit comments

Comments
 (0)