swift
Sema: Relax availability checking for `@MainActor`
#64412
Merged

Sema: Relax availability checking for `@MainActor` #64412

tshortli
tshortli2 years ago (edited 2 years ago)🎉 12

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 from 87546381 to 47e32f26 2 years ago
tshortli tshortli requested a review from DougGregor DougGregor 2 years ago
tshortli tshortli marked this pull request as ready for review 2 years ago
tshortli tshortli requested a review from hborla hborla 2 years ago
tshortli tshortli requested a review from slavapestov slavapestov 2 years ago
tshortli tshortli requested a review from xedin xedin 2 years ago
tshortli tshortli force pushed from 47e32f26 to 11fb3d8e 2 years ago
tshortli Sema: Relax availability checking for `@MainActor`.
fb03b4aa
tshortli tshortli force pushed from 11fb3d8e to fb03b4aa 2 years ago
tshortli
tshortli2 years ago

@swift-ci please test

tshortli tshortli changed the title Sema: Relax availability checking for `@MainActor(unsafe)` Sema: Relax availability checking for `@MainActor` 2 years ago
tshortli
tshortli2 years ago

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).

tshortli tshortli merged ca5acf32 into main 2 years ago
tshortli tshortli deleted the relax-unsafe-main-actor-availability-checking branch 2 years ago
Kyle-Ye
Kyle-Ye2 years ago👍 7👀 2

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
RamblinWreck772 years ago

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
tshortli2 years ago❤ 5

Cherry-picked to release/5.8: #64538

tshortli
tshortli2 years ago🎉 3
tiwoc
tiwoc2 years ago

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
tshortli2 years ago

@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
tiwoc2 years ago

Thanks for the clarification, @tshortli!

Login to write a write a comment.

Login via GitHub

Assignees
No one assigned
Labels
Milestone