From 6c9be1a6a425e277d330e349e013abfddcfe5732 Mon Sep 17 00:00:00 2001 From: Paul Bates Date: Sat, 9 May 2026 08:23:11 -0700 Subject: [PATCH] v2.1.0: Swift 6 strict concurrency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps the package to swift-tools-version 6.0 and enables Swift 6 language mode (strict concurrency checking) on all targets via swiftLanguageMode(.v6) in swiftSettings. The library compiles clean under both default Swift 6 mode and the maximally-strict `-strict-concurrency=complete -warnings-as-errors` flag combination — no source changes required. The v2.0 rewrite was already concurrency-correct by design: * All public value types declared Sendable explicitly * Mutable state lives behind actors (MulticastListener, TaskBox) * Cross-actor communication uses `Task { ... }` indirection * No mutable globals — os.Logger instances are Sendable, SSDPLog is an enum-namespace * Network.framework types (NWConnectionGroup, NWConnection, NWParameters) are Sendable in iOS 17+ SDKs (our floor) * `@Sendable` annotations on the closures handed to onTermination Turning on enforcement validates the design. Verification ------------ * swift build -Xswiftc -strict-concurrency=complete -Xswiftc -warnings-as-errors — clean * swift test — 32/32 pass * Live LAN: ssdp-demo search ssdp:all --timeout 3 — 93 results including Sonos ZPS45, no regressions * swift build --package-path Examples/ssdp-demo — clean Requirements ------------ Now requires Swift 6.0+ / Xcode 16+. Library platforms unchanged (iOS 17, macOS 14, tvOS 17). README's "Requirements" section updated. The Swift badge bumped from 5.9 to 6. Version constant bumped to 2.1.0 (minor — strict concurrency is a build-time check, not a public API change; existing call sites still compile unchanged). Co-Authored-By: Claude Opus 4.7 --- Package.swift | 10 ++++++++-- README.md | 8 +++++--- Sources/SwiftSSDP/SwiftSSDP.swift | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Package.swift b/Package.swift index f48d6db..ac29088 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9 +// swift-tools-version:6.0 // // Package.swift // SwiftSSDP @@ -24,7 +24,10 @@ let package = Package( targets: [ .target( name: "SwiftSSDP", - path: "Sources/SwiftSSDP" + path: "Sources/SwiftSSDP", + swiftSettings: [ + .swiftLanguageMode(.v6), + ] ), .testTarget( name: "SwiftSSDPTests", @@ -32,6 +35,9 @@ let package = Package( path: "Tests/SwiftSSDPTests", resources: [ .copy("Fixtures"), + ], + swiftSettings: [ + .swiftLanguageMode(.v6), ] ), ] diff --git a/README.md b/README.md index 55a9254..4cd17e8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # SwiftSSDP -![Swift 5.9](https://img.shields.io/badge/swift-5.9-orange.svg?style=for-the-badge&logo=swift) +![Swift 6](https://img.shields.io/badge/swift-6-orange.svg?style=for-the-badge&logo=swift) ![Platforms](https://img.shields.io/badge/platforms-iOS%20%7C%20macOS%20%7C%20tvOS-blue.svg?style=for-the-badge&logo=apple) [![CI](https://img.shields.io/github/actions/workflow/status/happycodelucky/SwiftSSDP/ci.yml?style=for-the-badge&label=ci)](https://github.com/happycodelucky/SwiftSSDP/actions/workflows/ci.yml) [![Release](https://img.shields.io/github/v/release/happycodelucky/SwiftSSDP?style=for-the-badge)](https://github.com/happycodelucky/SwiftSSDP/releases/latest) @@ -213,10 +213,12 @@ Categories: `discovery`, `transport`, `listener`, `parser`. ## Requirements -- **Swift:** 5.9+ -- **Xcode:** 15+ +- **Swift:** 6.0+ (Swift 6 language mode with strict concurrency checking) +- **Xcode:** 16+ - **Platforms:** iOS 17, macOS 14, tvOS 17 (watchOS not supported — multicast is unavailable on watchOS) +The library compiles cleanly under `-strict-concurrency=complete -warnings-as-errors`. Public API surface is fully `Sendable` so it composes naturally with actor-isolated callers. + ## License MIT — see [LICENSE](LICENSE). diff --git a/Sources/SwiftSSDP/SwiftSSDP.swift b/Sources/SwiftSSDP/SwiftSSDP.swift index e0710af..94b666b 100644 --- a/Sources/SwiftSSDP/SwiftSSDP.swift +++ b/Sources/SwiftSSDP/SwiftSSDP.swift @@ -17,5 +17,5 @@ public enum SwiftSSDP { /// /// > Note: This constant is rewritten by `.github/workflows/release.yml` whenever a /// > release is published. Do not edit it by hand outside of that workflow. - public static let version = "2.0.0" + public static let version = "2.1.0" }