From f551ddbe9cbc0c4d8f08fea96a0e84c377e4beb6 Mon Sep 17 00:00:00 2001 From: Vlad Panfilov Date: Tue, 2 Jun 2026 10:20:16 -0700 Subject: [PATCH] bindings/swift: fix iOS build errors in fs_util and logger MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fs_util/Cargo.toml: add ios to the libc target cfg so the crate links correctly when cross-compiling for iOS targets - fs_util/src/safe_move.rs: extend blocking_rename_no_replace_atomic cfg to any(macos, ios) — renamex_np has been available on iOS 10+ - service/src/logger/mod.rs: route ios through stdout.rs, resolving the pre-existing TODO comment (cherry picked from commit 51f3aacca6f36ffe7cf38e8f3b8e4d57132e1915) --- fs_util/Cargo.toml | 2 +- fs_util/src/safe_move.rs | 2 +- service/src/logger/mod.rs | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/fs_util/Cargo.toml b/fs_util/Cargo.toml index dfbe489c9..d9067875b 100644 --- a/fs_util/Cargo.toml +++ b/fs_util/Cargo.toml @@ -13,7 +13,7 @@ tokio = { workspace = true, features = ["fs", "io-util", "rt", "sync"] } tokio-stream = { workspace = true } walkdir = "2.5.0" -[target.'cfg(any(target_os = "linux", target_os = "android", target_os = "macos"))'.dependencies] +[target.'cfg(any(target_os = "linux", target_os = "android", target_os = "macos", target_os = "ios"))'.dependencies] libc = { workspace = true } [target.'cfg(target_os = "windows")'.dependencies] diff --git a/fs_util/src/safe_move.rs b/fs_util/src/safe_move.rs index 687e7394c..55484ad75 100644 --- a/fs_util/src/safe_move.rs +++ b/fs_util/src/safe_move.rs @@ -143,7 +143,7 @@ fn blocking_rename_no_replace_atomic(src: &Path, dst: &Path) -> io::Result<()> { } } -#[cfg(target_os = "macos")] +#[cfg(any(target_os = "macos", target_os = "ios"))] fn blocking_rename_no_replace_atomic(src: &Path, dst: &Path) -> io::Result<()> { use std::ffi::CString; diff --git a/service/src/logger/mod.rs b/service/src/logger/mod.rs index 59540b991..1a0d09dbd 100644 --- a/service/src/logger/mod.rs +++ b/service/src/logger/mod.rs @@ -5,12 +5,10 @@ mod format; #[path = "android.rs"] mod output; -#[cfg(any(target_os = "linux", target_os = "windows", target_os = "macos"))] +#[cfg(any(target_os = "linux", target_os = "windows", target_os = "macos", target_os = "ios"))] #[path = "stdout.rs"] mod output; -// TODO: ios - pub use color::{LogColor, ParseLogColorError}; pub use format::{LogFormat, ParseLogFormatError};