fix: small fixes so Codex compiles on Windows (#673)

Small fixes required:

* `ExitStatusExt` differs because UNIX expects exit code to be `i32`
whereas Windows does `u32`
* Marking a file "executable only by owner" is a bit more involved on
Windows. We just do something approximate for now (and add a TODO) to
get things compiling.

I created this PR on my personal Windows machine and `cargo test` and
`cargo clippy` succeed. Once this is in, I'll rebase
https://github.com/openai/codex/pull/665 on top so Windows stays fixed!
This commit is contained in:
Michael Bolin
2025-04-25 15:58:44 -07:00
committed by GitHub
parent ebd2ae4abd
commit c18f1689a9
2 changed files with 29 additions and 10 deletions

View File

@@ -322,7 +322,7 @@ fn synthetic_exit_status(code: i32) -> ExitStatus {
}
#[cfg(windows)]
fn synthetic_exit_status(code: u32) -> ExitStatus {
fn synthetic_exit_status(code: i32) -> ExitStatus {
use std::os::windows::process::ExitStatusExt;
std::process::ExitStatus::from_raw(code)
std::process::ExitStatus::from_raw(code.try_into().unwrap())
}