From cf596f370ae7cc232ca63f4752d7727a74cd449b Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 10 Feb 2026 09:02:09 +0000 Subject: [PATCH] fix: gate Permissions import behind #[cfg(unix)] for Windows build Move `use std::fs::Permissions` and `use std::os::unix::fs::PermissionsExt` inside the #[cfg(unix)] block to avoid unused import error on Windows. Co-Authored-By: Claude Opus 4.6 --- backend/windmill-common/src/worker.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/windmill-common/src/worker.rs b/backend/windmill-common/src/worker.rs index 0b4b25472c..4a12ad00a4 100644 --- a/backend/windmill-common/src/worker.rs +++ b/backend/windmill-common/src/worker.rs @@ -1045,16 +1045,17 @@ pub async fn extract_tar(tar: bytes::Bytes, folder: &str) -> error::Result<()> { } #[cfg(all(feature = "enterprise", feature = "parquet"))] fn write_binary_file(main_path: &str, byts: &mut bytes::Bytes) -> error::Result<()> { - use std::fs::{File, Permissions}; + use std::fs::File; use std::io::Write; - #[cfg(unix)] - use std::os::unix::fs::PermissionsExt; - let mut file = File::create(main_path)?; file.write_all(byts)?; #[cfg(unix)] - file.set_permissions(Permissions::from_mode(0o755))?; + { + use std::fs::Permissions; + use std::os::unix::fs::PermissionsExt; + file.set_permissions(Permissions::from_mode(0o755))?; + } file.flush()?; Ok(()) }