Repository navigation
Migrate to Swift 6.2 - #51
Draft
DominikPalo wants to merge 7 commits into
Draft
DominikPalo wants to merge 7 commits into
DominikPalo wants to merge 7 commits into
Conversation
Closed
Member
Author
|
One runtime concern remains uncertain because the task-ordering path could not be reproduced. Set aside
Review context
Reviewed with review-anvil. |
Raise the package tools version, enable Swift 6 language mode in the Xcode project, and refresh the resolved package format.
Keep web authentication session state on the main actor and await platform UI presentation across iOS, macOS, and tvOS.
Keep the URLSession delegate callback nonisolated and bridge redirect decisions to OAuth2Actor through an immutable Sendable closure.
Run actor-isolated XCTest methods asynchronously and mark cross-actor dictionary values as Sendable.
Document the new minimum toolchain and run package and Xcode jobs with Swift 6.2.
Select installed simulator devices for iOS and tvOS, use an Xcode 26 release with both runtimes, and update xcresulttool for Xcode 26 support.
DominikPalo
force-pushed
the
codex/migrate-to-swift-6.2
branch
from
September 16, 2026 12:40
c731e60 to
172d411
Compare
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.
Summary
Switch OAuth2 to the Swift 6.2 toolchain and Swift 6 language mode, then address the resulting concurrency diagnostics with focused actor-boundary changes.
Closes #49.
Toolchain and project configuration
swift-tools-versionfrom 5.5 to 6.2.SWIFT_VERSIONto 6.0, which is the Xcode language-mode value for Swift 6.Package.resolvedto the current lockfile format and include the existingswift-logdependency.Concurrency changes
AuthenticationServices UI boundary
ASWebAuthenticationPresentationContextProvidingis main-actor isolated in the current SDK, while the OAuth implementation is protected byOAuth2Actor. The presentation-context providers are now@MainActortypes. Authentication sessions and their providers are constructed and retained by small main-actor session holders, while completion processing explicitly returns toOAuth2Actor.The iOS
authenticationSessionEmbeddedentry point is now async because constructing and starting the authentication session requires a main-actor hop.URLSession redirect delegate
URLSessionTaskDelegatecannot use anOAuth2Actor-isolated conformance because Foundation invokes delegate witnesses from its delegate queue and the protocol has sendability requirements. The delegate is therefore a sendable boundary object with immutable state. Redirect validation, logging, and request signing are captured in an@OAuth2Actor @Sendableclosure and awaited from the Foundation callback.This preserves the existing behavior:
No new
nonisolateddeclaration is introduced. The existingOAuth2AuthConfig.authorizeContextdeclaration remains unchanged.Platform presentation
The iOS and tvOS custom authorizers now expose async presentation methods and await UIKit presentation on the main actor, matching the existing async protocol requirement. Dismissal remains fire-and-forget but performs UIKit work through a task.
Tests
Swift 6 XCTest aborts when synchronous XCTest discovery directly invokes a custom-global-actor-isolated test method. Actor-isolated test entry points are now async so XCTest uses its async executor-aware path. Test response dictionaries that cross actor boundaries use
[String: any Sendable].Verification
Completed locally with Xcode 26.6 / Swift 6.3.3 while targeting the Swift 6.2 manifest and Swift 6 language mode:
swift package resetswift buildswift test— 59 tests passedgit diff --check— passedCI is configured to validate with Xcode 26 and its Swift 6.2 toolchain.