From 1a9846599b6a71faf330845847a30f6bf9735898 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Thu, 27 Feb 2025 15:24:18 +0100 Subject: [PATCH] chore(deps): Update objc2 to 0.6 (#2469) --- .changes/objc06.md | 8 ++++++ Cargo.lock | 28 +++++++++---------- plugins/log/Cargo.toml | 4 +-- plugins/opener/Cargo.toml | 4 +-- plugins/opener/src/reveal_item_in_dir.rs | 2 +- plugins/updater/src/updater.rs | 5 +++- .../updater/tests/app-updater/tests/update.rs | 2 -- .../tests/updater-migration/tests/update.rs | 4 --- 8 files changed, 31 insertions(+), 26 deletions(-) create mode 100644 .changes/objc06.md diff --git a/.changes/objc06.md b/.changes/objc06.md new file mode 100644 index 00000000..3d50c8e8 --- /dev/null +++ b/.changes/objc06.md @@ -0,0 +1,8 @@ +--- +log: patch +log-js: patch +opener: patch +opener-js: patch +--- + +Update `objc2` crate to 0.6. No user facing changes. diff --git a/Cargo.lock b/Cargo.lock index 31406b1c..2db92e08 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1866,7 +1866,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -2461,17 +2461,17 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "global-hotkey" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00d88f1be7bf4cd2e61623ce08e84be2dfa4eab458e5d632d3dab95f16c1f64" +checksum = "41fbb3a4e56c901ee66c190fdb3fa08344e6d09593cc6c61f8eb9add7144b271" dependencies = [ "crossbeam-channel", "keyboard-types", - "objc2 0.5.2", - "objc2-app-kit 0.2.2", + "objc2 0.6.0", + "objc2-app-kit 0.3.0", "once_cell", "serde", - "thiserror 1.0.69", + "thiserror 2.0.9", "windows-sys 0.59.0", "x11-dl", ] @@ -3378,7 +3378,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -4869,7 +4869,7 @@ dependencies = [ "once_cell", "socket2", "tracing", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -6728,8 +6728,8 @@ dependencies = [ "byte-unit", "fern", "log", - "objc2 0.5.2", - "objc2-foundation 0.2.2", + "objc2 0.6.0", + "objc2-foundation 0.3.0", "serde", "serde_json", "serde_repr", @@ -6781,8 +6781,8 @@ version = "2.2.5" dependencies = [ "dunce", "glob", - "objc2-app-kit 0.2.2", - "objc2-foundation 0.2.2", + "objc2-app-kit 0.3.0", + "objc2-foundation 0.3.0", "open", "schemars", "serde", @@ -7125,7 +7125,7 @@ dependencies = [ "fastrand", "once_cell", "rustix", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -8155,7 +8155,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] diff --git a/plugins/log/Cargo.toml b/plugins/log/Cargo.toml index e1cec499..c7a7c90b 100644 --- a/plugins/log/Cargo.toml +++ b/plugins/log/Cargo.toml @@ -39,8 +39,8 @@ android_logger = "0.14" [target."cfg(target_os = \"ios\")".dependencies] swift-rs = "1" -objc2 = "0.5" -objc2-foundation = { version = "0.2", default-features = false, features = [ +objc2 = "0.6" +objc2-foundation = { version = "0.3", default-features = false, features = [ "std", "NSString", ] } diff --git a/plugins/opener/Cargo.toml b/plugins/opener/Cargo.toml index 9c5b53c8..06e487d1 100644 --- a/plugins/opener/Cargo.toml +++ b/plugins/opener/Cargo.toml @@ -54,12 +54,12 @@ zbus = { workspace = true } url = { workspace = true } [target."cfg(target_os = \"macos\")".dependencies.objc2-app-kit] -version = "0.2" +version = "0.3" default-features = false features = ["std", "NSWorkspace"] [target."cfg(target_os = \"macos\")".dependencies.objc2-foundation] -version = "0.2" +version = "0.3" default-features = false features = ["std", "NSURL", "NSArray", "NSString"] diff --git a/plugins/opener/src/reveal_item_in_dir.rs b/plugins/opener/src/reveal_item_in_dir.rs index 6d7b9268..6e3dfc2c 100644 --- a/plugins/opener/src/reveal_item_in_dir.rs +++ b/plugins/opener/src/reveal_item_in_dir.rs @@ -185,7 +185,7 @@ mod imp { let path = path.to_string_lossy(); let path = NSString::from_str(&path); let urls = vec![NSURL::fileURLWithPath(&path)]; - let urls = NSArray::from_vec(urls); + let urls = NSArray::from_retained_slice(&urls); let workspace = NSWorkspace::new(); workspace.activateFileViewerSelectingURLs(&urls); diff --git a/plugins/updater/src/updater.rs b/plugins/updater/src/updater.rs index a3e3cb3a..21acc732 100644 --- a/plugins/updater/src/updater.rs +++ b/plugins/updater/src/updater.rs @@ -4,7 +4,7 @@ use std::{ collections::HashMap, - ffi::{OsStr, OsString}, + ffi::OsString, io::Cursor, path::{Path, PathBuf}, str::FromStr, @@ -12,6 +12,9 @@ use std::{ time::Duration, }; +#[cfg(not(target_os = "macos"))] +use std::ffi::OsStr; + use base64::Engine; use futures_util::StreamExt; use http::HeaderName; diff --git a/plugins/updater/tests/app-updater/tests/update.rs b/plugins/updater/tests/app-updater/tests/update.rs index 230ab376..d308b317 100644 --- a/plugins/updater/tests/app-updater/tests/update.rs +++ b/plugins/updater/tests/app-updater/tests/update.rs @@ -63,8 +63,6 @@ fn build_app(cwd: &Path, config: &Config, bundle_updater: bool, target: BundleTa if bundle_updater { #[cfg(windows)] command.args(["--bundles", "msi", "nsis"]); - - command.args(["--bundles", "updater"]); } else { #[cfg(windows)] command.args(["--bundles", target.name()]); diff --git a/plugins/updater/tests/updater-migration/tests/update.rs b/plugins/updater/tests/updater-migration/tests/update.rs index 56cb2d30..813da3c6 100644 --- a/plugins/updater/tests/updater-migration/tests/update.rs +++ b/plugins/updater/tests/updater-migration/tests/update.rs @@ -67,8 +67,6 @@ mod v1 { if bundle_updater { #[cfg(windows)] command.args(["--bundles", "msi", "nsis"]); - - command.args(["--bundles", "updater"]); } else { #[cfg(windows)] command.args(["--bundles", target.name()]); @@ -173,8 +171,6 @@ mod v2 { if bundle_updater { #[cfg(windows)] command.args(["--bundles", "msi", "nsis"]); - - command.args(["--bundles", "updater"]); } else { #[cfg(windows)] command.args(["--bundles", target.name()]);