Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix(macOS): pin libc before vm stats ABI expansion (#6744)

Ezra Ellettec42840bf644b
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index b7e554cbd..c7a380933 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -6729,9 +6729,9 @@ dependencies = [
[[package]]
name = "libc"
-version = "0.2.189"
+version = "0.2.186"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
+checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
[[package]]
name = "libdbus-sys"
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index d6f7c3dc3..ff1867d04 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -98,7 +98,10 @@ tracing-appender = "0.2.3"
sha2 = "0.10"
-libc = "0.2"
+# 0.2.189 sizes vm_statistics64 for macOS 27. sysinfo 0.29 forwards that
+# 104-word size to macOS 26, whose libsystem maximum is 62, on every memory
+# refresh. Keep the pre-macOS-27 layout until the caller is version-aware.
+libc = "=0.2.186"
anyhow = "1.0.71"
arboard = "3.4"
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/hardware.rs b/apps/screenpipe-app-tauri/src-tauri/src/hardware.rs
index 54b6b1941..c3d70d3af 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/hardware.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/hardware.rs
@@ -47,3 +47,27 @@ pub fn detect_hardware_capability() -> HardwareCapability {
pub fn get_hardware_capability() -> HardwareCapability {
detect_hardware_capability()
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ #[cfg(target_os = "macos")]
+ fn hardware_detection_uses_macos_26_compatible_vm_stats_count() {
+ const MACOS_26_MAX_HOST_VM_INFO64_COUNT: u32 = 62;
+
+ assert!(
+ libc::HOST_VM_INFO64_COUNT <= MACOS_26_MAX_HOST_VM_INFO64_COUNT,
+ "host_statistics64 count {} exceeds the macOS 26 maximum {}",
+ libc::HOST_VM_INFO64_COUNT,
+ MACOS_26_MAX_HOST_VM_INFO64_COUNT
+ );
+
+ for _ in 0..16 {
+ let capability = detect_hardware_capability();
+ assert!(capability.cpu_cores > 0);
+ assert!(capability.total_memory_gb > 0.0);
+ }
+ }
+}