From 9e5c9887700a87aa22db0e6f4142e0fa964acdaf Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sun, 18 Oct 2026 04:47:24 +0200 Subject: [PATCH] gate unix-only bun staging items for the Windows worker build (#11856) * fix: gate unix-only bun staging items so the Windows worker build compiles Co-Authored-By: Claude Opus 5.5 * fix: compile bun_install_can_stage only where it is used Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- backend/windmill-worker/src/bun_executor.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/windmill-worker/src/bun_executor.rs b/backend/windmill-worker/src/bun_executor.rs index 9a7ccc8685..6da968e422 100644 --- a/backend/windmill-worker/src/bun_executor.rs +++ b/backend/windmill-worker/src/bun_executor.rs @@ -847,6 +847,7 @@ fn install_ca_mounts(job_dir: &str, home: &str, envs: &HashMap) } /// The files `bun install` reads from, and writes to, the directory it installs in. +#[cfg(unix)] const BUN_INSTALL_INPUTS: [&str; 3] = ["package.json", "bun.lock", "bun.lockb"]; const BUN_INSTALL_OUTPUTS: [&str; 3] = ["node_modules", "bun.lock", "bun.lockb"]; /// What the worker reads or mounts from the job dir after an install that ran in it. @@ -923,6 +924,7 @@ struct BunStagingDir { root: Arc, #[cfg(unix)] dir: fs::File, + #[cfg(unix)] name: String, path: String, } @@ -949,11 +951,13 @@ impl Drop for BunStagingDir { /// How long a staging dir may outlive its install before the next one deletes it: a /// worker killed mid-install leaves it behind. Well past the longest install. +#[cfg(unix)] const BUN_STAGING_MAX_AGE: std::time::Duration = std::time::Duration::from_secs(6 * 60 * 60); /// Whether a bun install needs nothing of the job dir beyond [`BUN_INSTALL_INPUTS`]: no /// dependency by path, no workspaces or patches, and no root lifecycle script, which bun /// runs next to the manifest and which may read the job's other files. +#[cfg(any(unix, test))] fn bun_install_can_stage(package_json: &str, lock: Option<&str>) -> bool { const DEP_SECTIONS: [&str; 6] = [ "dependencies",