From a22406a1afa864625e5b45121f66b2128ef1d864 Mon Sep 17 00:00:00 2001 From: Meister1593 Date: Tue, 19 Aug 2025 23:09:23 +0200 Subject: [PATCH 1/4] format --- nanvr/egui_fonts/src/lib.rs | 2 +- nanvr/gui_shared/src/font.rs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/nanvr/egui_fonts/src/lib.rs b/nanvr/egui_fonts/src/lib.rs index 2d4d006f..ddafbb4f 100644 --- a/nanvr/egui_fonts/src/lib.rs +++ b/nanvr/egui_fonts/src/lib.rs @@ -1,3 +1,3 @@ pub const HACK_REGULAR: &[u8] = include_bytes!("../fonts/Hack-Regular.ttf"); pub const UBUNTU_LIGHT: &[u8] = include_bytes!("../fonts/Ubuntu-Light.ttf"); -pub const OPENMOJI_BLACK_GLYF: &[u8] = include_bytes!("../fonts/OpenMoji-black-glyf.ttf"); \ No newline at end of file +pub const OPENMOJI_BLACK_GLYF: &[u8] = include_bytes!("../fonts/OpenMoji-black-glyf.ttf"); diff --git a/nanvr/gui_shared/src/font.rs b/nanvr/gui_shared/src/font.rs index ade304e7..86cd6303 100644 --- a/nanvr/gui_shared/src/font.rs +++ b/nanvr/gui_shared/src/font.rs @@ -1,4 +1,10 @@ -use egui::{epaint::{self, text::{FontInsert, InsertFontFamily}}, Context, FontData, FontFamily}; +use egui::{ + Context, FontData, FontFamily, + epaint::{ + self, + text::{FontInsert, InsertFontFamily}, + }, +}; use egui_fonts::{HACK_REGULAR, OPENMOJI_BLACK_GLYF, UBUNTU_LIGHT}; pub fn add_fonts(ctx: &Context) { From 15c0bdf569bd20a2995bdff016d11e4023b5fc41 Mon Sep 17 00:00:00 2001 From: Meister1593 Date: Wed, 20 Aug 2025 00:27:05 +0200 Subject: [PATCH 2/4] Git-commit compatibility. Remove nightly-stable definitions, use commits as versions only for now. Send strings for client compatibility checking instead of hashed string. --- .gitignore | 4 +- nanvr/client_core/src/connection.rs | 6 +-- nanvr/client_openxr/Cargo.toml | 2 +- nanvr/configuration/src/lib.rs | 5 +- nanvr/configuration/src/settings.rs | 10 ++-- .../src/dashboard/components/about.rs | 8 ++- .../dashboard/components/new_version_popup.rs | 2 +- nanvr/dashboard/src/data_sources.rs | 6 +-- nanvr/dashboard/src/main.rs | 5 +- nanvr/launcher/src/actions.rs | 25 ++------- nanvr/net_packets/src/lib.rs | 5 +- nanvr/server_core/src/connection.rs | 14 ++--- nanvr/server_core/src/sockets.rs | 13 +---- nanvr/shared/build.rs | 16 ++++++ nanvr/shared/src/version.rs | 34 +----------- nanvr/system_info/src/lib.rs | 5 +- nanvr/wired/src/lib.rs | 52 ++++--------------- 17 files changed, 67 insertions(+), 145 deletions(-) create mode 100644 nanvr/shared/build.rs diff --git a/.gitignore b/.gitignore index b7a61016..47d49158 100644 --- a/.gitignore +++ b/.gitignore @@ -72,4 +72,6 @@ NaNVR-Launcher CMakeLists.txt cmake-build-debug/ -*.jks \ No newline at end of file +*.jks + +deps/ \ No newline at end of file diff --git a/nanvr/client_core/src/connection.rs b/nanvr/client_core/src/connection.rs index a76a2455..0ff2300a 100644 --- a/nanvr/client_core/src/connection.rs +++ b/nanvr/client_core/src/connection.rs @@ -72,8 +72,8 @@ pub struct ConnectionContext { fn set_hud_message(event_queue: &Mutex>, message: &str) { let message = format!( - "{NANVR_NAME} v{}\nhostname: {}\nIP: {}\n\n{message}", - *NANVR_VERSION, + "{NANVR_NAME} {}\nhostname: {}\nIP: {}\n\n{message}", + NANVR_VERSION.to_owned(), Config::load().hostname, system_info::local_ip(), ); @@ -165,7 +165,7 @@ fn connection_pipeline( dbg_connection!("connection_pipeline: Send stream capabilities"); proto_control_socket .send(&ClientConnectionResult::ConnectionAccepted { - client_protocol_id: shared::protocol_id_u64(), + client_protocol_id: shared::protocol_id(), display_name: system_info::platform().to_string(), server_ip, streaming_capabilities: Some( diff --git a/nanvr/client_openxr/Cargo.toml b/nanvr/client_openxr/Cargo.toml index 954cb9df..5be22bc0 100644 --- a/nanvr/client_openxr/Cargo.toml +++ b/nanvr/client_openxr/Cargo.toml @@ -26,7 +26,7 @@ libc = "0.2" ndk-context = "0.1" [package.metadata.android] -package = "nanvr.client.dev" # Changed for Meta Store +package = "nanvr.client" # Changed for Meta Store install_location = "auto" build_targets = ["aarch64-linux-android"] runtime_libs = "../../deps/android_openxr" diff --git a/nanvr/configuration/src/lib.rs b/nanvr/configuration/src/lib.rs index 2c2fd198..fa79e70e 100644 --- a/nanvr/configuration/src/lib.rs +++ b/nanvr/configuration/src/lib.rs @@ -9,7 +9,6 @@ use settings_schema::{NumberType, SchemaNode}; use shared::{ ConnectionState, NANVR_VERSION, ToAny, anyhow::{Result, bail}, - semver::Version, }; use std::{ collections::{HashMap, HashSet}, @@ -119,7 +118,7 @@ pub struct ClientConnectionConfig { #[derive(Serialize, Deserialize, Clone, Debug)] pub struct SessionConfig { - pub server_version: Version, + pub server_version: String, pub openvr_config: OpenvrConfig, // The hashmap key is the hostname pub client_connections: HashMap, @@ -129,7 +128,7 @@ pub struct SessionConfig { impl Default for SessionConfig { fn default() -> Self { Self { - server_version: NANVR_VERSION.clone(), + server_version: NANVR_VERSION.to_owned(), openvr_config: OpenvrConfig { // avoid realistic resolutions, as on first start, on Linux, it // could trigger direct mode on an existing monitor diff --git a/nanvr/configuration/src/settings.rs b/nanvr/configuration/src/settings.rs index 0cbcf326..99f151b9 100644 --- a/nanvr/configuration/src/settings.rs +++ b/nanvr/configuration/src/settings.rs @@ -1917,11 +1917,7 @@ pub fn session_settings_default() -> SettingsDefault { }, wired_client_type: ClientFlavorDefault { Custom: format!("{NANVR_LOW_NAME}.client"), - variant: if shared::is_stable() { - ClientFlavorDefaultVariant::Store - } else { - ClientFlavorDefaultVariant::Github - }, + variant: ClientFlavorDefaultVariant::Github, }, wired_client_autolaunch: true, web_server_port: 8082, @@ -2009,9 +2005,9 @@ pub fn session_settings_default() -> SettingsDefault { linux_async_reprojection: false, }, velocities_multiplier: 1.0, - open_setup_wizard: shared::is_stable() || shared::is_nightly(), + open_setup_wizard: true, new_version_popup: SwitchDefault { - enabled: shared::is_stable(), + enabled: false, content: NewVersionPopupConfigDefault { hide_while_version: NANVR_VERSION.to_string(), }, diff --git a/nanvr/dashboard/src/dashboard/components/about.rs b/nanvr/dashboard/src/dashboard/components/about.rs index 2b6226ae..635fb302 100644 --- a/nanvr/dashboard/src/dashboard/components/about.rs +++ b/nanvr/dashboard/src/dashboard/components/about.rs @@ -3,7 +3,13 @@ use gui_shared::theme; use shared::{NANVR_NAME, NANVR_VERSION}; pub fn about_tab_ui(ui: &mut Ui) { - ui.label(RichText::new(format!("{NANVR_NAME} streamer v{}", *NANVR_VERSION)).size(30.0)); + ui.label( + RichText::new(format!( + "{NANVR_NAME} streamer {}", + NANVR_VERSION.to_owned() + )) + .size(30.0), + ); ui.add_space(10.0); ui.hyperlink_to("Visit us on GitHub", "https://github.com/nanvr/NaNVR"); ui.hyperlink_to( diff --git a/nanvr/dashboard/src/dashboard/components/new_version_popup.rs b/nanvr/dashboard/src/dashboard/components/new_version_popup.rs index 1d5e125f..ac51589e 100644 --- a/nanvr/dashboard/src/dashboard/components/new_version_popup.rs +++ b/nanvr/dashboard/src/dashboard/components/new_version_popup.rs @@ -46,7 +46,7 @@ impl NewVersionPopup { ui.add_space(10.0); ui.vertical(|ui| { - ui.heading(format!("{NANVR_NAME} v{}", self.version)); + ui.heading(format!("{NANVR_NAME} {}", self.version)); ui.horizontal(|ui| { ui.spacing_mut().item_spacing.x = 5.0; diff --git a/nanvr/dashboard/src/data_sources.rs b/nanvr/dashboard/src/data_sources.rs index 2d633c5b..2bd72f89 100644 --- a/nanvr/dashboard/src/data_sources.rs +++ b/nanvr/dashboard/src/data_sources.rs @@ -59,7 +59,7 @@ pub fn clean_session() { if session_manager.session().server_version != *NANVR_VERSION { let mut session_ref = session_manager.session_mut(); - session_ref.server_version = NANVR_VERSION.clone(); + session_ref.server_version = NANVR_VERSION.to_owned(); session_ref.client_connections.clear(); session_ref.session_settings.extra.open_setup_wizard = true; session_ref @@ -402,9 +402,7 @@ impl DataSources { .header(format!("X-{NANVR_HIGH_NAME}"), "true") .call() .ok() - .and_then(|r| { - Version::from_str(&r.into_body().read_to_string().ok()?).ok() - }); + .and_then(|r| r.into_body().read_to_string().ok()); let connected = if let Some(version) = maybe_server_version { // We need exact match because we don't do session extrapolation at the diff --git a/nanvr/dashboard/src/main.rs b/nanvr/dashboard/src/main.rs index 2b5c17f1..d811be1f 100644 --- a/nanvr/dashboard/src/main.rs +++ b/nanvr/dashboard/src/main.rs @@ -67,7 +67,10 @@ fn main() { } eframe::run_native( - &format!("{NANVR_NAME} Dashboard (streamer v{})", *NANVR_VERSION), + &format!( + "{NANVR_NAME} Dashboard (streamer {})", + NANVR_VERSION.to_owned() + ), NativeOptions { viewport: ViewportBuilder::default() .with_app_id(format!("{NANVR_LOW_NAME}.dashboard")) diff --git a/nanvr/launcher/src/actions.rs b/nanvr/launcher/src/actions.rs index be38989b..e5acec07 100644 --- a/nanvr/launcher/src/actions.rs +++ b/nanvr/launcher/src/actions.rs @@ -1,12 +1,9 @@ use crate::{ InstallationInfo, Progress, ReleaseChannelsInfo, ReleaseInfo, UiMessage, WorkerMessage, }; -use anyhow::Context; use flate2::read::GzDecoder; use futures_util::StreamExt; -use shared::{ - NANVR_GH_REPO_PATH, NANVR_LOW_NAME, NANVR_NAME, ToAny, anyhow::Result, semver::Version, -}; +use shared::{NANVR_GH_REPO_PATH, NANVR_LOW_NAME, NANVR_NAME, ToAny, anyhow::Result}; use std::{ env, fs::{self, File}, @@ -15,6 +12,7 @@ use std::{ process::Command, sync::mpsc::{Receiver, Sender}, }; +use system_info::PACKAGE_NAME; const APK_NAME: &str = "client.apk"; @@ -179,25 +177,12 @@ fn install_and_launch_apk( .find_map(|d| d.serial.clone()) .ok_or(anyhow::anyhow!("Failed to find connected device"))?; - let v = if release.version.starts_with('v') { - release.version[1..].to_string() - } else { - release.version - }; - let version = Version::parse(&v).context("Failed to parse release version")?; - let stable = version.pre.is_empty() && !version.build.contains("nightly"); - let application_id = if stable { - system_info::PACKAGE_NAME_GITHUB_STABLE - } else { - system_info::PACKAGE_NAME_GITHUB_DEV - }; - - if wired::commands::is_package_installed(&adb_path, &device_serial, application_id)? { + if wired::commands::is_package_installed(&adb_path, &device_serial, PACKAGE_NAME)? { worker_message_sender.send(WorkerMessage::ProgressUpdate(Progress { message: "Uninstalling old APK".into(), progress: 0.0, }))?; - wired::commands::uninstall_package(&adb_path, &device_serial, application_id)?; + wired::commands::uninstall_package(&adb_path, &device_serial, PACKAGE_NAME)?; } worker_message_sender.send(WorkerMessage::ProgressUpdate(Progress { @@ -206,7 +191,7 @@ fn install_and_launch_apk( }))?; wired::commands::install_package(&adb_path, &device_serial, &apk_path.to_string_lossy())?; - wired::commands::start_application(&adb_path, &device_serial, application_id)?; + wired::commands::start_application(&adb_path, &device_serial, PACKAGE_NAME)?; Ok(()) } diff --git a/nanvr/net_packets/src/lib.rs b/nanvr/net_packets/src/lib.rs index 60788841..7ab0ffb3 100644 --- a/nanvr/net_packets/src/lib.rs +++ b/nanvr/net_packets/src/lib.rs @@ -7,7 +7,6 @@ use shared::{ BodySkeleton, ConnectionState, DeviceMotion, LogEntry, LogSeverity, Pose, ViewParams, anyhow::Result, glam::{Quat, UVec2, Vec2}, - semver::Version, }; use std::{ collections::HashSet, @@ -63,7 +62,7 @@ impl VideoStreamingCapabilities { #[derive(Serialize, Deserialize)] pub enum ClientConnectionResult { ConnectionAccepted { - client_protocol_id: u64, + client_protocol_id: String, display_name: String, server_ip: IpAddr, streaming_capabilities: Option, @@ -113,7 +112,7 @@ pub struct StreamConfigPacket { #[derive(Serialize, Deserialize, Clone)] pub struct StreamConfig { - pub server_version: Version, + pub server_version: String, pub settings: Settings, pub negotiated_config: NegotiatedStreamingConfig, } diff --git a/nanvr/server_core/src/connection.rs b/nanvr/server_core/src/connection.rs index d4fea109..a86ac274 100644 --- a/nanvr/server_core/src/connection.rs +++ b/nanvr/server_core/src/connection.rs @@ -280,22 +280,16 @@ pub fn handshake_loop(ctx: Arc, lifecycle_state: Arc status, Err(e) => { error!("{e:?}"); @@ -540,10 +534,10 @@ fn connection_pipeline( ClientListAction::SetDisplayName(display_name), ); - if client_protocol_id != shared::protocol_id_u64() { + if client_protocol_id != shared::protocol_id() { warn!( "Trusted client is incompatible! Expected protocol ID: {}, found: {}", - shared::protocol_id_u64(), + shared::protocol_id(), client_protocol_id, ); diff --git a/nanvr/server_core/src/sockets.rs b/nanvr/server_core/src/sockets.rs index 2a714540..0f352256 100644 --- a/nanvr/server_core/src/sockets.rs +++ b/nanvr/server_core/src/sockets.rs @@ -35,23 +35,12 @@ impl WelcomeSocket { .get_property_val_str(net_sockets::MDNS_PROTOCOL_KEY) .to_any()?; let server_protocol = shared::protocol_id(); - let client_is_dev = client_protocol.contains("-dev"); - let server_is_dev = server_protocol.contains("-dev"); if client_protocol != server_protocol { - let reason = if client_is_dev && server_is_dev { - "Please use matching nightly versions." - } else if client_is_dev { - "Please use nightly server or stable client." - } else if server_is_dev { - "Please use stable server or nightly client." - } else { - "Please use matching stable versions." - }; let protocols = format!( "Protocols: server={server_protocol}, client={client_protocol}" ); - warn!("Found incompatible client {hostname}! {reason}\n{protocols}"); + warn!("Found incompatible client {hostname}! {protocols}"); } clients.insert(hostname.into(), address); diff --git a/nanvr/shared/build.rs b/nanvr/shared/build.rs new file mode 100644 index 00000000..6d0d640c --- /dev/null +++ b/nanvr/shared/build.rs @@ -0,0 +1,16 @@ +use std::process::Command; + +fn main() { + let git_hash = get_git_hash(); + println!("cargo:rustc-env=BUILD_GIT_HASH={git_hash}"); +} + +fn get_git_hash() -> String { + let output = Command::new("git") + .args(["rev-parse", "HEAD"]) + .output() + .unwrap(); + let mut git_hash = String::from_utf8(output.stdout).unwrap(); + git_hash.truncate(8); + git_hash +} diff --git a/nanvr/shared/src/version.rs b/nanvr/shared/src/version.rs index a8010e06..836c6cd2 100644 --- a/nanvr/shared/src/version.rs +++ b/nanvr/shared/src/version.rs @@ -1,12 +1,9 @@ -use semver::Version; use std::{ collections::hash_map::DefaultHasher, hash::{Hash, Hasher}, - sync::LazyLock, }; -pub static NANVR_VERSION: LazyLock = - LazyLock::new(|| Version::parse(env!("CARGO_PKG_VERSION")).unwrap()); +pub static NANVR_VERSION: &str = env!("BUILD_GIT_HASH"); // Consistent across architectures, might not be consistent across different compiler versions. pub fn hash_string(string: &str) -> u64 { @@ -15,36 +12,9 @@ pub fn hash_string(string: &str) -> u64 { hasher.finish() } -pub fn is_nightly() -> bool { - NANVR_VERSION.build.contains("nightly") -} - -pub fn is_stable() -> bool { - NANVR_VERSION.pre.is_empty() && !is_nightly() -} - // Semver compatible versions will produce the same protocol ID. Protocol IDs are not ordered // As a convention, encode/decode the protocol ID bytes as little endian. // Only makor and pub fn protocol_id() -> String { - if NANVR_VERSION.pre.is_empty() { - NANVR_VERSION.major.to_string() - } else { - format!("{}-{}", NANVR_VERSION.major, NANVR_VERSION.pre) - } -} - -pub fn protocol_id_u64() -> u64 { - hash_string(&protocol_id()) -} - -// deprecated -pub fn is_version_compatible(other_version: &Version) -> bool { - let protocol_string = if other_version.pre.is_empty() { - other_version.major.to_string() - } else { - format!("{}-{}", other_version.major, other_version.pre) - }; - - protocol_id_u64() == hash_string(&protocol_string) + NANVR_VERSION.to_string() } diff --git a/nanvr/system_info/src/lib.rs b/nanvr/system_info/src/lib.rs index f51d74c6..2bf25b3f 100644 --- a/nanvr/system_info/src/lib.rs +++ b/nanvr/system_info/src/lib.rs @@ -10,9 +10,7 @@ use shared::NANVR_LOW_NAME; use shared::settings_schema::SettingsSchema; use std::fmt::{Display, Formatter}; -pub const PACKAGE_NAME_STORE: &str = formatcp!("{NANVR_LOW_NAME}.client"); -pub const PACKAGE_NAME_GITHUB_DEV: &str = formatcp!("{NANVR_LOW_NAME}.client.dev"); -pub const PACKAGE_NAME_GITHUB_STABLE: &str = formatcp!("{NANVR_LOW_NAME}.client.stable"); +pub const PACKAGE_NAME: &str = formatcp!("{NANVR_LOW_NAME}.client"); // Platform of the device. It is used to match the VR runtime and enable features conditionally. #[derive(PartialEq, Eq, Clone, Copy)] @@ -177,7 +175,6 @@ pub fn local_ip() -> std::net::IpAddr { #[derive(SettingsSchema, Serialize, Deserialize, Clone)] pub enum ClientFlavor { - Store, Github, Custom(String), } diff --git a/nanvr/wired/src/lib.rs b/nanvr/wired/src/lib.rs index 55acaba2..ef8e388c 100644 --- a/nanvr/wired/src/lib.rs +++ b/nanvr/wired/src/lib.rs @@ -4,9 +4,7 @@ mod parse; use shared::anyhow::Result; use shared::{NANVR_NAME, dbg_connection, error}; use std::collections::HashSet; -use system_info::{ - ClientFlavor, PACKAGE_NAME_GITHUB_DEV, PACKAGE_NAME_GITHUB_STABLE, PACKAGE_NAME_STORE, -}; +use system_info::PACKAGE_NAME; pub enum WiredConnectionStatus { Ready, @@ -31,7 +29,6 @@ impl WiredConnection { &self, control_port: u16, stream_port: u16, - client_type: &ClientFlavor, client_autolaunch: bool, ) -> Result { let Some(device_serial) = commands::list_devices(&self.adb_path)? @@ -58,8 +55,7 @@ impl WiredConnection { ); } - let Some(process_name) = get_process_name(&self.adb_path, &device_serial, client_type) - else { + let Some(process_name) = get_process_name(&self.adb_path, &device_serial) else { return Ok(WiredConnectionStatus::NotReady(format!( "No suitable {NANVR_NAME} client is installed" ))); @@ -95,40 +91,12 @@ impl Drop for WiredConnection { } } -pub fn get_process_name( - adb_path: &str, - device_serial: &str, - flavor: &ClientFlavor, -) -> Option { - let fallbacks = match flavor { - ClientFlavor::Store => { - if shared::is_stable() { - vec![PACKAGE_NAME_STORE, PACKAGE_NAME_GITHUB_STABLE] - } else { - vec![PACKAGE_NAME_GITHUB_DEV] - } - } - ClientFlavor::Github => { - if shared::is_stable() { - vec![PACKAGE_NAME_GITHUB_STABLE, PACKAGE_NAME_STORE] - } else { - vec![PACKAGE_NAME_GITHUB_DEV] - } - } - ClientFlavor::Custom(name) => { - if shared::is_stable() { - vec![name, PACKAGE_NAME_STORE, PACKAGE_NAME_GITHUB_STABLE] - } else { - vec![name, PACKAGE_NAME_GITHUB_DEV] - } - } - }; - - fallbacks - .iter() - .find(|name| { - commands::is_package_installed(adb_path, device_serial, name) - .is_ok_and(|installed| installed) - }) - .map(|name| (*name).to_string()) +pub fn get_process_name(adb_path: &str, device_serial: &str) -> Option { + if commands::is_package_installed(adb_path, device_serial, PACKAGE_NAME) + .is_ok_and(|installed| installed) + { + Some(PACKAGE_NAME.to_owned()) + } else { + None + } } From aed39f647dd0c9154b87d535285782aff4eb8a98 Mon Sep 17 00:00:00 2001 From: Meister1593 Date: Wed, 20 Aug 2025 00:28:23 +0200 Subject: [PATCH 3/4] Format cargo files --- nanvr/client_tester/Cargo.toml | 2 +- nanvr/dashboard/Cargo.toml | 2 +- nanvr/launcher/Cargo.toml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nanvr/client_tester/Cargo.toml b/nanvr/client_tester/Cargo.toml index eedfd615..b4e600f0 100644 --- a/nanvr/client_tester/Cargo.toml +++ b/nanvr/client_tester/Cargo.toml @@ -16,7 +16,7 @@ gui_shared.workspace = true eframe = { version = "0.31", default-features = false, features = [ "accesskit", "glow", - "wayland", # Required for Linux support (including CI!) + "wayland", # Required for Linux support (including CI!) "web_screen_reader", "x11", ] } diff --git a/nanvr/dashboard/Cargo.toml b/nanvr/dashboard/Cargo.toml index 150346ab..4b511819 100644 --- a/nanvr/dashboard/Cargo.toml +++ b/nanvr/dashboard/Cargo.toml @@ -23,7 +23,7 @@ chrono = "0.4" eframe = { version = "0.31", default-features = false, features = [ "accesskit", "glow", - "wayland", # Required for Linux support (including CI!) + "wayland", # Required for Linux support (including CI!) "web_screen_reader", "x11", ] } diff --git a/nanvr/launcher/Cargo.toml b/nanvr/launcher/Cargo.toml index c29544f1..4b9ff279 100644 --- a/nanvr/launcher/Cargo.toml +++ b/nanvr/launcher/Cargo.toml @@ -17,7 +17,7 @@ anyhow = "1" eframe = { version = "0.31", default-features = false, features = [ "accesskit", "glow", - "wayland", # Required for Linux support (including CI!) + "wayland", # Required for Linux support (including CI!) "web_screen_reader", "x11", ] } @@ -34,4 +34,4 @@ reqwest = { version = "0.12", default-features = false, features = [ serde_json = "1" tar = "0.4" tokio = { version = "1", features = ["rt-multi-thread"] } -zip = "2" \ No newline at end of file +zip = "2" From 390c43552a7027989c7fbab3e6a19301bf4a3f6b Mon Sep 17 00:00:00 2001 From: Meister1593 Date: Wed, 20 Aug 2025 00:38:49 +0200 Subject: [PATCH 4/4] remove semver --- Cargo.lock | 10 ---------- nanvr/dashboard/src/data_sources.rs | 13 +++---------- nanvr/shared/Cargo.toml | 1 - nanvr/shared/src/lib.rs | 1 - nanvr/shared/src/version.rs | 3 --- 5 files changed, 3 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index db5950dc..2c03dcd3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4901,15 +4901,6 @@ dependencies = [ "libc", ] -[[package]] -name = "semver" -version = "1.0.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" -dependencies = [ - "serde", -] - [[package]] name = "serde" version = "1.0.218" @@ -5093,7 +5084,6 @@ dependencies = [ "parking_lot", "paste", "rfd", - "semver", "serde", "settings-schema", ] diff --git a/nanvr/dashboard/src/data_sources.rs b/nanvr/dashboard/src/data_sources.rs index 2bd72f89..84cd05bd 100644 --- a/nanvr/dashboard/src/data_sources.rs +++ b/nanvr/dashboard/src/data_sources.rs @@ -5,9 +5,7 @@ use net_packets::ServerRequest; use server_io::ServerSessionManager; use shared::{ NANVR_HIGH_NAME, NANVR_NAME, NANVR_VERSION, RelaxedAtomic, debug, error, info, - parking_lot::Mutex, - semver::{Version, VersionReq}, - warn, + parking_lot::Mutex, warn, }; use std::{ io::ErrorKind, @@ -157,7 +155,7 @@ impl DataSources { .as_option()? .hide_while_version; - VersionReq::parse(&format!(">{version}")).unwrap() + &format!(">{version}") }; let request_agent: ureq::Agent = ureq::Agent::config_builder() @@ -177,12 +175,7 @@ impl DataSources { .get("tag_name") .and_then(|v| Some(v.as_str()?.trim_start_matches("v")))?; - let version = version_str.parse::().ok(); - - if version - .map(|v| version_requirement.matches(&v)) - .unwrap_or(false) - { + if version_requirement == version_str { let message = version_data .get("body") .and_then(|v| v.as_str()) diff --git a/nanvr/shared/Cargo.toml b/nanvr/shared/Cargo.toml index 035ed9dd..02c5378a 100644 --- a/nanvr/shared/Cargo.toml +++ b/nanvr/shared/Cargo.toml @@ -13,7 +13,6 @@ glam = { version = "0.30", features = ["serde"] } log = "0.4" parking_lot = "0.12" paste = "1" -semver = { version = "1", features = ["serde"] } serde = { version = "1", features = ["derive"] } settings-schema = { git = "https://github.com/alvr-org/settings-schema-rs", rev = "676185f" } # settings-schema = { path = "../../../../settings-schema-rs/settings-schema" } diff --git a/nanvr/shared/src/lib.rs b/nanvr/shared/src/lib.rs index 92704cd8..782f2ca6 100644 --- a/nanvr/shared/src/lib.rs +++ b/nanvr/shared/src/lib.rs @@ -14,7 +14,6 @@ pub use anyhow; pub use glam; pub use log; pub use parking_lot; -pub use semver; pub use settings_schema; pub use average::*; diff --git a/nanvr/shared/src/version.rs b/nanvr/shared/src/version.rs index 836c6cd2..93dedf48 100644 --- a/nanvr/shared/src/version.rs +++ b/nanvr/shared/src/version.rs @@ -12,9 +12,6 @@ pub fn hash_string(string: &str) -> u64 { hasher.finish() } -// Semver compatible versions will produce the same protocol ID. Protocol IDs are not ordered -// As a convention, encode/decode the protocol ID bytes as little endian. -// Only makor and pub fn protocol_id() -> String { NANVR_VERSION.to_string() }