[codex] Add hermetic Wine exec-server test (#27937)

## Why

We want to make it possible for an app-server orchestrator on one OS to
control an exec-server on another host running a different OS. In
practice this kinda already works if you get lucky and the two hosts
have the same path format, but we mangle quite a lot of operations if
either end is Windows.

This test starts exercising that interaction, although right now the
initial bootstrap fails. Future changes will expand the test's
assertions to match improved support.

## What

Stacked on #27964. This adds a small Windows exec-server fixture and a
Linux protocol smoke test using the reusable Wine harness, covering
Windows environment discovery, non-TTY `cmd.exe` execution, output, exit
status, and working directory.

Once we've got the full codex binary cross-building under Bazel we could
consider moving to the real binary instead of the stripped down
exec-server-only binary used here.
This commit is contained in:
Adam Perry @ OpenAI
2026-06-12 20:20:23 -07:00
committed by GitHub
parent b9dc3b7a8b
commit 9d938a46d9
10 changed files with 312 additions and 3 deletions
+10 -2
View File
@@ -13,6 +13,7 @@ _WINE_RUNTIME_BINARIES = {
def wine_rust_test(
name,
windows_binaries,
host_binaries = {},
data = [],
target_compatible_with = [],
**kwargs):
@@ -22,7 +23,8 @@ def wine_rust_test(
every Rust dependency receives the repository's Windows linker flags while
the test stays on x86-64 Linux. Its environment-variable contract is:
* Each entry contributes `CARGO_BIN_EXE_<binary_name>` for its executable.
* Each `host_binaries` and `windows_binaries` entry contributes
`CARGO_BIN_EXE_<binary_name>` for its executable.
* `CARGO_BIN_EXE_wine` and `CARGO_BIN_EXE_wineserver` identify Wine tools.
* `CARGO_BIN_EXE_wine-runtime-marker` identifies a file whose parent is the
Wine DLL directory to use as `WINEDLLPATH`.
@@ -34,14 +36,20 @@ def wine_rust_test(
Args:
name: Name of the generated Linux `rust_test`.
windows_binaries: Map from `CARGO_BIN_EXE_*` suffixes to Windows targets.
host_binaries: Map from `CARGO_BIN_EXE_*` suffixes to Linux host targets.
data: Additional runtime data for the Linux test.
target_compatible_with: Additional compatibility constraints.
**kwargs: Remaining attributes forwarded to `rust_test`.
"""
binaries = dict(_WINE_RUNTIME_BINARIES)
for binary_name in sorted(host_binaries.keys()):
if binary_name in binaries:
fail("host test binary name collides with Wine runtime: {}".format(binary_name))
binaries[binary_name] = host_binaries[binary_name]
for index, binary_name in enumerate(sorted(windows_binaries.keys())):
if binary_name in binaries:
fail("Windows test binary name collides with Wine runtime: {}".format(binary_name))
fail("Windows test binary name collides with existing binary: {}".format(binary_name))
transitioned_binary = name + "-windows-binary-" + str(index)
foreign_platform_binary(
name = transitioned_binary,