Fix Windows sandbox build script lint

This commit is contained in:
pakrym-oai
2026-06-04 11:46:11 -07:00
parent 9e41f8ddbe
commit b0620be474
+7 -7
View File
@@ -4,18 +4,16 @@ use std::path::PathBuf;
const SETUP_BIN: &str = "codex-windows-sandbox-setup";
const SETUP_MANIFEST: &str = "codex-windows-sandbox-setup.manifest";
fn main() {
fn main() -> Result<(), String> {
println!("cargo:rerun-if-changed={SETUP_MANIFEST}");
if env::var("CARGO_CFG_TARGET_OS").as_deref() != Ok("windows") {
return;
return Ok(());
}
let manifest_path = PathBuf::from(
env::var_os("CARGO_MANIFEST_DIR")
.expect("CARGO_MANIFEST_DIR should be set for build scripts"),
)
.join(SETUP_MANIFEST);
let manifest_dir = env::var_os("CARGO_MANIFEST_DIR")
.ok_or_else(|| "CARGO_MANIFEST_DIR should be set for build scripts".to_string())?;
let manifest_path = PathBuf::from(manifest_dir).join(SETUP_MANIFEST);
let manifest_path = manifest_path.display();
// Keep this scoped to the setup helper so Codex binaries that link the
@@ -36,4 +34,6 @@ fn main() {
}
_ => {}
}
Ok(())
}