Skip to content

Commit 8e44d13

Browse files
authoredOct 25, 2022
Merge pull request #317 from thomcc/tvos-watchos
Add tvOS and watchOS support, identical to iOS support
2 parents 2aabb63 + e32ea82 commit 8e44d13

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed
 

‎.github/workflows/tests.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,14 @@ jobs:
152152
runs-on: macos-latest
153153
steps:
154154
- uses: actions/checkout@v3
155-
- uses: dtolnay/rust-toolchain@stable
155+
- uses: dtolnay/rust-toolchain@nightly
156156
with:
157157
targets: aarch64-apple-darwin, aarch64-apple-ios
158+
components: rust-src
158159
- uses: Swatinem/rust-cache@v2
159160
- run: cargo test --no-run --target=aarch64-apple-darwin --features=std
160161
- run: cargo test --no-run --target=aarch64-apple-ios --features=std
162+
- run: cargo test --no-run --target=aarch64-apple-watchos-sim -Zbuild-std --features=std
161163

162164
cross-link:
163165
name: Cross Build/Link
@@ -273,6 +275,9 @@ jobs:
273275
aarch64-kmc-solid_asp3,
274276
armv6k-nintendo-3ds,
275277
riscv32imc-esp-espidf,
278+
# `std` support still in progress. Can be moved up with the other
279+
# apple targets after https://github.com/rust-lang/rust/pull/103503
280+
aarch64-apple-tvos,
276281
]
277282
include:
278283
# Supported tier 3 targets without libstd support

‎Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ compiler_builtins = { version = "0.1", optional = true }
1818
core = { version = "1.0", optional = true, package = "rustc-std-workspace-core" }
1919

2020
[target.'cfg(unix)'.dependencies]
21-
libc = { version = "0.2.128", default-features = false }
21+
libc = { version = "0.2.136", default-features = false }
2222

2323
[target.'cfg(target_os = "wasi")'.dependencies]
2424
wasi = { version = "0.11", default-features = false }

‎src/ios.rs ‎src/apple-other.rs

File renamed without changes.

‎src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//! | Linux, Android | `*‑linux‑*` | [`getrandom`][1] system call if available, otherwise [`/dev/urandom`][2] after successfully polling `/dev/random`
1616
//! | Windows | `*‑windows‑*` | [`BCryptGenRandom`]
1717
//! | macOS | `*‑apple‑darwin` | [`getentropy`][3] if available, otherwise [`/dev/urandom`][4] (identical to `/dev/random`)
18-
//! | iOS | `*‑apple‑ios` | [`SecRandomCopyBytes`]
18+
//! | iOS, tvOS, watchOS | `*‑apple‑ios`, `*-apple-tvos`, `*-apple-watchos` | [`SecRandomCopyBytes`]
1919
//! | FreeBSD | `*‑freebsd` | [`getrandom`][5] if available, otherwise [`kern.arandom`][6]
2020
//! | OpenBSD | `*‑openbsd` | [`getentropy`][7]
2121
//! | NetBSD | `*‑netbsd` | [`kern.arandom`][8]
@@ -229,8 +229,8 @@ cfg_if! {
229229
#[path = "dragonfly.rs"] mod imp;
230230
} else if #[cfg(target_os = "fuchsia")] {
231231
#[path = "fuchsia.rs"] mod imp;
232-
} else if #[cfg(target_os = "ios")] {
233-
#[path = "ios.rs"] mod imp;
232+
} else if #[cfg(any(target_os = "ios", target_os = "watchos", target_os = "tvos"))] {
233+
#[path = "apple-other.rs"] mod imp;
234234
} else if #[cfg(target_os = "macos")] {
235235
mod util_libc;
236236
mod use_file;

0 commit comments

Comments
 (0)
Please sign in to comment.