From 6fc436cf822edde09de8218b57985dee77f2daf1 Mon Sep 17 00:00:00 2001 From: Kyle Date: Sun, 18 Oct 2026 02:10:11 +0800 Subject: [PATCH 1/4] chore(compute): bump to 0.6.0-bugfix.2 Use the Compute 0.6.0-bugfix.2 binary and source release. Its XCFramework adds visionOS and visionOS Simulator slices. --- .github/workflows/stdout_renderer.yml | 4 ++-- .github/workflows/ubuntu.yml | 2 +- Renderer/Stdout/configure-env.sh | 2 +- Scripts/CI/compute_setup.sh | 2 +- mise.compute.toml | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/stdout_renderer.yml b/.github/workflows/stdout_renderer.yml index 500d8ba06..1ca3546d3 100644 --- a/.github/workflows/stdout_renderer.yml +++ b/.github/workflows/stdout_renderer.yml @@ -135,8 +135,8 @@ jobs: OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE: ${{ matrix.backend == 'Compute' && '1' || '0' }} OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_BINARY: 1 OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_BINARY_REPO: "OpenSwiftUIProject/Compute" - OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_BINARY_VERSION: "0.6.0-bugfix.1" - OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_BINARY_CHECKSUM: "faa4f1598a8b7850a3f68b1b2588ecb15a474e9325195f9fd8a274e3e6132f35" + OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_BINARY_VERSION: "0.6.0-bugfix.2" + OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_BINARY_CHECKSUM: "797980ffbe33759fa4686579dc2f0ba9a3dec8f6f3fee462d92e8e034aa32c92" GH_TOKEN: ${{ github.token }} steps: - name: Mark PR status running diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index e051d81f3..1c5ec91f9 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -42,7 +42,7 @@ jobs: OPENSWIFTUI_OPENATTRIBUTESHIMS_ATTRIBUTEGRAPH: 0 OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE: ${{ matrix.backend == 'IAG' && '1' || '0' }} OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_BINARY: 0 - OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_SOURCE_VERSION: "0.6.0-bugfix.1" + OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_SOURCE_VERSION: "0.6.0-bugfix.2" OPENSWIFTUI_COMPATIBILITY_TEST: 0 OPENSWIFTUI_SWIFT_LOG: 1 OPENSWIFTUI_SWIFT_CRYPTO: 1 diff --git a/Renderer/Stdout/configure-env.sh b/Renderer/Stdout/configure-env.sh index 187c061a5..550e9a1e8 100644 --- a/Renderer/Stdout/configure-env.sh +++ b/Renderer/Stdout/configure-env.sh @@ -9,7 +9,7 @@ Darwin) *) export OPENSWIFTUI_OPENATTRIBUTESHIMS_ATTRIBUTEGRAPH="${OPENSWIFTUI_OPENATTRIBUTESHIMS_ATTRIBUTEGRAPH:-0}" export OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE="${OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE:-1}" - export OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_SOURCE_VERSION="${OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_SOURCE_VERSION:-0.6.0-bugfix.1}" + export OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_SOURCE_VERSION="${OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_SOURCE_VERSION:-0.6.0-bugfix.2}" if [[ -z "${OPENSWIFTUI_LIB_SWIFT_PATH:-}" ]]; then swift_binary="$(readlink -f "$(command -v swift)")" if [[ "$(basename "$swift_binary")" == "swiftly" ]]; then diff --git a/Scripts/CI/compute_setup.sh b/Scripts/CI/compute_setup.sh index 3547be0fb..b5b0bf070 100755 --- a/Scripts/CI/compute_setup.sh +++ b/Scripts/CI/compute_setup.sh @@ -14,7 +14,7 @@ clone_checkout_compute() { revision=$(Scripts/CI/get_revision.sh compute 2>/dev/null || true) fi if [ -z "$revision" ]; then - revision="0.6.0-bugfix.1" + revision="0.6.0-bugfix.2" fi cd .. if [ ! -d Compute ]; then diff --git a/mise.compute.toml b/mise.compute.toml index b80e5e5fa..660316edd 100644 --- a/mise.compute.toml +++ b/mise.compute.toml @@ -7,7 +7,7 @@ OPENSWIFTUI_OPENATTRIBUTESHIMS_ATTRIBUTEGRAPH = "0" OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE = "1" OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_BINARY = { default = "1" } OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_BINARY_REPO = "OpenSwiftUIProject/Compute" -OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_BINARY_VERSION = "0.6.0-bugfix.1" -OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_BINARY_CHECKSUM = "faa4f1598a8b7850a3f68b1b2588ecb15a474e9325195f9fd8a274e3e6132f35" -OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_SOURCE_VERSION = "0.6.0-bugfix.1" +OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_BINARY_VERSION = "0.6.0-bugfix.2" +OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_BINARY_CHECKSUM = "797980ffbe33759fa4686579dc2f0ba9a3dec8f6f3fee462d92e8e034aa32c92" +OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE_SOURCE_VERSION = "0.6.0-bugfix.2" # OPENSWIFTUI_USE_LOCAL_DEPS = "1" From 423200e52ae0f397325239250ce6107e125dca61 Mon Sep 17 00:00:00 2001 From: Kyle Date: Sun, 18 Oct 2026 02:14:50 +0800 Subject: [PATCH 2/4] docs(example): use the Compute backend for the visionOS setup --- Example/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Example/README.md b/Example/README.md index 20c564778..0009425d6 100644 --- a/Example/README.md +++ b/Example/README.md @@ -101,7 +101,7 @@ Run from `OpenSwiftUI/Example`, with the same Xcode for all steps: ```shell ../../DarwinPrivateFrameworks/Scripts/XR/install_xr_uikit_overlay.sh -./setup.sh +./setup.sh --compute xcodebuild build \ -workspace Example.xcworkspace \ @@ -111,8 +111,9 @@ xcodebuild build \ CODE_SIGNING_ALLOWED=NO ``` -Run the overlay script again after you switch Xcode. To use another overlay -file, set `OPENSWIFTUI_XR_OVERLAY`. +The `--compute` setup uses the Compute backend, whose binary includes visionOS +slices. Run the overlay script again after you switch Xcode. To use another +overlay file, set `OPENSWIFTUI_XR_OVERLAY`. Only the visionOS Simulator is supported. CoreSVG, SFSymbols, and Gestures are not linked on visionOS. From 6e812e8fd81ad16bb037f08d988fddde51f22e72 Mon Sep 17 00:00:00 2001 From: Kyle Date: Sun, 18 Oct 2026 03:30:15 +0800 Subject: [PATCH 3/4] build(visionos): link CoreSVG, SFSymbols, and FeatureFlags on visionOS DarwinPrivateFrameworks now provides visionOS slices for CoreSVG, SFSymbols, and FeatureFlags. Enable their product dependencies and defines on visionOS, matching SwiftUICore on visionOS 2.5, which links all three. Gestures stays limited to iOS and macOS because visionOS 2.5 does not include it. --- Example/Project.swift | 6 +++--- Example/README.md | 3 +-- Package.resolved | 2 +- Package.swift | 14 +++++++------- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Example/Project.swift b/Example/Project.swift index fddc9803d..6802930d4 100644 --- a/Example/Project.swift +++ b/Example/Project.swift @@ -213,9 +213,9 @@ let privateFrameworkDependencies: [TargetDependency] = [ .external(name: "AttributeGraph"), .external(name: "RenderBox"), .external(name: "CoreUI"), - .external(name: "CoreSVG", condition: .when([.ios, .macos])), - .external(name: "SFSymbols", condition: .when([.ios, .macos])), - .external(name: "FeatureFlags", condition: .when([.ios, .macos])), + .external(name: "CoreSVG"), + .external(name: "SFSymbols"), + .external(name: "FeatureFlags"), .external(name: "BacklightServices", condition: .when([.ios, .visionos])), ] diff --git a/Example/README.md b/Example/README.md index 0009425d6..013a39300 100644 --- a/Example/README.md +++ b/Example/README.md @@ -115,8 +115,7 @@ The `--compute` setup uses the Compute backend, whose binary includes visionOS slices. Run the overlay script again after you switch Xcode. To use another overlay file, set `OPENSWIFTUI_XR_OVERLAY`. -Only the visionOS Simulator is supported. CoreSVG, SFSymbols, and Gestures are -not linked on visionOS. +Only the visionOS Simulator is supported. Gestures is not linked on visionOS. #### Simulator Runtime diff --git a/Package.resolved b/Package.resolved index 947799822..6193f91af 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "69a181e9575f1096a84f754e4f3c80a603ea84422f8db2661388dab939fe6b97", + "originHash" : "654fe46d0cbcc7343fed77bd2b90c690783555aae15225975a7184e56047845a", "pins" : [ { "identity" : "darwinprivateframeworks", diff --git a/Package.swift b/Package.swift index 2147284c7..5411f8cd2 100644 --- a/Package.swift +++ b/Package.swift @@ -257,22 +257,21 @@ if linkCoreUI { sharedSwiftSettings.append(.define("OPENSWIFTUI_LINK_COREUI")) } -// CoreSVG, SFSymbols, and Gestures artifacts have no visionOS slices. if linkCoreSVG { sharedSwiftSettings.append( - .define("OPENSWIFTUI_LINK_CORESVG", .when(platforms: [.iOS, .macOS])) + .define("OPENSWIFTUI_LINK_CORESVG", .when(platforms: [.iOS, .macOS, .visionOS])) ) } if linkSFSymbols { sharedSwiftSettings.append( - .define("OPENSWIFTUI_LINK_SFSYMBOLS", .when(platforms: [.iOS, .macOS])) + .define("OPENSWIFTUI_LINK_SFSYMBOLS", .when(platforms: [.iOS, .macOS, .visionOS])) ) } if linkFeatureFlags { sharedSwiftSettings.append( - .define("OPENSWIFTUI_LINK_FEATUREFLAGS", .when(platforms: [.iOS, .macOS])) + .define("OPENSWIFTUI_LINK_FEATUREFLAGS", .when(platforms: [.iOS, .macOS, .visionOS])) ) } @@ -299,6 +298,7 @@ if linkBacklightServices { ) } if linkGestures { + // TODO: Add visionOS support sharedSwiftSettings.append( .define("OPENSWIFTUI_LINK_GESTURES", .when(platforms: [.iOS, .macOS])) ) @@ -418,7 +418,7 @@ extension Target { .product( name: "CoreSVG", package: "DarwinPrivateFrameworks", - condition: .when(platforms: [.iOS, .macOS]) + condition: .when(platforms: [.iOS, .macOS, .visionOS]) ) ) } @@ -428,7 +428,7 @@ extension Target { .product( name: "SFSymbols", package: "DarwinPrivateFrameworks", - condition: .when(platforms: [.iOS, .macOS]) + condition: .when(platforms: [.iOS, .macOS, .visionOS]) ) ) } @@ -438,7 +438,7 @@ extension Target { .product( name: "FeatureFlags", package: "DarwinPrivateFrameworks", - condition: .when(platforms: [.iOS, .macOS]) + condition: .when(platforms: [.iOS, .macOS, .visionOS]) ) ) } From 59b2335cff2bb77bcdfa410d0163e148b1fbf41a Mon Sep 17 00:00:00 2001 From: Kyle Date: Sun, 18 Oct 2026 04:06:15 +0800 Subject: [PATCH 4/4] build(visionos): build for visionOS devices with the UIKit header overlay Bump DarwinPrivateFrameworks to 8a434a2. Its UIKit header overlay now covers the visionOS device SDK and uses the ~/Library/Developer/OpenSwiftUI/XR output directory. Apply the overlay to xros builds in the Example project and update the docs that limited visionOS support to the Simulator. --- Example/Project.swift | 8 +++++--- Example/README.md | 13 ++++++++----- INTEGRATION.md | 2 +- Package.resolved | 4 ++-- Package.swift | 8 ++++---- README.md | 2 +- 6 files changed, 21 insertions(+), 16 deletions(-) diff --git a/Example/Project.swift b/Example/Project.swift index 6802930d4..4b5141583 100644 --- a/Example/Project.swift +++ b/Example/Project.swift @@ -535,9 +535,11 @@ let project = Project( "COMPILATION_CACHE_KEEP_CAS_DIRECTORY": "YES", "COMPILATION_CACHE_REMOTE_SERVICE_PATH": "", "COMPILATION_CACHE_ENABLE_PLUGIN": "NO", - // The public visionOS Simulator SDK marks UIScreen unavailable. Read the UIKit header - // overlay generated by DarwinPrivateFrameworks/Scripts/XR/install_xr_uikit_overlay.sh. - "OPENSWIFTUI_XR_OVERLAY": "$(HOME)/Library/Developer/OpenSwiftUI/XRSimulator/overlay.yaml", + // The public visionOS SDKs mark UIScreen unavailable. Read the UIKit header overlay + // generated by DarwinPrivateFrameworks/Scripts/XR/install_xr_uikit_overlay.sh. + "OPENSWIFTUI_XR_OVERLAY": "$(HOME)/Library/Developer/OpenSwiftUI/XR/overlay.yaml", + "OTHER_CFLAGS[sdk=xros*]": "$(inherited) -ivfsoverlay $(OPENSWIFTUI_XR_OVERLAY)", + "OTHER_SWIFT_FLAGS[sdk=xros*]": "$(inherited) -vfsoverlay $(OPENSWIFTUI_XR_OVERLAY)", "OTHER_CFLAGS[sdk=xrsimulator*]": "$(inherited) -ivfsoverlay $(OPENSWIFTUI_XR_OVERLAY)", "OTHER_SWIFT_FLAGS[sdk=xrsimulator*]": "$(inherited) -vfsoverlay $(OPENSWIFTUI_XR_OVERLAY)", ], diff --git a/Example/README.md b/Example/README.md index 013a39300..cefc3927e 100644 --- a/Example/README.md +++ b/Example/README.md @@ -93,11 +93,12 @@ A UIKit/AppKit hosting example that manually sets up the application lifecycle a - Choose `SwiftUIDebug` configuration to run with SwiftUI - Choose `OpenSwiftUIDebug` configuration to run with OpenSwiftUI -### visionOS Simulator Build +### visionOS Build -The public visionOS SDK marks `UIScreen` unavailable. OpenSwiftUI builds for the -visionOS Simulator with a UIKit header overlay from `DarwinPrivateFrameworks`. -Run from `OpenSwiftUI/Example`, with the same Xcode for all steps: +The public visionOS SDKs mark `UIScreen` unavailable. OpenSwiftUI builds for +visionOS devices and the visionOS Simulator with a UIKit header overlay from +`DarwinPrivateFrameworks`. Run from `OpenSwiftUI/Example`, with the same Xcode +for all steps: ```shell ../../DarwinPrivateFrameworks/Scripts/XR/install_xr_uikit_overlay.sh @@ -111,11 +112,13 @@ xcodebuild build \ CODE_SIGNING_ALLOWED=NO ``` +For a visionOS device, use `-destination 'generic/platform=visionOS'`. + The `--compute` setup uses the Compute backend, whose binary includes visionOS slices. Run the overlay script again after you switch Xcode. To use another overlay file, set `OPENSWIFTUI_XR_OVERLAY`. -Only the visionOS Simulator is supported. Gestures is not linked on visionOS. +Gestures is not linked on visionOS. #### Simulator Runtime diff --git a/INTEGRATION.md b/INTEGRATION.md index e8a834d98..d006aa6f2 100644 --- a/INTEGRATION.md +++ b/INTEGRATION.md @@ -170,7 +170,7 @@ See [Docs/Preview.md](Docs/Preview.md) for Xcode Preview support details. ## Platform-Specific Notes -The current supported platforms are macOS and iOS simulators. The visionOS Simulator is also supported, but it is not tested extensively. CI builds it but does not run tests. A visionOS Simulator build needs a UIKit header overlay. See [visionOS Simulator Build](Example/README.md#visionos-simulator-build). +The current supported platforms are macOS and iOS simulators. visionOS devices and the visionOS Simulator are also supported, but they are not tested extensively. CI builds for the visionOS Simulator but does not run tests. A visionOS build needs a UIKit header overlay. See [visionOS Build](Example/README.md#visionos-build). ## Known Limitations diff --git a/Package.resolved b/Package.resolved index 6193f91af..eb6d2b266 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "654fe46d0cbcc7343fed77bd2b90c690783555aae15225975a7184e56047845a", + "originHash" : "9f990c079300b605f975ab82a6e7af290a8d5b37311967d7f84d1ea01e045b68", "pins" : [ { "identity" : "darwinprivateframeworks", @@ -7,7 +7,7 @@ "location" : "https://github.com/OpenSwiftUIProject/DarwinPrivateFrameworks.git", "state" : { "branch" : "main", - "revision" : "b73f4d8d11e4db082cd4b776b15827b745445b26" + "revision" : "8a434a24b92d41f8eed85bbf3dc4ae7ffe238fe9" } }, { diff --git a/Package.swift b/Package.swift index 5411f8cd2..57d1ae8ca 100644 --- a/Package.swift +++ b/Package.swift @@ -172,12 +172,12 @@ let swiftUIRenderCondition = envBoolValue("SWIFTUI_RENDERER", default: false) let ignoreAvailability = envBoolValue("IGNORE_AVAILABILITY", default: !isVDCDocGenerationBuild && !compatibilityTestCondition) -// The public visionOS Simulator SDK marks UIScreen unavailable. OpenSwiftUI compiles the same -// UIScreen code as iOS, so visionOS Simulator builds read the UIKit header overlay generated by +// The public visionOS SDKs mark UIScreen unavailable. OpenSwiftUI compiles the same UIScreen code +// as iOS, so visionOS builds read the UIKit header overlay generated by // DarwinPrivateFrameworks/Scripts/XR/install_xr_uikit_overlay.sh. Set OPENSWIFTUI_XR_OVERLAY to use a -// different overlay file. visionOS device builds are not supported. +// different overlay file. let xrOverlayPath = envStringValue("XR_OVERLAY").flatMap { $0.isEmpty ? nil : $0 } - ?? "\(NSHomeDirectory())/Library/Developer/OpenSwiftUI/XRSimulator/overlay.yaml" + ?? "\(NSHomeDirectory())/Library/Developer/OpenSwiftUI/XR/overlay.yaml" let enablePrivateImports = envBoolValue("ENABLE_PRIVATE_IMPORTS", default: true) let enableRuntimeConcurrencyCheck = envBoolValue("ENABLE_RUNTIME_CONCURRENCY_CHECK") diff --git a/README.md b/README.md index 099198b44..3d225c348 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ for various platforms: [^3]: Build, test, and deployment with the [stdout renderer](Renderer/Stdout/README.md) are supported. Linux UI framework integration is not available yet. -[^4]: visionOS Simulator support is experimental. CI builds for the visionOS Simulator but does not run tests. A visionOS Simulator build needs a UIKit header overlay. See [visionOS Simulator Build](Example/README.md#visionos-simulator-build). visionOS device builds are not supported. +[^4]: visionOS support is experimental. Builds for visionOS devices and the visionOS Simulator need a UIKit header overlay. See [visionOS Build](Example/README.md#visionos-build). CI builds for the visionOS Simulator but does not run tests. [^5]: iOS Simulator is supported. iOS device builds require the Compute backend. Apple's AttributeGraph backend is limited to the simulator because required device symbols are missing.