From 6b8df7a6365b3463139e8455e88a8edddaf5a55a Mon Sep 17 00:00:00 2001 From: Michael Bolin Date: Fri, 3 Apr 2026 14:20:28 -0700 Subject: [PATCH] Skip winres manifest under Bazel gnullvm --- codex-rs/windows-sandbox-rs/build.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/codex-rs/windows-sandbox-rs/build.rs b/codex-rs/windows-sandbox-rs/build.rs index 768f6e8280..3aca5b7e3e 100644 --- a/codex-rs/windows-sandbox-rs/build.rs +++ b/codex-rs/windows-sandbox-rs/build.rs @@ -1,4 +1,14 @@ fn main() { + if std::env::var_os("RULES_RUST_BAZEL_BUILD_SCRIPT_RUNNER").is_some() + && matches!(std::env::var("CARGO_CFG_TARGET_ENV").as_deref(), Ok("gnu")) + { + // The Windows Bazel lint/test lane targets `windows-gnullvm`, where + // `winres` can emit a `resource` link directive without a usable + // archive in `OUT_DIR`. Skip embedding the manifest there; Cargo's + // normal MSVC builds still compile it. + return; + } + let mut res = winres::WindowsResource::new(); res.set_manifest_file("codex-windows-sandbox-setup.manifest"); let _ = res.compile();