From 905dad38674e0d76ba47236883ddffbaaeac4fc4 Mon Sep 17 00:00:00 2001 From: Kyle Date: Sun, 18 Oct 2026 14:43:04 +0800 Subject: [PATCH] build: include visionOS in binary distributions --- .github/actions/build-xcframework/action.yml | 12 ++++++++++++ .github/workflows/build_xcframework.yml | 1 + .github/workflows/release_build.yml | 2 +- Scripts/build_xcframework.sh | 15 ++++++++++----- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/actions/build-xcframework/action.yml b/.github/actions/build-xcframework/action.yml index ead5d9516..de526dad7 100644 --- a/.github/actions/build-xcframework/action.yml +++ b/.github/actions/build-xcframework/action.yml @@ -67,9 +67,21 @@ runs: - name: Set up build environment run: Scripts/CI/darwin_setup_build.sh shell: bash + - name: Install UIKit header overlay + shell: bash + run: | + overlay_dir="${RUNNER_TEMP:-/tmp}/xcframework-xr-uikit-overlay-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT:-0}" + ../DarwinPrivateFrameworks/Scripts/XR/install_xr_uikit_overlay.sh --output "$overlay_dir" + echo "OPENSWIFTUI_XR_OVERLAY=$overlay_dir/overlay.yaml" >> "$GITHUB_ENV" - name: Build XCFrameworks run: Scripts/build_xcframework.sh --compute OpenSwiftUI shell: bash + - name: Clean up UIKit header overlay + if: always() + shell: bash + run: | + overlay_dir="${RUNNER_TEMP:-/tmp}/xcframework-xr-uikit-overlay-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT:-0}" + rm -rf "$overlay_dir" - name: Code sign XCFrameworks if: ${{ inputs.signing-certificate-base64 != '' }} uses: ./.github/actions/codesign-xcframework diff --git a/.github/workflows/build_xcframework.yml b/.github/workflows/build_xcframework.yml index 0785f1179..2d16b03ae 100644 --- a/.github/workflows/build_xcframework.yml +++ b/.github/workflows/build_xcframework.yml @@ -14,6 +14,7 @@ jobs: - self-hosted - macos-15 - xcode-26.6 + - visionos-simulator-2.5 env: OPENSWIFTUI_OPENATTRIBUTESHIMS_ATTRIBUTEGRAPH: 1 OPENSWIFTUI_USE_LOCAL_DEPS: 1 diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml index 17bede78d..4680f4f0b 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release_build.yml @@ -26,7 +26,7 @@ permissions: jobs: build: - runs-on: [self-hosted, macos-15, xcode-26.6] + runs-on: [self-hosted, macos-15, xcode-26.6, visionos-simulator-2.5] outputs: artifact-id: ${{ steps.upload.outputs.artifact-id }} sha: ${{ steps.checkout.outputs.commit }} diff --git a/Scripts/build_xcframework.sh b/Scripts/build_xcframework.sh index 4f87e3a3a..d5be1e013 100755 --- a/Scripts/build_xcframework.sh +++ b/Scripts/build_xcframework.sh @@ -121,15 +121,16 @@ if [ ${#FRAMEWORK_NAMES[@]} -eq 0 ] || FRAMEWORK_NAMES=("${DEFAULT_FRAMEWORK_NAMES[@]}") fi -# Default: macosx and iphonesimulator. Compute builds also include iphoneos. +# Default: macOS, iOS Simulator, and visionOS device and simulator. +# Compute builds also include iphoneos. # Note: iphoneos SDK support is blocked by an AG issue. See #835. if [ ${#SDKS[@]} -eq 0 ]; then if [ "${OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE:-0}" = "1" ]; then - SDKS=("macosx" "iphonesimulator" "iphoneos") - SDK_ARCHS=("" "" "") + SDKS=("macosx" "iphonesimulator" "iphoneos" "xros" "xrsimulator") + SDK_ARCHS=("" "" "" "" "") else - SDKS=("macosx" "iphonesimulator") - SDK_ARCHS=("" "") + SDKS=("macosx" "iphonesimulator" "xros" "xrsimulator") + SDK_ARCHS=("" "" "" "") fi fi @@ -292,6 +293,8 @@ sdk_destination() { iphonesimulator) echo "generic/platform=iOS Simulator" ;; iphoneos) echo "generic/platform=iOS" ;; macosx) echo "generic/platform=macOS" ;; + xros) echo "generic/platform=visionOS" ;; + xrsimulator) echo "generic/platform=visionOS Simulator" ;; *) echo "generic/platform=$1" ;; esac } @@ -598,6 +601,8 @@ copy_debug_symbols() { iphonesimulator) local_dsym_dir=$(ls -d "$(xcframework_path "$scheme")"/ios-*simulator 2>/dev/null | head -1) ;; iphoneos) local_dsym_dir=$(ls -d "$(xcframework_path "$scheme")"/ios-arm64 2>/dev/null | head -1) ;; macosx) local_dsym_dir=$(ls -d "$(xcframework_path "$scheme")"/macos-* 2>/dev/null | head -1) ;; + xros) local_dsym_dir=$(ls -d "$(xcframework_path "$scheme")"/xros-arm64 2>/dev/null | head -1) ;; + xrsimulator) local_dsym_dir=$(ls -d "$(xcframework_path "$scheme")"/xros-*simulator 2>/dev/null | head -1) ;; esac if [ -n "$local_dsym_dir" ] && [ -d "$PROJECT_BUILD_DIR/$scheme-$sdk.xcarchive/dSYMs" ]; then