-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Platform request] Is there any plan to open-source the xsOS(Apple VisionOS) PlatformKind support in Swift compiler #68034
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
Comments
@dreampiggy When I build the code that's been tagged for the Swift 5.9 release and subsequently run the Swift compatibility test, I encounter the same error. Do you have any ongoing activities? |
I modify the Swift compiler source code and write the |
@dreampiggy |
@IamYJLee
@avaiable (iOS 10, visionOS 1, *)
class Foobar {} => @avaiable (iOS 10, *)
class Foobar {}
if #available(iOS 10, visionOS 1, *) {} => if #available(iOS 10, *) {} |
Thank you so much.
There is no problem in an arm64 host environment, but in an x86_64 host environment, another crash occurs in the swift compatibility test, so it is not the correct solution. |
@IamYJLee Any better idea about the fix before Apple release the full xros target support ? Which should be a big work beyond our effort. We just use the open-source compiler on the AST consuming and static analysis domain. So this hack is suitable for us. |
Since the LLVM part is merged-in. I think we can re-call this issue. llvm/llvm-project#77707 |
Motivation
Current Swift compiler on
release/5.9.0
branch, does not contains any xrOS(Apple VisionOS) support code. However, in Swift compiler itself, it contains the support code for each platform for this syntax:And it will encode the
swift::PlatformKind
into the serialized AST (.swiftmodule file)Which means, if the open-source Swift compiler does not contains the support, when loading an Apple's provided swiftmodule (like libswiftFoundation.swiftmodule), will hit the assertion, even if we don't compile for that xrOS platform.
See: https://github.com/apple/swift/blob/d4ee7bffa1f9ff67b5ca717683a316f3a7acb425/lib/AST/PlatformKind.cpp#L104
Compiler assertion here:
Solution
Provide the
PlatformKind::xrOS
support in Swift compiler, which at least should be able to TypeCheck or LoadAST from the swiftmodule provided by AppleFor linker (ld-64) support for xsOS, which is not needed because it's not part of open-source Swift toolchain.
Alternatives considered
Should we just treat this assertions as warning instead ? But I think the assertions is the basic ensure of the compiler's behavior before the final distribution to the developers.
The text was updated successfully, but these errors were encountered: