From a4b55d9e42d85ffe69b61bca1c2a7b44f69c9b61 Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Mon, 24 Aug 2026 20:15:57 -0600 Subject: [PATCH] fix(mcp): gate unix-only spill permission APIs for windows builds --- src/mcp/render.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mcp/render.rs b/src/mcp/render.rs index 208a9c0..37a719a 100644 --- a/src/mcp/render.rs +++ b/src/mcp/render.rs @@ -11,6 +11,7 @@ use std::fmt; use std::fs::{self, OpenOptions}; use std::io::{ErrorKind, Read, Write}; #[cfg(unix)] +#[cfg(unix)] use std::os::unix::fs::OpenOptionsExt; use std::path::{Path, PathBuf}; use std::time::SystemTime; @@ -390,6 +391,7 @@ mod tests { use super::*; use base64::Engine; use std::env; + #[cfg(unix)] use std::os::unix::fs::PermissionsExt; use std::process; use std::sync::atomic::{AtomicUsize, Ordering}; @@ -642,8 +644,11 @@ mod tests { assert!(!meta.sniffed); assert!(meta.spilled); assert_eq!(fs::read(&meta.path).unwrap(), data); - let mode = fs::metadata(&meta.path).unwrap().permissions().mode(); - assert_eq!(mode & 0o777, 0o600); + #[cfg(unix)] + { + let mode = fs::metadata(&meta.path).unwrap().permissions().mode(); + assert_eq!(mode & 0o777, 0o600); + } }); }