Fail Windows helper build when manifest embedding breaks

This commit is contained in:
David Wiesen
2026-05-22 09:58:53 -07:00
parent 0035d7bd18
commit 2e8b00b4e1

View File

@@ -1,4 +1,6 @@
fn main() {
println!("cargo:rerun-if-changed=codex-windows-sandbox-setup.manifest");
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"))
{
@@ -11,5 +13,8 @@ fn main() {
let mut res = winres::WindowsResource::new();
res.set_manifest_file("codex-windows-sandbox-setup.manifest");
let _ = res.compile();
// Shipping without this manifest can make Windows treat the helper like
// an installer and reject non-elevated refresh launches with error 740.
res.compile()
.expect("failed to embed codex-windows-sandbox-setup.exe manifest");
}