Skip to content

Sema: Relax availability checking for @MainActor#64412

Merged
tshortli merged 1 commit intoswiftlang:mainfrom
tshortli:relax-unsafe-main-actor-availability-checking
Mar 17, 2023
Merged

Sema: Relax availability checking for @MainActor#64412
tshortli merged 1 commit intoswiftlang:mainfrom
tshortli:relax-unsafe-main-actor-availability-checking

Conversation

@tshortli
Copy link
Copy Markdown
Contributor

@tshortli tshortli commented Mar 16, 2023

The @MainActor global actor constraint on a declaration does not carry an inherent ABI impact and therefore use of this constraint should not be limited to OS versions where Swift concurrency is available.

This fixes a regression (introduced by #60672) in swiftinterface typechecking for modules that contain public types that implicitly inherit a @MainActor attribute.

Resolves rdar://105610970

@tshortli tshortli force-pushed the relax-unsafe-main-actor-availability-checking branch from 8754638 to 47e32f2 Compare March 16, 2023 15:54
@tshortli tshortli requested a review from DougGregor March 16, 2023 15:56
@tshortli tshortli marked this pull request as ready for review March 16, 2023 15:58
@tshortli tshortli force-pushed the relax-unsafe-main-actor-availability-checking branch from 47e32f2 to 11fb3d8 Compare March 16, 2023 21:22
The `@MainActor` global actor constraint on a declaration does not carry an
inherent ABI impact and therefore use of this constraint should not be limited
to OS versions where Swift concurrency is available.

Resolves rdar://105610970
@tshortli tshortli force-pushed the relax-unsafe-main-actor-availability-checking branch from 11fb3d8 to fb03b4a Compare March 16, 2023 21:24
@tshortli
Copy link
Copy Markdown
Contributor Author

@swift-ci please test

@tshortli tshortli changed the title Sema: Relax availability checking for @MainActor(unsafe) Sema: Relax availability checking for @MainActor Mar 16, 2023
@tshortli
Copy link
Copy Markdown
Contributor Author

After discussing with Doug, I've updated the PR to relax availability checking on the @MainActor attribute in general, rather than restricting it to @MainActor(unsafe).

@Kyle-Ye
Copy link
Copy Markdown
Contributor

Kyle-Ye commented Mar 22, 2023

Can we cherry-pick this PR to release/5.8? Otherwise Xcode 14.3 with Swift 5.8.0 will break many downstream xcframeworks consumers. If this is too late for Swift 5.8.0, will it be released with Swift 5.8.1?

@RamblinWreck77
Copy link
Copy Markdown

Upgraded to Xcode 14.3 RC1 today and ran into this issue, I agree with @Kyle-Ye this will likely cause a lot of commotion once 14.3 is fully released (next week?)

@tshortli
Copy link
Copy Markdown
Contributor Author

Cherry-picked to release/5.8: #64538

@tshortli
Copy link
Copy Markdown
Contributor Author

This is fixed in Xcode 14.3 RC 2: Xcode 14.3 RC 2 Release Notes | Apple Developer Documentation

KishanBagaria added a commit to TextsHQ/platform-imessage that referenced this pull request Apr 13, 2023
known issue in xcode 14.3

swiftlang/swift#64412

cannot fix without compiler changes
@tiwoc
Copy link
Copy Markdown

tiwoc commented Jun 6, 2023

This bug seems to be back in Xcode 15 beta 1 (15A5160n) with Swift 5.9.0.114.6. I'm seeing the "this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)', while this compiler is 'Apple Swift version 5.9 (swiftlang-5.9.0.114.6 clang-1500.0.27.1)')" error in a project that compiled fine with Xcode 14.3.1 (Swift 5.8), and with an XCFramework that was definitely built with BUILD_LIBRARY_FOR_DISTRIBUTION turned on.

Has the fix not made it to the Swift 5.9 branch yet? 🤔

@tshortli
Copy link
Copy Markdown
Contributor Author

tshortli commented Jun 7, 2023

@tiwoc Seeing this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)', while this compiler is 'Apple Swift version 5.9 (swiftlang-5.9.0.114.6 clang-1500.0.27.1)') by itself doesn't indicate that you're seeing the issue that was reported and fixed here. That error message is a generic error message printed by the compiler whenever it can't build a module from its swiftinterface for any reason, and there are myriad reasons why a swiftinterface might be unbuildable.

I recommend either filing a GitHub issue or a Feedback with the full build log that includes the errors that were emitted before the this SDK is not supported message and also a reproducer project if possible.

@tiwoc
Copy link
Copy Markdown

tiwoc commented Jun 7, 2023

Thanks for the clarification, @tshortli!

KishanBagaria added a commit to beeper/BetterSwiftAX that referenced this pull request Jun 9, 2024
known issue in xcode 14.3

swiftlang/swift#64412

cannot fix without compiler changes
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.

4 participants