Skip to content

Introduce visionOS Platform #72834

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 1 commit into from
Apr 15, 2024
Merged

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Apr 4, 2024

This change adds a new compilation target platform to the Swift compiler - visionOS.

  • Changes to the compiler build infrastrucuture to support building compiler-adjacent artifacts and test suites for the new target.
  • Addition of the new platform kind definition.
  • Support for the new platform in language constructs such as compile-time availability annotations or runtime OS version queries.
  • Utilities to read out Darwin platform SDK info containing platform mapping data.
  • Utilities to support re-mapping availability annotations from iOS to visionOS (e.g. updateIntroducedPlatformForFallback, updateDeprecatedPlatformForFallback, updateObsoletedPlatformForFallback).
  • Additional tests exercising platform-specific availability handling and availability re-mapping fallback code-path.
  • Changes to existing test suite to accommodate the new platform.

Copy link
Contributor

@tshortli tshortli left a comment

Choose a reason for hiding this comment

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

🍾

@@ -72,6 +72,8 @@ static const SupportedConditionalValue SupportedConditionalCompilationOSs[] = {
"tvOS",
"watchOS",
"iOS",
"visionOS",
"xrOS",
Copy link
Contributor

Choose a reason for hiding this comment

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

I forget - did we implement migration warnings from the toolchain name to the platform name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we have, but we really ought to. I will take a look at that once this change lands.

@Azoy
Copy link
Contributor

Azoy commented Apr 4, 2024

Why are some uses in the stdlib using visionOS and some are using xrOS?

@nkcsgexi
Copy link
Contributor

nkcsgexi commented Apr 4, 2024

🎉

@harlanhaskins
Copy link
Contributor

I know this is probably unrealistic but it would be really nice if all the variable names used in build scripts and such could also be switched to VISIONOS instead of XROS, basically leaving "xros" and "xrsimulator" as nothing but the fallback names and the names used in the SDK directories for legacy reasons?

@artemcm artemcm force-pushed the UpstreamVisionOS branch from a598e0e to 05a3c00 Compare April 4, 2024 17:08
@artemcm
Copy link
Contributor Author

artemcm commented Apr 4, 2024

Why are some uses in the stdlib using visionOS and some are using xrOS?

I've changed stdlib sources to be consistent on visionOS.

@artemcm artemcm force-pushed the UpstreamVisionOS branch from 05a3c00 to 9bf593b Compare April 4, 2024 17:19
@artemcm artemcm force-pushed the UpstreamVisionOS branch from 9bf593b to 01931ab Compare April 4, 2024 17:25
@artemcm
Copy link
Contributor Author

artemcm commented Apr 4, 2024

I know this is probably unrealistic but it would be really nice if all the variable names used in build scripts and such could also be switched to VISIONOS instead of XROS, basically leaving "xros" and "xrsimulator" as nothing but the fallback names and the names used in the SDK directories for legacy reasons?

I'm very keen to reach the same end-state. Though it will have happen at the LLVM-level first for the API surface. In the meantime, we can chip away at a lot of the config code here as well, which I'd like to do post-merge.

@artemcm artemcm force-pushed the UpstreamVisionOS branch 2 times, most recently from d89d9e3 to e47976c Compare April 4, 2024 21:29
@artemcm
Copy link
Contributor Author

artemcm commented Apr 5, 2024

@artemcm artemcm force-pushed the UpstreamVisionOS branch from e47976c to addd234 Compare April 5, 2024 16:17
@artemcm
Copy link
Contributor Author

artemcm commented Apr 5, 2024

1 similar comment
@artemcm
Copy link
Contributor Author

artemcm commented Apr 5, 2024

@artemcm artemcm force-pushed the UpstreamVisionOS branch 2 times, most recently from b9dc540 to d16f50b Compare April 8, 2024 19:20
@artemcm
Copy link
Contributor Author

artemcm commented Apr 8, 2024

@artemcm artemcm force-pushed the UpstreamVisionOS branch from d16f50b to 01c56fe Compare April 8, 2024 23:03
@artemcm
Copy link
Contributor Author

artemcm commented Apr 8, 2024

@swift-ci test

This change introduces a new compilation target platform to the Swift compiler - visionOS.

- Changes to the compiler build infrastrucuture to support building compiler-adjacent artifacts and test suites for the new target.
- Addition of the new platform kind definition.
- Support for the new platform in language constructs such as compile-time availability annotations or runtime OS version queries.
- Utilities to read out Darwin platform SDK info containing platform mapping data.
- Utilities to support re-mapping availability annotations from iOS to visionOS (e.g. 'updateIntroducedPlatformForFallback', 'updateDeprecatedPlatformForFallback', 'updateObsoletedPlatformForFallback').
- Additional tests exercising platform-specific availability handling and availability re-mapping fallback code-path.
- Changes to existing test suite to accomodate the new platform.
@artemcm
Copy link
Contributor Author

artemcm commented Apr 10, 2024

@swift-ci test

@artemcm artemcm merged commit 01d891a into swiftlang:main Apr 15, 2024
@artemcm artemcm deleted the UpstreamVisionOS branch April 15, 2024 16:33
grynspan pushed a commit to swiftlang/swift-testing that referenced this pull request May 21, 2024
#424)

Since swiftlang/swift#72834, the Swift compiler
supports visionOS availability annotations. For completeness, add this
platform to existing tests which declare Apple platform availability.
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.

9 participants