Skip to content

v2.1.0: Swift 6 strict concurrency#20

Merged
happycodelucky merged 1 commit into
v2.0-async-rewritefrom
v2.1-swift6-strict
May 9, 2026
Merged

v2.1.0: Swift 6 strict concurrency#20
happycodelucky merged 1 commit into
v2.0-async-rewritefrom
v2.1-swift6-strict

Conversation

@happycodelucky

Copy link
Copy Markdown
Owner

Stacked on #19 (v2.0-async-rewrite). This PR shows only the strict-concurrency change. Rebase onto master once #19 merges.

Bumps the package to swift-tools-version:6.0 and enables Swift 6 language mode (strict concurrency checking) on all targets via swiftLanguageMode(.v6).

What changed

The library compiles clean under both default Swift 6 mode and the maximally-strict -strict-concurrency=complete -warnings-as-errors combination — no source changes required. The v2.0 rewrite was already concurrency-correct by design; this PR just turns on enforcement.

Why no source fixes were needed

The v2 rewrite was deliberately built strict-concurrency-aware even while skipping the language-mode bump:

  • 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 are Sendable in iOS 17+ SDKs (our floor)
  • @Sendable annotations on 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
swift build --package-path Examples/ssdp-demo ✅ clean

Requirements bump

Now requires Swift 6.0+ / Xcode 16+. Library platforms unchanged. 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).

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@happycodelucky happycodelucky merged commit 2db73b7 into v2.0-async-rewrite May 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant