chore: complete Swift 6 strict concurrency compatibility - #377
Open
NandanPrabhu wants to merge 1 commit into
Open
chore: complete Swift 6 strict concurrency compatibility#377NandanPrabhu wants to merge 1 commit into
NandanPrabhu wants to merge 1 commit into
Conversation
5 tasks
NandanPrabhu
force-pushed
the
chore/swift-6-strict-concurrency
branch
from
August 7, 2026 07:09
ed56013 to
6d8d61b
Compare
The library sources already carried full Sendable conformance, but the build configuration did not compile them in Swift 6 language mode, so regressions could land unnoticed. - Set SWIFT_VERSION to 6.0 across all Xcode project configurations. This is what Carthage consumers compile against; it was still 5.0. - Remove the .v5 language mode override on the SPM test target so tests compile in Swift 6 mode along with the library. - Drop the now-invalid @retroactive on the JWTDecodeError: Equatable test conformance (the type is in the same package). Verified: all five Xcode schemes build and test, swift test (58 tests), pod lib lint on all six platforms, and a downstream SPM consumer built with -strict-concurrency=complete -warnings-as-errors.
NandanPrabhu
force-pushed
the
chore/swift-6-strict-concurrency
branch
from
August 7, 2026 10:55
6d8d61b to
74199de
Compare
NandanPrabhu
marked this pull request as ready for review
August 7, 2026 11:04
subhankarmaiti
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 Changes
Apps that depend on JWTDecode with strict Swift concurrency enabled should build successfully. The library sources already carried full
Sendableconformance (added in #329), but the build configuration never compiled them in Swift 6 language mode — so nothing was enforcing that property, and regressions could land unnoticed.No public API changes.
SWIFT_VERSION5.0 → 6.0 across all 20 Xcode project configurationsThis is the consumer-facing gap. Carthage consumers compile the sources through
JWTDecode.xcodeproj, so the library was being built in Swift 5 language mode regardless of theSendableannotations on the types.Removed the
.swiftLanguageMode(.v5)override on the SPM test targetWith
swift-tools-version:6.0the target now inherits Swift 6 mode, so the tests compile under the same language mode as the library rather than opting out of it.Removed the now-invalid
@retroactiveon theJWTDecodeError: Equatabletest conformance@retroactiveonly applies to conformances declared outside the type's own module;JWTDecodeErroris in the same package, so this is an error under Swift 6. It was the one real compile error in the repo, and it was only hidden by the.v5pin above.📎 References
Sendableconformances this PR makes the build system actually enforce.chore: bump minimum deployment targets) also targetsmasterand edits the sameproject.pbxprojbuild configuration blocks (*_DEPLOYMENT_TARGETthere,SWIFT_VERSIONhere), so whichever merges second will likely need a rebase.🎯 Testing
The existing 58 tests now execute in Swift 6 language mode rather than Swift 5, which is the main test-side coverage change — the assertions are unchanged, but they now run under the concurrency checking this PR enables.
Verified locally:
swift test— 58 testspod lib lint— passes on all six platformsDownstream consumer check. Since the goal is stated in terms of consumer apps, I verified against a separate SPM package built with
-strict-concurrency=complete -warnings-as-errorsin Swift 6 mode, exercising the cases a strict-concurrency app would hit:JWTintoMainActor.runandTask.detachedClaimacross an isolation boundaryJWTin a@MainActor-isolated classJWT,Claim,body, andheaderto a<T: Sendable>genericJWTDecodeErroracross an isolation boundaryAll compile with no warnings.