Skip to content

Commit fbc6275

Browse files
committed
drop swift 5 support
1 parent 71b0066 commit fbc6275

File tree

6 files changed

+10
-58
lines changed

6 files changed

+10
-58
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ jobs:
1414
name: Unit tests
1515
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
1616
with:
17-
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
18-
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
1917
linux_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
2018
linux_6_1_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
2119
linux_6_2_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
22-
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
20+
linux_nightly_next_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
2321
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
2422
windows_6_0_enabled: true
2523
windows_6_1_enabled: true
24+
windows_6_2_enabled: true
2625
windows_nightly_next_enabled: true
2726
windows_nightly_main_enabled: true
2827
windows_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
2928
windows_6_1_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
29+
windows_6_2_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
3030
windows_nightly_next_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
3131
windows_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
3232

.github/workflows/pull_request.yml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,19 @@ jobs:
2020
name: Unit tests
2121
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
2222
with:
23-
24-
# NOTE: Aug 5, 2025. We've determined SPM has bugs for `condition: .when(platforms: [.somePlatform])`
25-
# that incorrectly ignore the condition and import anyways for unintended platforms.
26-
#
27-
# See https://github.com/apple/swift-distributed-tracing/actions/runs/16578688393/job/46920025183?pr=174
28-
# for an example of the resulting build failure.
29-
#
30-
# This is documented as a bug in Swift 5.10, resolved in Swift 6.
31-
# See FB14859516.
32-
# See also https://forums.swift.org/t/do-swiftpm-conditional-target-dependencies-work/74047
33-
#
34-
# Given this, the explicit target dependency check is disabled for Swift versions before Swift 6.
35-
36-
# Intentionally disabled:
37-
#
38-
# linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
39-
# linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
40-
4123
linux_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
4224
linux_6_1_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
4325
linux_6_2_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
44-
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
26+
linux_nightly_next_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
4527
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
4628
windows_6_0_enabled: true
4729
windows_6_1_enabled: true
30+
windows_6_2_enabled: true
4831
windows_nightly_next_enabled: true
4932
windows_nightly_main_enabled: true
5033
windows_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
5134
windows_6_1_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
35+
windows_6_2_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
5236
windows_nightly_next_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
5337
windows_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
5438

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.9
1+
// swift-tools-version:6.0
22
import PackageDescription
33

