From 067924568778cb250f61bf312487bbd553df1cd2 Mon Sep 17 00:00:00 2001 From: Frizzle <182496942+FrizzleM@users.noreply.github.com> Date: Mon, 9 Nov 2026 12:05:28 +0100 Subject: [PATCH] Build without idevice when the install feature is off `install = ["dep:idevice"]` is meant to be what pulls in idevice, but a few uses sat outside it, so `--no-default-features` without `install` failed to compile: - `use idevice::IdeviceError` and the `SideloadError::IdeviceError` variant in lib.rs - `pub mod device` in util/mod.rs (lockdown-based `IdeviceInfo`) - the `IdeviceInfo`, `IdeviceProvider` and `DevicesApi` imports in sideloader.rs All of them only serve `install_app`, so they now sit behind `#[cfg(feature = "install")]`, like `sideload::install` already does. `delete_app_after_install` is only read by `install_app` and gets `allow(dead_code)` when `install` is off. Turning `install` off also showed that serde's `derive` feature only reached isideload through idevice, so Cargo.toml now asks for it. A `wasm` build without `install` no longer warns about those unused imports and the unread field either. Co-Authored-By: Claude Opus 5.5 --- isideload/Cargo.toml | 2 +- isideload/src/lib.rs | 2 ++ isideload/src/sideload/sideloader.rs | 7 +++++-- isideload/src/util/mod.rs | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/isideload/Cargo.toml b/isideload/Cargo.toml index 29d385e..d16e40e 100644 --- a/isideload/Cargo.toml +++ b/isideload/Cargo.toml @@ -29,7 +29,7 @@ plist-macro = "0.1.4" reqwest = { version = "0.13.2", default-features = false, features = ["json", "gzip", "rustls-no-provider", "http2", "charset", "system-proxy"] } thiserror = "2.0.17" async-trait = "0.1.89" -serde = "1.0.228" +serde = { version = "1.0.228", features = ["derive"] } rand = "0.8.5" uuid = {version = "1.20.0", features = ["v4"] } tracing = "0.1.44" diff --git a/isideload/src/lib.rs b/isideload/src/lib.rs index 0463e2f..63f9f1e 100644 --- a/isideload/src/lib.rs +++ b/isideload/src/lib.rs @@ -1,3 +1,4 @@ +#[cfg(feature = "install")] use idevice::IdeviceError; use rootcause::{ hooks::{Hooks, context_formatter::ContextFormatterHook}, @@ -24,6 +25,7 @@ pub enum SideloadError { #[error("Invalid bundle: {0}")] InvalidBundle(String), + #[cfg(feature = "install")] #[error("{0}")] IdeviceError(#[from] IdeviceError), } diff --git a/isideload/src/sideload/sideloader.rs b/isideload/src/sideload/sideloader.rs index 6ebca5a..bc172d7 100644 --- a/isideload/src/sideload/sideloader.rs +++ b/isideload/src/sideload/sideloader.rs @@ -1,9 +1,10 @@ +#[cfg(feature = "install")] +use crate::{dev::devices::DevicesApi, util::device::IdeviceInfo}; use crate::{ dev::{ app_groups::AppGroupsApi, app_ids::{AppIdsApi, Profile}, developer_session::DeveloperSession, - devices::DevicesApi, teams::{DeveloperTeam, TeamsApi}, }, sideload::{ @@ -15,7 +16,6 @@ use crate::{ }, util::{ callbacks::{ExtensionsBehaviorCallback, MaxCertsCallback}, - device::IdeviceInfo, storage::SideloadingStorage, }, }; @@ -23,6 +23,7 @@ use crate::{ use std::path::PathBuf; use apple_codesign_quick::ProvisioningProfile; +#[cfg(feature = "install")] use idevice::provider::IdeviceProvider; use plist::Dictionary; use rootcause::{option_ext::OptionExt, prelude::*}; @@ -36,6 +37,8 @@ pub struct Sideloader { apple_email: String, max_certs_behavior: MaxCertsBehavior, extensions_behavior: ExtensionsBehaviorSelection, + // Only `install_app` reads it. + #[cfg_attr(not(feature = "install"), allow(dead_code))] delete_app_after_install: bool, team: Option, } diff --git a/isideload/src/util/mod.rs b/isideload/src/util/mod.rs index e1a697c..39b9b6a 100644 --- a/isideload/src/util/mod.rs +++ b/isideload/src/util/mod.rs @@ -1,4 +1,5 @@ pub mod callbacks; +#[cfg(feature = "install")] pub mod device; #[cfg(feature = "fs-storage")] pub mod fs_storage;