From 1fd55f631724210992d8ce485fe0118ebde86126 Mon Sep 17 00:00:00 2001 From: Jackson Coxson Date: Tue, 25 Feb 2025 21:16:42 -0700 Subject: [PATCH] Fix compiling by features --- idevice/Cargo.toml | 3 ++- idevice/src/lib.rs | 2 +- idevice/src/mounter.rs | 7 ++++++- justfile | 4 ++++ 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 justfile diff --git a/idevice/Cargo.toml b/idevice/Cargo.toml index 3ea3534..6985561 100644 --- a/idevice/Cargo.toml +++ b/idevice/Cargo.toml @@ -40,7 +40,7 @@ core_device_proxy = ["dep:serde_json", "dep:json", "dep:byteorder"] heartbeat = [] installation_proxy = [] mounter = ["dep:sha2"] -usbmuxd = [] +usbmuxd = ["tokio/net"] tcp = ["tokio/net"] tss = ["dep:uuid", "dep:reqwest"] tunneld = ["dep:serde_json", "dep:json", "dep:reqwest"] @@ -50,6 +50,7 @@ xpc = [ "dep:uuid", "dep:async-recursion", "dep:base64", + "dep:json", ] full = [ "core_device_proxy", diff --git a/idevice/src/lib.rs b/idevice/src/lib.rs index 9c2acb1..3d13b02 100644 --- a/idevice/src/lib.rs +++ b/idevice/src/lib.rs @@ -283,7 +283,7 @@ pub enum IdeviceError { #[error("image not mounted")] ImageNotMounted, - #[cfg(feature = "tss")] + #[cfg(any(feature = "tss", feature = "tunneld"))] #[error("http reqwest error")] Reqwest(#[from] reqwest::Error), diff --git a/idevice/src/mounter.rs b/idevice/src/mounter.rs index 048e99a..96c2b95 100644 --- a/idevice/src/mounter.rs +++ b/idevice/src/mounter.rs @@ -3,7 +3,10 @@ use log::debug; use openssl::sha::Sha384; -use crate::{lockdownd::LockdowndClient, tss::TSSRequest, Idevice, IdeviceError, IdeviceService}; +use crate::{lockdownd::LockdowndClient, Idevice, IdeviceError, IdeviceService}; + +#[cfg(feature = "tss")] +use crate::tss::TSSRequest; /// Manages mounted images on the idevice. /// NOTE: A lockdown client must be established and queried after establishing a mounter client, or @@ -318,6 +321,7 @@ impl ImageMounter { Ok(()) } + #[cfg(feature = "tss")] pub async fn mount_personalized( &mut self, provider: &dyn crate::provider::IdeviceProvider, @@ -340,6 +344,7 @@ impl ImageMounter { .await } + #[cfg(feature = "tss")] /// Calling this has the potential of closing the socket, /// so a provider is required for this abstraction. #[allow(clippy::too_many_arguments)] // literally nobody asked diff --git a/justfile b/justfile new file mode 100644 index 0000000..34e46e4 --- /dev/null +++ b/justfile @@ -0,0 +1,4 @@ +check-features: + cd idevice + cargo hack check --feature-powerset --no-dev-deps + cd ..