Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/stdout_renderer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 8 additions & 6 deletions Example/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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])),
]

Expand Down Expand Up @@ -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)",
],
Expand Down
21 changes: 12 additions & 9 deletions Example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion INTEGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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]))
)
}

Expand All @@ -299,6 +298,7 @@ if linkBacklightServices {
)
}
if linkGestures {
// TODO: Add visionOS support
sharedSwiftSettings.append(
.define("OPENSWIFTUI_LINK_GESTURES", .when(platforms: [.iOS, .macOS]))
)
Expand Down Expand Up @@ -418,7 +418,7 @@ extension Target {
.product(
name: "CoreSVG",
package: "DarwinPrivateFrameworks",
condition: .when(platforms: [.iOS, .macOS])
condition: .when(platforms: [.iOS, .macOS, .visionOS])
)
)
}
Expand All @@ -428,7 +428,7 @@ extension Target {
.product(
name: "SFSymbols",
package: "DarwinPrivateFrameworks",
condition: .when(platforms: [.iOS, .macOS])
condition: .when(platforms: [.iOS, .macOS, .visionOS])
)
)
}
Expand All @@ -438,7 +438,7 @@ extension Target {
.product(
name: "FeatureFlags",
package: "DarwinPrivateFrameworks",
condition: .when(platforms: [.iOS, .macOS])
condition: .when(platforms: [.iOS, .macOS, .visionOS])
)
)
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion Renderer/Stdout/configure-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Scripts/CI/compute_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions mise.compute.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Loading