Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Use cargo_bin in the Windows sandbox manifest test (#56220)

felixxia-oai96a0d8d551a1
diff --git a/codex-rs/windows-sandbox-rs/tests/helper_manifest.rs b/codex-rs/windows-sandbox-rs/tests/helper_manifest.rs
index f068108117..f0f7c43e71 100644
--- a/codex-rs/windows-sandbox-rs/tests/helper_manifest.rs
+++ b/codex-rs/windows-sandbox-rs/tests/helper_manifest.rs
@@ -2,9 +2,9 @@
use anyhow::Context;
use anyhow::Result;
+use codex_utils_cargo_bin::cargo_bin;
use std::io;
use std::os::windows::ffi::OsStrExt;
-use std::path::PathBuf;
use windows_sys::Win32::Foundation::FreeLibrary;
use windows_sys::Win32::System::LibraryLoader::FindResourceW;
use windows_sys::Win32::System::LibraryLoader::LOAD_LIBRARY_AS_DATAFILE;
@@ -19,13 +19,8 @@ use windows_sys::Win32::UI::WindowsAndMessaging::RT_MANIFEST;
/// The setup executable must expose an asInvoker manifest through the Windows resource API.
#[test]
fn setup_helper_embeds_as_invoker_manifest() -> Result<()> {
- let setup_executable = std::env::var_os("CARGO_BIN_EXE_codex-windows-sandbox-setup")
- .or_else(|| std::env::var_os("CARGO_BIN_EXE_codex_windows_sandbox_setup"))
- .map(PathBuf::from)
- .or_else(|| option_env!("CARGO_BIN_EXE_codex-windows-sandbox-setup").map(PathBuf::from))
+ let setup_executable = cargo_bin("codex-windows-sandbox-setup")
.context("locate the Windows sandbox setup executable")?;
- std::fs::metadata(&setup_executable)
- .with_context(|| format!("find setup helper {}", setup_executable.display()))?;
let setup_path = setup_executable
.as_os_str()
.encode_wide()