From 1c75de99d083d04cc5931966680019f2b5494ceb Mon Sep 17 00:00:00 2001 From: Andrew Kidoo Date: Wed, 19 Nov 2025 19:56:25 +1300 Subject: [PATCH 1/2] COMLibrary removed from WMI v0.18.0 See WMI commit: https://github.com/ohadravid/wmi-rs/commit/515b9b8c67a8325b07e361e2d41b8454e603d07c --- crates/core/src/wasm_runtime/runtime.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/crates/core/src/wasm_runtime/runtime.rs b/crates/core/src/wasm_runtime/runtime.rs index 7db225475..3811e4867 100644 --- a/crates/core/src/wasm_runtime/runtime.rs +++ b/crates/core/src/wasm_runtime/runtime.rs @@ -452,19 +452,18 @@ fn get_cpu_cycles_per_second_runtime() -> Option { #[cfg(target_os = "windows")] fn get_cpu_cycles_per_second_runtime() -> Option { use serde::Deserialize; - use wmi::{COMLibrary, Variant, WMIConnection}; + use wmi::{WMIConnection}; #[derive(Deserialize, Debug)] - struct Win32_Processor { + struct Win32Processor { #[serde(rename = "MaxClockSpeed")] max_clock_speed: u64, } - let com_con = COMLibrary::new().ok()?; - let wmi_con = WMIConnection::new(com_con.into()).ok()?; + let wmi_con = WMIConnection::new().ok()?; - let results: Vec = wmi_con - .raw_query("SELECT MaxClockSpeed FROM Win32_Processor") + let results: Vec = wmi_con + .raw_query("SELECT MaxClockSpeed FROM Win32Processor") .ok()?; if let Some(cpu) = results.first() { From c2112442914a67cf9da527c1ab001f761013b109 Mon Sep 17 00:00:00 2001 From: Andrew Kidoo Date: Thu, 20 Nov 2025 08:43:27 +1300 Subject: [PATCH 2/2] fix: update for WMI v0.18.0 compatibility (COMLibrary removed) --- crates/core/src/wasm_runtime/runtime.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/core/src/wasm_runtime/runtime.rs b/crates/core/src/wasm_runtime/runtime.rs index 3811e4867..10f12eec1 100644 --- a/crates/core/src/wasm_runtime/runtime.rs +++ b/crates/core/src/wasm_runtime/runtime.rs @@ -452,7 +452,7 @@ fn get_cpu_cycles_per_second_runtime() -> Option { #[cfg(target_os = "windows")] fn get_cpu_cycles_per_second_runtime() -> Option { use serde::Deserialize; - use wmi::{WMIConnection}; + use wmi::WMIConnection; #[derive(Deserialize, Debug)] struct Win32Processor { @@ -463,7 +463,7 @@ fn get_cpu_cycles_per_second_runtime() -> Option { let wmi_con = WMIConnection::new().ok()?; let results: Vec = wmi_con - .raw_query("SELECT MaxClockSpeed FROM Win32Processor") + .raw_query("SELECT MaxClockSpeed FROM Win32_Processor") .ok()?; if let Some(cpu) = results.first() {