From 45980f0220746bf5085d9cea803b2229dddbcb01 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 10 Feb 2026 10:58:56 +0100 Subject: [PATCH] resolve Windows build warnings treated as errors (#7870) * fix: resolve Windows build warnings treated as errors - Gate UV_PATH import behind #[cfg(unix)] in python_versions.rs - Remove unused tokio::time::sleep import in worker.rs (use fully qualified path) - Fix unused `file` variable warnings in ansible_executor.rs on Windows Co-Authored-By: Claude Opus 4.6 * ci: add Windows cargo check workflow Runs cargo check with ee_windows features on push to backend/** using the blacksmith-16vcpu-windows-2025 runner. Co-Authored-By: Claude Opus 4.6 * ci: add cargo check step to Windows build, remove separate check workflow Add a cargo check step with -D warnings before the full build to fail fast on any warnings. Remove the separate windows-check.yml workflow. Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Claude Opus 4.6 --- .github/workflows/build_windows_worker_.yml | 12 ++++++++++-- backend/windmill-worker/src/ansible_executor.rs | 8 +++++--- backend/windmill-worker/src/python_versions.rs | 4 +++- backend/windmill-worker/src/worker.rs | 3 +-- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_windows_worker_.yml b/.github/workflows/build_windows_worker_.yml index 252b6a946b..8647307e1b 100644 --- a/.github/workflows/build_windows_worker_.yml +++ b/.github/workflows/build_windows_worker_.yml @@ -40,6 +40,15 @@ jobs: run: | ./backend/substitute_ee_code.sh --copy --dir ./windmill-ee-private + - name: Cargo check (fail fast on warnings) + timeout-minutes: 60 + env: + RUSTFLAGS: "-D warnings" + run: | + mkdir frontend/build && cd backend + New-Item -Path . -Name "windmill-api/openapi-deref.yaml" -ItemType "File" -Force + cargo check --features=ee_windows + - name: Cargo build dynamic libraries windows timeout-minutes: 180 run: | @@ -54,8 +63,7 @@ jobs: vcpkg.exe integrate install $env:VCPKGRS_DYNAMIC=1 $env:OPENSSL_DIR="${Env:VCPKG_INSTALLATION_ROOT}\installed\x64-windows-static" - mkdir frontend/build && cd backend - New-Item -Path . -Name "windmill-api/openapi-deref.yaml" -ItemType "File" -Force + cd backend cargo build --release --features=ee_windows - name: Rename binary with corresponding architecture run: | diff --git a/backend/windmill-worker/src/ansible_executor.rs b/backend/windmill-worker/src/ansible_executor.rs index 5795c1ccd7..d1e54f97ad 100644 --- a/backend/windmill-worker/src/ansible_executor.rs +++ b/backend/windmill-worker/src/ansible_executor.rs @@ -752,10 +752,12 @@ pub async fn get_git_ssh_cmd( })?; content.push_str("\n"); - let file = write_file(job_dir, &id_file_name, &content)?; + #[cfg(not(unix))] + let _ = write_file(job_dir, &id_file_name, &content)?; #[cfg(unix)] { + let file = write_file(job_dir, &id_file_name, &content)?; let perm = std::os::unix::fs::PermissionsExt::from_mode(0o600); file.set_permissions(perm)?; } @@ -1218,10 +1220,10 @@ fi ANSIBLE_PLAYBOOK_PATH.as_str() ); - let file = write_file(job_dir, "wrapper.sh", &wrapper)?; + let _file = write_file(job_dir, "wrapper.sh", &wrapper)?; #[cfg(unix)] - file.metadata()?.permissions().set_mode(0o777); + _file.metadata()?.permissions().set_mode(0o777); // let mut nsjail_cmd = Command::new(NSJAIL_PATH.as_str()); let mut nsjail_cmd = Command::new(NSJAIL_PATH.as_str()); nsjail_cmd diff --git a/backend/windmill-worker/src/python_versions.rs b/backend/windmill-worker/src/python_versions.rs index 69eaed0425..52636808a6 100644 --- a/backend/windmill-worker/src/python_versions.rs +++ b/backend/windmill-worker/src/python_versions.rs @@ -21,10 +21,12 @@ use windmill_queue::append_logs; use crate::{ common::{start_child_process, OccupancyMetrics}, handle_child::handle_child, - python_executor::{INDEX_CERT, NATIVE_CERT, PYTHON_PATH, UV_PATH}, + python_executor::{INDEX_CERT, NATIVE_CERT, PYTHON_PATH}, HOME_ENV, INSTANCE_PYTHON_VERSION, PATH_ENV, PROXY_ENVS, PY_INSTALL_DIR, UV_CACHE_DIR, WIN_ENVS, }; +#[cfg(unix)] +use crate::python_executor::UV_PATH; impl From for PyVAlias { fn from(value: PyV) -> Self { diff --git a/backend/windmill-worker/src/worker.rs b/backend/windmill-worker/src/worker.rs index be8b44993e..f3cdc241e0 100644 --- a/backend/windmill-worker/src/worker.rs +++ b/backend/windmill-worker/src/worker.rs @@ -12,7 +12,6 @@ use anyhow::anyhow; use futures::TryFutureExt; use tokio::sync::Mutex; -use tokio::time::sleep; use tokio::time::timeout; use windmill_common::client::AuthedClient; use windmill_common::jobs::WorkerInternalServerInlineUtils; @@ -3064,7 +3063,7 @@ pub async fn handle_queued_job( .flatten() { tracing::debug!("Debug: {} going to sleep for {}", job.id, dbg_djob_sleep); - sleep(std::time::Duration::from_secs(dbg_djob_sleep as u64)).await; + tokio::time::sleep(std::time::Duration::from_secs(dbg_djob_sleep as u64)).await; } tracing::debug!(