From 20fcddffbd7d7f4e0c3648e18f5c35be8df407e7 Mon Sep 17 00:00:00 2001 From: fufesou <13586388+fufesou@users.noreply.github.com> Date: Wed, 30 Apr 2025 23:49:18 +0800 Subject: [PATCH] fix: build (#11611) Signed-off-by: fufesou --- Cargo.lock | 1 - Cargo.toml | 7 +++---- libs/hbb_common | 2 +- src/client.rs | 2 +- src/clipboard.rs | 2 +- src/common.rs | 2 ++ src/lan.rs | 4 ++-- src/platform/linux.rs | 2 +- src/server/connection.rs | 10 +++++----- src/ui_session_interface.rs | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e3427f13b..a5a187595 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5947,7 +5947,6 @@ dependencies = [ "uuid", "virtual_display", "wallpaper", - "whoami", "winapi 0.3.9", "windows 0.61.1", "windows-service", diff --git a/Cargo.toml b/Cargo.toml index ff0e8a870..6cf0e5b86 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,6 @@ screencapturekit = ["cpal/screencapturekit"] [dependencies] async-trait = "0.1" -whoami = "1.5.0" scrap = { path = "libs/scrap", features = ["wayland"] } hbb_common = { path = "libs/hbb_common" } serde_derive = "1.0" @@ -95,7 +94,7 @@ sys-locale = "0.3" enigo = { path = "libs/enigo", features = [ "with_serde" ] } clipboard = { path = "libs/clipboard" } ctrlc = "3.2" -# arboard = { version = "3.4.0", features = ["wayland-data-control"] } +# arboard = { version = "3.4", features = ["wayland-data-control"] } arboard = { git = "https://github.com/rustdesk-org/arboard", features = ["wayland-data-control"] } clipboard-master = { git = "https://github.com/rustdesk-org/clipboard-master" } @@ -118,7 +117,7 @@ winapi = { version = "0.3", features = [ "ioapiset", "winspool", ] } -windows = { version = "0.61.1", features = [ +windows = { version = "0.61", features = [ "Win32", "Win32_System", "Win32_System_Diagnostics", @@ -131,7 +130,7 @@ virtual_display = { path = "libs/virtual_display" } remote_printer = { path = "libs/remote_printer" } impersonate_system = { git = "https://github.com/rustdesk-org/impersonate-system" } shared_memory = "0.12" -tauri-winrt-notification = "0.1.2" +tauri-winrt-notification = "0.1" runas = "1.2" [target.'cfg(target_os = "macos")'.dependencies] diff --git a/libs/hbb_common b/libs/hbb_common index bfddd5bb1..4eca5b45b 160000 --- a/libs/hbb_common +++ b/libs/hbb_common @@ -1 +1 @@ -Subproject commit bfddd5bb193883237c2a1c2c8d8e3cfe02823ac7 +Subproject commit 4eca5b45b95b2f3d71789dc001595149c015fe72 diff --git a/src/client.rs b/src/client.rs index dbad64675..137701c54 100644 --- a/src/client.rs +++ b/src/client.rs @@ -2335,7 +2335,7 @@ impl LoginConfigHandler { .collect::>() .join(" "); #[cfg(not(target_os = "android"))] - let my_platform = whoami::platform().to_string(); + let my_platform = hbb_common::whoami::platform().to_string(); #[cfg(target_os = "android")] let my_platform = "Android".into(); let hwid = if self.get_option("trust-this-device") == "Y" { diff --git a/src/clipboard.rs b/src/clipboard.rs index ee976d68f..3ab95e41e 100644 --- a/src/clipboard.rs +++ b/src/clipboard.rs @@ -463,7 +463,7 @@ pub fn is_support_multi_clipboard(peer_version: &str, peer_platform: &str) -> bo if get_version_number(peer_version) < get_version_number("1.3.0") { return false; } - if ["", &whoami::Platform::Ios.to_string()].contains(&peer_platform) { + if ["", &hbb_common::whoami::Platform::Ios.to_string()].contains(&peer_platform) { return false; } if "Android" == peer_platform && get_version_number(peer_version) < get_version_number("1.3.3") diff --git a/src/common.rs b/src/common.rs index f8d5571b2..264fe81ca 100644 --- a/src/common.rs +++ b/src/common.rs @@ -7,6 +7,8 @@ use std::{ use serde_json::{json, Map, Value}; +#[cfg(not(any(target_os = "android", target_os = "ios")))] +use hbb_common::whoami; use hbb_common::{ allow_err, anyhow::{anyhow, Context}, diff --git a/src/lan.rs b/src/lan.rs index 7d3f4f05f..f2f370587 100644 --- a/src/lan.rs +++ b/src/lan.rs @@ -1,7 +1,7 @@ -use hbb_common::config::Config; use hbb_common::{ allow_err, anyhow::bail, + config::Config, config::{self, RENDEZVOUS_PORT}, log, protobuf::Message as _, @@ -10,7 +10,7 @@ use hbb_common::{ self, sync::mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender}, }, - ResultType, + whoami, ResultType, }; use std::{ diff --git a/src/platform/linux.rs b/src/platform/linux.rs index 5c1a1cf2c..465920177 100644 --- a/src/platform/linux.rs +++ b/src/platform/linux.rs @@ -1089,7 +1089,7 @@ mod desktop { } self.display = self .display - .replace(&whoami::hostname(), "") + .replace(&hbb_common::whoami::hostname(), "") .replace("localhost", ""); } diff --git a/src/server/connection.rs b/src/server/connection.rs index b7d5be863..9edefcb84 100644 --- a/src/server/connection.rs +++ b/src/server/connection.rs @@ -1268,8 +1268,8 @@ impl Connection { #[cfg(not(target_os = "android"))] { - pi.hostname = whoami::hostname(); - pi.platform = whoami::platform().to_string(); + pi.hostname = hbb_common::whoami::hostname(); + pi.platform = hbb_common::whoami::platform().to_string(); } #[cfg(target_os = "android")] { @@ -1314,13 +1314,13 @@ impl Connection { #[cfg(any(target_os = "windows", feature = "unix-file-copy-paste"))] { let is_both_windows = cfg!(target_os = "windows") - && self.lr.my_platform == whoami::Platform::Windows.to_string(); + && self.lr.my_platform == hbb_common::whoami::Platform::Windows.to_string(); #[cfg(feature = "unix-file-copy-paste")] let is_unix_and_peer_supported = crate::is_support_file_copy_paste(&self.lr.version); #[cfg(not(feature = "unix-file-copy-paste"))] let is_unix_and_peer_supported = false; let is_both_macos = cfg!(target_os = "macos") - && self.lr.my_platform == whoami::Platform::MacOS.to_string(); + && self.lr.my_platform == hbb_common::whoami::Platform::MacOS.to_string(); let is_peer_support_paste_if_macos = crate::is_support_file_paste_if_macos(&self.lr.version); let has_file_clipboard = is_both_windows @@ -4279,7 +4279,7 @@ mod raii { ) -> Self { let printer = conn_type == crate::server::AuthConnType::Remote && crate::is_support_remote_print(&lr.version) - && lr.my_platform == whoami::Platform::Windows.to_string(); + && lr.my_platform == hbb_common::whoami::Platform::Windows.to_string(); AUTHED_CONNS.lock().unwrap().push(AuthedConn { conn_id, conn_type, diff --git a/src/ui_session_interface.rs b/src/ui_session_interface.rs index b3809466d..dbadd0747 100644 --- a/src/ui_session_interface.rs +++ b/src/ui_session_interface.rs @@ -29,7 +29,7 @@ use hbb_common::{ sync::mpsc, time::{Duration as TokioDuration, Instant}, }, - Stream, + whoami, Stream, }; use crate::client::io_loop::Remote;