Files
jif 18344a972d Centralize executable fixture creation to avoid Linux ETXTBSY races (#48727)
## Why

Concurrent tests can inherit writable descriptors for executable fixtures, causing `ETXTBSY` when those fixtures launch on Linux.

## What changed

Expose shared `write_executable` and `copy_executable` helpers from `codex_utils_cargo_bin` and adopt them in CLI, exec-server, and MCP tests. On Linux, writes and copies complete in separate processes so sibling test spawns cannot inherit the writable descriptors. Script fixtures receive mode `0o755`, and copied executables retain their source permissions.

Remove the executable-busy retry loop from the program resolver test now that its script uses the shared helper.

GitOrigin-RevId: 61624158190bb1e75c27d9eb9c87a2defc147fb7
2026-09-27 15:25:13 +00:00
..

codex-utils-cargo-bin runfiles strategy

We disable the directory-based runfiles strategy and rely on the manifest strategy across all platforms. This avoids Windows path length issues and keeps behavior consistent in local and remote builds on all platforms. Bazel sets RUNFILES_MANIFEST_FILE, and the codex-utils-cargo-bin helpers use the runfiles crate to resolve runfiles via that manifest.

Function behavior:

  • cargo_bin: reads CARGO_BIN_EXE_* environment variables (set by Cargo or Bazel) and resolves them via the runfiles manifest when RUNFILES_MANIFEST_FILE is present. When not under runfiles, it only accepts absolute paths from CARGO_BIN_EXE_* and returns an error otherwise.
  • find_resource!: used by tests to locate fixtures. It chooses the Bazel runfiles resolution path when RUNFILES_MANIFEST_FILE is set, otherwise it falls back to a CARGO_MANIFEST_DIR-relative path for Cargo runs.

Background: