Skip to content

Commit 598835e

Browse files
Copilotkraenhansen
andcommitted
Revise visionOS workflow to use -Zbuild-std with nightly Rust instead of full compiler bootstrap
Co-authored-by: kraenhansen <1243959+kraenhansen@users.noreply.github.com>
1 parent 8f8d49d commit 598835e

File tree

1 file changed

+33
-29
lines changed

1 file changed

+33
-29
lines changed

.github/workflows/check-visionos.yml

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,41 +22,45 @@ jobs:
2222
- uses: actions/setup-node@v4
2323
with:
2424
node-version: lts/iron
25-
# Bootstrap Rust compiler with visionOS targets (tier 3)
26-
# visionOS targets are not available as prebuilt targets and need to be built from source
27-
- name: Clone Rust repository
28-
run: git clone https://github.com/rust-lang/rust.git rust-source
29-
- name: Configure Rust build for visionOS targets
25+
# Install nightly Rust for -Zbuild-std support (required for tier 3 visionOS targets)
26+
- name: Install Rust nightly with visionOS source
3027
run: |
31-
cd rust-source
32-
cat > config.toml << 'EOF'
33-
[build]
34-
target = ["x86_64-apple-darwin", "aarch64-apple-visionos", "aarch64-apple-visionos-sim"]
35-
36-
[target.aarch64-apple-visionos]
37-
cc = "clang"
38-
cxx = "clang++"
39-
40-
[target.aarch64-apple-visionos-sim]
41-
cc = "clang"
42-
cxx = "clang++"
43-
EOF
44-
- name: Bootstrap Rust with visionOS support
45-
run: |
46-
cd rust-source
47-
./x.py build --target aarch64-apple-visionos,aarch64-apple-visionos-sim
48-
timeout-minutes: 120
49-
- name: Install bootstrapped Rust toolchain
28+
rustup toolchain install nightly --component rust-src
29+
rustup default nightly
30+
# Set up Xcode and visionOS SDK (required for visionOS compilation)
31+
- name: Setup Xcode and verify visionOS SDK
5032
run: |
51-
cd rust-source
52-
./x.py install --target aarch64-apple-visionos,aarch64-apple-visionos-sim
53-
# Also install required iOS targets for the bootstrap process
33+
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
34+
# Verify visionOS SDK is available
35+
if xcrun --sdk xros --show-sdk-path; then
36+
echo "visionOS SDK found at: $(xcrun --sdk xros --show-sdk-path)"
37+
else
38+
echo "⚠️ visionOS SDK not found - may need Xcode 15+ with visionOS support"
39+
fi
40+
# Install required iOS targets for the bootstrap process
5441
- run: rustup target add aarch64-apple-ios-sim
5542
- run: npm ci
5643
- run: npm run build
5744
# Bootstrap host package to get weak-node-api and ferric-example with visionOS support
5845
- run: npm run bootstrap --workspace react-native-node-api
59-
- run: npm run bootstrap --workspace @react-native-node-api/ferric-example
46+
- name: Configure Cargo for visionOS tier 3 targets
47+
run: |
48+
# Create cargo config to enable -Zbuild-std for tier 3 targets
49+
mkdir -p packages/ferric-example/.cargo
50+
cat > packages/ferric-example/.cargo/config.toml << 'EOF'
51+
[unstable]
52+
build-std = ["std", "panic_abort"]
53+
54+
[target.aarch64-apple-visionos]
55+
linker = "clang"
56+
57+
[target.aarch64-apple-visionos-sim]
58+
linker = "clang"
59+
EOF
60+
- name: Bootstrap ferric-example with visionOS targets
61+
run: npm run bootstrap --workspace @react-native-node-api/ferric-example
6062
env:
6163
CMAKE_RN_TRIPLETS: aarch64-apple-visionos,aarch64-apple-visionos-sim
62-
FERRIC_TARGETS: aarch64-apple-visionos,aarch64-apple-visionos-sim
64+
FERRIC_TARGETS: aarch64-apple-visionos,aarch64-apple-visionos-sim
65+
# Set visionOS SDK environment variables
66+
XROS_DEPLOYMENT_TARGET: "1.0"

0 commit comments

Comments
 (0)