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/Example/Project.swift b/Example/Project.swift index fddc9803d..4b5141583 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])), ] @@ -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 20c564778..cefc3927e 100644 --- a/Example/README.md +++ b/Example/README.md @@ -93,15 +93,16 @@ 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 -./setup.sh +./setup.sh --compute xcodebuild build \ -workspace Example.xcworkspace \ @@ -111,11 +112,13 @@ xcodebuild build \ CODE_SIGNING_ALLOWED=NO ``` -Run the overlay script again after you switch Xcode. To use another overlay -file, set `OPENSWIFTUI_XR_OVERLAY`. +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. CoreSVG, SFSymbols, and Gestures are -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 947799822..eb6d2b266 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "69a181e9575f1096a84f754e4f3c80a603ea84422f8db2661388dab939fe6b97", + "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 2147284c7..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") @@ -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]) ) ) } 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. 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"