Skip to content

Swift 6: Room and Track state #652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Apr 1, 2025
Merged

Swift 6: Room and Track state #652

merged 18 commits into from
Apr 1, 2025

Conversation

pblazej
Copy link
Contributor

@pblazej pblazej commented Mar 28, 2025

This is the last 🎉 portion of Swift 6 warnings, mostly around State.

The algorithm is still pretty simple:

  • can be final (internal)/immutable → make it Sendable
  • is already public/inherited → make it @unchecked Sendable

Unit tests are mostly @unchecked because of inheritance, IMO gradually moving to Swift Testing is more important.

Fortunately, for most generic/async stuff T: Sendable is just works (tm), just needs proper annotations.

@@ -18,7 +18,7 @@

import Foundation

enum BroadcastBundleInfo {
actor BroadcastBundleInfo {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also mostly for the static state (including "mutable" property wrappers below).

@pblazej pblazej marked this pull request as ready for review March 31, 2025 10:41
@pblazej pblazej requested review from hiroshihorie and ladvoc March 31, 2025 10:41
Copy link
Contributor

@ladvoc ladvoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great PR, there are just two warnings remaining:

  • SampleBufferVideoRenderer.swift:L96: “capture of 'sampleBuffer' with non-sendable type 'CMSampleBuffer' in a @Sendable closure”
  • ARCameraCaptureOptions:L27: “non-final class 'ARCameraCaptureOptions' cannot conform to 'Sendable'; use '@unchecked Sendable”

@pblazej
Copy link
Contributor Author

pblazej commented Apr 1, 2025

There's some stubborn Vision Pro sim:

xctest encountered an error (Failed to prepare device 'Apple Vision Pro' for impending launch. (Underlying Error: Timed out trying to boot simulator after waiting 60.00s.))

Does not seem related to the PR itself, I'll merge anyway - keeping an eye on that 🙃

@pblazej pblazej merged commit 9176333 into main Apr 1, 2025
19 of 20 checks passed
@pblazej pblazej deleted the blaze/swift-6-mutable-state branch April 1, 2025 08:55
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.

3 participants