From 8cf490a8c16dde64eb11c4dce8f0af412932a6d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 17:17:27 +0100 Subject: [PATCH] Extract common cargo info and edition 2024 fix (#13507) --- apps/desktop/desktop_native/Cargo.toml | 6 ++++++ apps/desktop/desktop_native/core/Cargo.toml | 14 ++++++------- .../desktop_native/macos_provider/Cargo.toml | 14 ++++++------- apps/desktop/desktop_native/napi/Cargo.toml | 20 +++++++++---------- apps/desktop/desktop_native/objc/Cargo.toml | 14 ++++++------- apps/desktop/desktop_native/objc/src/lib.rs | 8 ++++---- apps/desktop/desktop_native/proxy/Cargo.toml | 13 ++++++------ .../windows-plugin-authenticator/Cargo.toml | 8 ++++---- 8 files changed, 51 insertions(+), 46 deletions(-) diff --git a/apps/desktop/desktop_native/Cargo.toml b/apps/desktop/desktop_native/Cargo.toml index 78142d618ed..5478d397651 100644 --- a/apps/desktop/desktop_native/Cargo.toml +++ b/apps/desktop/desktop_native/Cargo.toml @@ -2,6 +2,12 @@ resolver = "2" members = ["napi", "core", "proxy", "macos_provider", "windows-plugin-authenticator"] +[workspace.package] +version = "0.0.0" +license = "GPL-3.0" +edition = "2021" +publish = false + [workspace.dependencies] anyhow = "=1.0.94" log = "=0.4.25" diff --git a/apps/desktop/desktop_native/core/Cargo.toml b/apps/desktop/desktop_native/core/Cargo.toml index 03b5a60b8b1..c821662f112 100644 --- a/apps/desktop/desktop_native/core/Cargo.toml +++ b/apps/desktop/desktop_native/core/Cargo.toml @@ -1,9 +1,9 @@ [package] -edition = "2021" -license = "GPL-3.0" name = "desktop_core" -version = "0.0.0" -publish = false +edition = { workspace = true } +license = { workspace = true } +version = { workspace = true } +publish = { workspace = true } [features] default = [ @@ -19,7 +19,7 @@ manual_test = [] [dependencies] aes = "=0.8.4" -anyhow.workspace = true +anyhow = { workspace = true } arboard = { version = "=3.4.1", default-features = false, features = [ "wayland-data-control", ] } @@ -32,7 +32,7 @@ pin-project = "=1.1.8" dirs = "=6.0.0" futures = "=0.3.31" interprocess = { version = "=2.2.1", features = ["tokio"] } -log.workspace = true +log = { workspace = true } rand = "=0.8.5" russh-cryptovec = "=0.7.3" scopeguard = "=1.2.0" @@ -48,7 +48,7 @@ bitwarden-russh = { git = "https://github.com/bitwarden/bitwarden-russh.git", re tokio = { workspace = true, features = ["io-util", "sync", "macros", "net"] } tokio-stream = { workspace = true, features = ["net"] } tokio-util = { workspace = true, features = ["codec"] } -thiserror.workspace = true +thiserror = { workspace = true } typenum = "=1.17.0" pkcs8 = { version = "=0.10.2", features = ["alloc", "encryption", "pem"] } rsa = "=0.9.6" diff --git a/apps/desktop/desktop_native/macos_provider/Cargo.toml b/apps/desktop/desktop_native/macos_provider/Cargo.toml index a488ce88a1c..e160f7f35d6 100644 --- a/apps/desktop/desktop_native/macos_provider/Cargo.toml +++ b/apps/desktop/desktop_native/macos_provider/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "macos_provider" -license = "GPL-3.0" -version = "0.0.0" -edition = "2021" -publish = false +edition = { workspace = true } +license = { workspace = true } +version = { workspace = true } +publish = { workspace = true } [[bin]] name = "uniffi-bindgen" @@ -16,11 +16,11 @@ bench = false [dependencies] desktop_core = { path = "../core" } futures = "=0.3.31" -log.workspace = true +log = { workspace = true } serde = { workspace = true, features = ["derive"] } -serde_json.workspace = true +serde_json = { workspace = true } tokio = { workspace = true, features = ["sync"] } -tokio-util.workspace = true +tokio-util = { workspace = true } uniffi = { version = "=0.28.3", features = ["cli"] } [target.'cfg(target_os = "macos")'.dependencies] diff --git a/apps/desktop/desktop_native/napi/Cargo.toml b/apps/desktop/desktop_native/napi/Cargo.toml index 73afee72b55..a9513fa49a8 100644 --- a/apps/desktop/desktop_native/napi/Cargo.toml +++ b/apps/desktop/desktop_native/napi/Cargo.toml @@ -1,10 +1,10 @@ [package] -edition = "2021" -exclude = ["index.node"] -license = "GPL-3.0" name = "desktop_napi" -version = "0.0.0" -publish = false +exclude = ["index.node"] +edition = { workspace = true } +license = { workspace = true } +version = { workspace = true } +publish = { workspace = true } [lib] crate-type = ["cdylib"] @@ -16,15 +16,15 @@ manual_test = [] [dependencies] base64 = "=0.22.1" hex = "=0.4.3" -anyhow = "=1.0.94" +anyhow = { workspace = true } desktop_core = { path = "../core" } napi = { version = "=2.16.15", features = ["async"] } napi-derive = "=2.16.13" serde = { workspace = true, features = ["derive"] } -serde_json.workspace = true -tokio.workspace = true -tokio-util.workspace = true -tokio-stream.workspace = true +serde_json = { workspace = true } +tokio = { workspace = true } +tokio-util = { workspace = true } +tokio-stream = { workspace = true } [target.'cfg(windows)'.dependencies] windows-registry = "=0.4.0" diff --git a/apps/desktop/desktop_native/objc/Cargo.toml b/apps/desktop/desktop_native/objc/Cargo.toml index 2d6478c77c9..07961f8e13f 100644 --- a/apps/desktop/desktop_native/objc/Cargo.toml +++ b/apps/desktop/desktop_native/objc/Cargo.toml @@ -1,17 +1,17 @@ [package] -edition = "2021" -license = "GPL-3.0" name = "desktop_objc" -version = "0.0.0" -publish = false +edition = { workspace = true } +license = { workspace = true } +version = { workspace = true } +publish = { workspace = true } [features] default = [] [dependencies] -anyhow.workspace = true -thiserror.workspace = true -tokio.workspace = true +anyhow = { workspace = true } +thiserror = { workspace = true } +tokio = { workspace = true } [target.'cfg(target_os = "macos")'.dependencies] core-foundation = "=0.10.0" diff --git a/apps/desktop/desktop_native/objc/src/lib.rs b/apps/desktop/desktop_native/objc/src/lib.rs index eb969cb5f56..f5a7623cfc3 100644 --- a/apps/desktop/desktop_native/objc/src/lib.rs +++ b/apps/desktop/desktop_native/objc/src/lib.rs @@ -68,13 +68,13 @@ mod objc { use super::*; - extern "C" { - pub fn runCommand(context: *mut c_void, value: *const c_char); - pub fn freeObjCString(value: &ObjCString); + unsafe extern "C" { + pub unsafe fn runCommand(context: *mut c_void, value: *const c_char); + pub unsafe fn freeObjCString(value: &ObjCString); } /// This function is called from the ObjC code to return the output of the command - #[no_mangle] + #[unsafe(no_mangle)] pub extern "C" fn commandReturn(context: &mut CommandContext, value: ObjCString) -> bool { let value: String = match value.try_into() { Ok(value) => value, diff --git a/apps/desktop/desktop_native/proxy/Cargo.toml b/apps/desktop/desktop_native/proxy/Cargo.toml index 27f2856f3a6..10ff1ed8eae 100644 --- a/apps/desktop/desktop_native/proxy/Cargo.toml +++ b/apps/desktop/desktop_native/proxy/Cargo.toml @@ -1,16 +1,15 @@ [package] -edition = "2021" -exclude = ["index.node"] -license = "GPL-3.0" name = "desktop_proxy" -version = "0.0.0" -publish = false +edition = { workspace = true } +license = { workspace = true } +version = { workspace = true } +publish = { workspace = true } [dependencies] -anyhow.workspace = true +anyhow = { workspace = true } desktop_core = { path = "../core" } futures = "=0.3.31" -log.workspace = true +log = { workspace = true } simplelog = "=0.12.2" tokio = { workspace = true, features = ["io-std", "io-util", "macros", "rt"] } tokio-util = { workspace = true, features = ["codec"] } diff --git a/apps/desktop/desktop_native/windows-plugin-authenticator/Cargo.toml b/apps/desktop/desktop_native/windows-plugin-authenticator/Cargo.toml index b8759cfca3f..3443fed4fd6 100644 --- a/apps/desktop/desktop_native/windows-plugin-authenticator/Cargo.toml +++ b/apps/desktop/desktop_native/windows-plugin-authenticator/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "windows-plugin-authenticator" -version = "0.0.0" -edition = "2021" -license = "GPL-3.0" -publish = false +edition = { workspace = true } +license = { workspace = true } +version = { workspace = true } +publish = { workspace = true } [target.'cfg(target_os = "windows")'.build-dependencies] bindgen = "0.71.1"