From cf02e9c052764f6be6525091a8e2b0d7bb46d85d Mon Sep 17 00:00:00 2001 From: Curtis 'Fjord' Hawthorne Date: Fri, 24 Apr 2026 17:47:31 -0700 Subject: [PATCH] Fix Bazel cargo_bin runfiles paths (#19468) ## Summary Fix a Bazel-only path resolution bug in `codex_utils_cargo_bin::cargo_bin`. Under Bazel runfiles, `rlocation` can return a relative `bazel-out/...` path even though `cargo_bin()` documents that it returns an absolute path. That can break callers that store the returned binary path and later spawn it after changing cwd, because the relative path is resolved from the wrong directory. This patch absolutizes the runfiles-resolved path before returning it. --- codex-rs/utils/cargo-bin/src/lib.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/codex-rs/utils/cargo-bin/src/lib.rs b/codex-rs/utils/cargo-bin/src/lib.rs index 6517a77c9..2cb25a6b1 100644 --- a/codex-rs/utils/cargo-bin/src/lib.rs +++ b/codex-rs/utils/cargo-bin/src/lib.rs @@ -91,10 +91,15 @@ fn resolve_bin_from_env(key: &str, value: OsString) -> Result