44
let package = Package(

Sources/Tracing/Tracer.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ public func withSpan<T>(
321321
/// - operation: The operation that this span measures.
322322
/// - Returns: the value returned by `operation`.
323323
/// - Throws: the error the `operation` throws (if any).
324-
#if compiler(>=6.0)
325324
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) // for TaskLocal ServiceContext
326325
public func withSpan<T, Instant: TracerInstant>(
327326
_ operationName: String,
@@ -346,11 +345,8 @@ public func withSpan<T, Instant: TracerInstant>(
346345
try await operation(anySpan)
347346
}
348347
}
349-
#endif
350348

351-
#if compiler(>=6.0)
352349
@_disfavoredOverload @available(*, deprecated, message: "Prefer #isolation version of this API")
353-
#endif
354350
/// Start a new span and automatically end when the operation completes,
355351
/// including recording the error in case the operation throws.
356352
///
@@ -413,7 +409,6 @@ public func withSpan<T, Instant: TracerInstant>(
413409
/// - operation: The operation that this span measures.
414410
/// - Returns: the value returned by `operation`.
415411
/// - Throws: the error the `operation` throws (if any).
416-
#if compiler(>=6.0)
417412
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) // for TaskLocal ServiceContext
418413
public func withSpan<T>(
419414
_ operationName: String,
@@ -437,11 +432,8 @@ public func withSpan<T>(
437432
try await operation(anySpan)
438433
}
439434
}
440-
#endif
441435

442-
#if compiler(>=6.0)
443436
@_disfavoredOverload @available(*, deprecated, message: "Prefer #isolation version of this API")
444-
#endif
445437
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) // for TaskLocal ServiceContext
446438
/// Start a new span and automatically end when the operation completes,
447439
/// including recording the error in case the operation throws.
@@ -502,7 +494,6 @@ public func withSpan<T>(
502494
/// - operation: The operation that this span should be measuring
503495
/// - Returns: the value returned by `operation`
504496
/// - Throws: the error the `operation` has thrown (if any)
505-
#if compiler(>=6.0)
506497
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
507498
public func withSpan<T>(
508499
_ operationName: String,
@@ -527,11 +518,8 @@ public func withSpan<T>(
527518
try await operation(anySpan)
528519
}
529520
}
530-
#endif
531521

532-
#if compiler(>=6.0)
533522
@_disfavoredOverload @available(*, deprecated, message: "Prefer #isolation version of this API")
534-
#endif
535523
/// Start a new span and automatically end when the operation completes,
536524
/// including recording the error in case the operation throws.
537525
///

Sources/Tracing/TracerProtocol+Legacy.swift

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ extension LegacyTracer {
305305
/// - operation: The operation that this span measures.
306306
/// - Returns: the value returned by `operation`.
307307
/// - Throws: the error the `operation` throws (if any).
308-
#if compiler(>=6.0)
309308
public func withAnySpan<T, Instant: TracerInstant>(
310309
_ operationName: String,
311310
at instant: @autoclosure () -> Instant,
@@ -336,12 +335,9 @@ extension LegacyTracer {
336335
throw error // rethrow
337336
}
338337
}
339-
#endif
340338

341-
#if compiler(>=6.0)
342339
// swift-format-ignore: Spacing // fights with formatter
343340
@_disfavoredOverload @available(*, deprecated, message: "Prefer #isolation version of this API")
344-
#endif
345341
/// Start a new span and automatically end when the operation completes,
346342
/// including recording the error in case the operation throws.
347343
///
@@ -411,7 +407,6 @@ extension LegacyTracer {
411407
/// - operation: The operation that this span measures.
412408
/// - Returns: the value returned by `operation`.
413409
/// - Throws: the error the `operation` throws (if any).
414-
#if compiler(>=6.0)
415410
public func withAnySpan<T>(
416411
_ operationName: String,
417412
context: @autoclosure () -> ServiceContext = .current ?? .topLevel,
@@ -441,12 +436,9 @@ extension LegacyTracer {
441436
throw error // rethrow
442437
}
443438
}
444-
#endif
445-
446-
#if compiler(>=6.0)
439+
447440
// swift-format-ignore: Spacing // fights with formatter
448441
@_disfavoredOverload @available(*, deprecated, message: "Prefer #isolation version of this API")
449-
#endif
450442
/// Start a new span and automatically end when the operation completes,
451443
/// including recording the error in case the operation throws.
452444
///
@@ -629,7 +621,6 @@ extension Tracer {
629621
/// - operation: The operation that this span measures.
630622
/// - Returns: the value returned by `operation`.
631623
/// - Throws: the error the `operation` throws (if any).
632-
#if compiler(>=6.0)
633624
public func withAnySpan<T>(
634625
_ operationName: String,
635626
at instant: @autoclosure () -> some TracerInstant = DefaultTracerClock.now,
@@ -653,12 +644,9 @@ extension Tracer {
653644
try await operation(span)
654645
}
655646
}
656-
#endif
657647

658-
#if compiler(>=6.0)
659648
// swift-format-ignore: Spacing // fights with formatter
660649
@_disfavoredOverload @available(*, deprecated, message: "Prefer #isolation version of this API")
661-
#endif
662650
/// Start a new span and automatically end when the operation completes,
663651
/// including recording the error in case the operation throws.
664652
///

Sources/Tracing/TracerProtocol.swift

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ extension Tracer {
259259
/// - operation: The operation that this span measures.
260260
/// - Returns: the value returned by `operation`.
261261
/// - Throws: the error the `operation` throws (if any).
262-
#if compiler(>=6.0)
263262
public func withSpan<T>(
264263
_ operationName: String,
265264
context: @autoclosure () -> ServiceContext = .current ?? .topLevel,
@@ -289,12 +288,9 @@ extension Tracer {
289288
throw error // rethrow
290289
}
291290
}
292-
#endif
293-
294-
#if compiler(>=6.0)
291+
295292
// swift-format-ignore: Spacing // fights with formatter
296293
@_disfavoredOverload @available(*, deprecated, message: "Prefer #isolation version of this API")
297-
#endif
298294
public func withSpan<T>(
299295
_ operationName: String,
300296
context: @autoclosure () -> ServiceContext = .current ?? .topLevel,
@@ -347,7 +343,6 @@ extension Tracer {
347343
/// - operation: The operation that this span measures.
348344
/// - Returns: the value returned by `operation`.
349345
/// - Throws: the error the `operation` throws (if any).
350-
#if compiler(>=6.0)
351346
public func withSpan<T>(
352347
_ operationName: String,
353348
context: @autoclosure () -> ServiceContext = .current ?? .topLevel,
@@ -378,12 +373,9 @@ extension Tracer {
378373
throw error // rethrow
379374
}
380375
}
381-
#endif
382-
383-
#if compiler(>=6.0)
376+
384377
// swift-format-ignore: Spacing // fights with formatter
385378
@_disfavoredOverload @available(*, deprecated, message: "Prefer #isolation version of this API")
386-
#endif
387379
/// Start a new span and automatically end it when the operation completes,
388380
/// including recording the error in case the operation throws.
389381
///

0 commit comments

Comments
 (0)