Skip to content

Commit 3dd07c4

Browse files
authored
Cargo crate patches needed for visionOS networking support (#103)
* Cargo crate patches needed for visionOS networking support * Update CI visionOS
1 parent 4b7d303 commit 3dd07c4

File tree

4 files changed

+32
-13
lines changed

4 files changed

+32
-13
lines changed

.cargo/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[target.aarch64-apple-ios-sim]
22
runner = "cargo dinghy -p auto-ios-aarch64-sim runner --"
33

4+
[target.aarch64-apple-visionos-sim]
5+
runner = "cargo dinghy -p auto-visionos-aarch64-sim runner --"
6+
47
[target.x86_64-apple-ios]
58
runner = "cargo dinghy -p auto-ios-x86_64 runner --"
69

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ jobs:
9292
x86_64-apple-ios
9393
aarch64-apple-darwin
9494
x86_64-apple-darwin
95+
- uses: maxim-lobanov/[email protected]
96+
with:
97+
xcode-version: latest-stable
98+
9599

96100
- uses: taiki-e/install-action@v2
97101
with:

Cargo.toml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ members = [
88
version = "0.3.0-alpha"
99
rust-version = "1.64"
1010
authors = [
11-
"Paul Schoenfelder <[email protected]>",
12-
"Thomas Sieverding <[email protected]>",
11+
"Paul Schoenfelder <[email protected]>",
12+
"Thomas Sieverding <[email protected]>",
1313
"Elle Imhoff <[email protected]>"
1414
]
1515
description = "Provides core, cross-platform functionality for LiveView Native implementations"
@@ -38,8 +38,18 @@ debug = 1
3838

3939

4040
[patch.crates-io]
41-
# Work for https://github.com/sfackler/rust-native-tls/pull/285 hasn't been published to crates.io yet.
42-
native-tls = { git = "https://github.com/sfackler/rust-native-tls", rev = "0b69ce6a3c4bfe973ede44f6862fc13f3f09c773" }
43-
# work for https://github.com/kornelski/rust-security-framework/pull/190 hasn't been published to crates.io yet.
44-
security-framework = { git = "https://github.com/kornelski/rust-security-framework/", rev = "54d905027e50ec4f0969824efa8e34581922a1f4" }
45-
security-framework-sys = { git = "https://github.com/kornelski/rust-security-framework/", rev = "54d905027e50ec4f0969824efa8e34581922a1f4" }
41+
# https://github.com/sfackler/rust-native-tls/pull/294
42+
native-tls = { git = "https://github.com/simlay/rust-native-tls.git", branch = "add-visionos-support" }
43+
44+
# https://github.com/kornelski/rust-security-framework/pull/201
45+
security-framework = { git = "https://github.com/simlay/rust-security-framework.git", branch = "add-visionos-support" }
46+
security-framework-sys = { git = "https://github.com/simlay/rust-security-framework.git", branch = "add-visionos-support" }
47+
48+
# https://github.com/tokio-rs/mio/pull/1773 and backport PR.
49+
mio = { git = "https://github.com/simlay/mio.git", rev = "7b8b2e605ad64bcabf1f0af4366aa404a8b6bbdc" }
50+
51+
# https://github.com/rust-lang/socket2/pull/503
52+
socket2 = { git = "https://github.com/QuentinPerez/socket2.git", rev = "ca3a93088857b40c27e98d1690f242a7ba8da4dc" }
53+
54+
# https://github.com/tokio-rs/tokio/pull/6465 hasn't been published yet
55+
tokio = { git = "https://github.com/tokio-rs/tokio.git", rev = "6fcd9c02176bf3cd570bc7de88edaa3b95ea480a"}

Makefile.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ args = [
127127
"--target", "aarch64-apple-ios-sim",
128128
"--target", "x86_64-apple-ios",
129129

130-
#"--target", "aarch64-apple-visionos",
131-
#"--target", "aarch64-apple-visionos-sim",
132130
"-p", "liveview-native-core"
133131
]
134132
dependencies = ["install-targets"]
@@ -151,6 +149,9 @@ args = [
151149
"--target", "aarch64-apple-watchos",
152150
"--target", "x86_64-apple-watchos-sim",
153151

152+
"--target", "aarch64-apple-visionos",
153+
"--target", "aarch64-apple-visionos-sim",
154+
154155
"--target", "aarch64-apple-tvos",
155156
"--target", "aarch64-apple-tvos-sim",
156157
"--target", "x86_64-apple-tvos",
@@ -378,12 +379,12 @@ args = [
378379
"-headers", "${CARGO_TARGET_DIR}/uniffi/swift/generated",
379380

380381
# visionOS
381-
#"-library", "${CARGO_TARGET_DIR}/aarch64-apple-visionos/${CARGO_BUILD_TYPE}/libliveview_native_core.a",
382-
#"-headers", "${CARGO_TARGET_DIR}/uniffi/swift/generated",
382+
"-library", "${CARGO_TARGET_DIR}/aarch64-apple-visionos/${CARGO_BUILD_TYPE}/libliveview_native_core.a",
383+
"-headers", "${CARGO_TARGET_DIR}/uniffi/swift/generated",
383384

384385
# visionOS sim
385-
#"-library", "${CARGO_TARGET_DIR}/aarch64-apple-visionos-sim/${CARGO_BUILD_TYPE}/libliveview_native_core.a",
386-
#"-headers", "${CARGO_TARGET_DIR}/uniffi/swift/generated",
386+
"-library", "${CARGO_TARGET_DIR}/aarch64-apple-visionos-sim/${CARGO_BUILD_TYPE}/libliveview_native_core.a",
387+
"-headers", "${CARGO_TARGET_DIR}/uniffi/swift/generated",
387388
]
388389
dependencies = [
389390
"build-apple-std-targets",
@@ -410,6 +411,7 @@ dependencies = [
410411
"uniffi-swift-test-ios",
411412
"uniffi-swift-test-macos",
412413
"uniffi-swift-test-watchos",
414+
#"uniffi-swift-test-visionos", # TODO: uncomment this when the default xcode is 15.2 for github CI images.
413415
]
414416

415417
[tasks.uniffi-swift-test-package]

0 commit comments

Comments
 (0)