From e7a8fdf60556576fd63e152e3815043dd92e71ba Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Mon, 28 Sep 2026 16:40:21 +0800 Subject: [PATCH] fix(mobile): link SystemConfiguration and install a rustls provider on iOS The first iOS build failed to link: netdev and system-configuration, pulled in by iroh, need SystemConfiguration.framework, which the generated Xcode project does not list. bundle.iOS.frameworks adds it on `tauri ios init`. Once linked, the app panicked at launch: iroh builds its reqwest client with `rustls-no-provider`, so a process-wide crypto provider must be installed before any client is built. Install ring's, which is already in the tree. Co-Authored-By: Claude --- mobile/src-tauri/Cargo.lock | 1 + mobile/src-tauri/Cargo.toml | 1 + mobile/src-tauri/src/lib.rs | 5 +++++ mobile/src-tauri/tauri.conf.json | 7 ++++++- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mobile/src-tauri/Cargo.lock b/mobile/src-tauri/Cargo.lock index 1a04e177..81fe7712 100644 --- a/mobile/src-tauri/Cargo.lock +++ b/mobile/src-tauri/Cargo.lock @@ -5487,6 +5487,7 @@ version = "0.1.0" dependencies = [ "anyhow", "iroh", + "rustls", "serde", "serde_json", "tauri", diff --git a/mobile/src-tauri/Cargo.toml b/mobile/src-tauri/Cargo.toml index acb569e8..2e812aa4 100644 --- a/mobile/src-tauri/Cargo.toml +++ b/mobile/src-tauri/Cargo.toml @@ -26,6 +26,7 @@ tty7-mobile-proto = { path = "../../crates/tty7-mobile-proto" } anyhow = "1" iroh = "1.2" +rustls = { version = "0.23", default-features = false, features = ["ring"] } serde = { version = "1", features = ["derive"] } serde_json = "1" tauri = { version = "2", features = [] } diff --git a/mobile/src-tauri/src/lib.rs b/mobile/src-tauri/src/lib.rs index 9af6ee91..fa2aabdb 100644 --- a/mobile/src-tauri/src/lib.rs +++ b/mobile/src-tauri/src/lib.rs @@ -392,6 +392,11 @@ async fn pane_close(state: State<'_, Arc>, handle: u32) -> CmdResult<( #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { + // iroh builds its reqwest client with `rustls-no-provider`, which panics + // unless a process-wide provider is installed first. `ring` is the one + // already in the tree. An `Err` means one is installed, which is fine. + let _ = rustls::crypto::ring::default_provider().install_default(); + tauri::Builder::default() .setup(|app| { let dir = app.path().app_data_dir()?; diff --git a/mobile/src-tauri/tauri.conf.json b/mobile/src-tauri/tauri.conf.json index b0dbf488..a4ccf9b3 100644 --- a/mobile/src-tauri/tauri.conf.json +++ b/mobile/src-tauri/tauri.conf.json @@ -31,6 +31,11 @@ "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico" - ] + ], + "iOS": { + "frameworks": [ + "SystemConfiguration" + ] + } } }