codex/justfile

205 lines
7.3 KiB

[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
test: set Rust test thread stack size (#19067) ## Summary Set `RUST_MIN_STACK=8388608` for Rust test entry points so libtest-spawned test threads get an 8 MiB stack. The Windows BuildBuddy failure on #18893 showed `//codex-rs/tui:tui-unit-tests` exiting with a stack overflow in a `#[tokio::test]` even though later test binaries in the shard printed successful summaries. Default `#[tokio::test]` uses a current-thread Tokio runtime, which means the async test body is driven on libtest's std-spawned test thread. Increasing the test thread stack addresses that failure mode directly. To date, we have been fixing these stack-pressure problems with localized future-size reductions, such as #13429, and by adding `Box::pin()` in specific async wrapper chains. This gives us a baseline test-runner stack size instead of continuing to patch individual tests only after CI finds another large async future. ## What changed - Added `common --test_env=RUST_MIN_STACK=8388608` in `.bazelrc` so Bazel test actions receive the env var through Bazel's cache-keyed test environment path. - Set the same `RUST_MIN_STACK` value for Cargo/nextest CI entry points and `just test`. - Annotated the existing Windows Bazel linker stack reserve as 8 MiB so it stays aligned with the libtest thread stack size. ## Testing - `just --list` - parsed `.github/workflows/rust-ci.yml` and `.github/workflows/rust-ci-full.yml` with Ruby's YAML loader - compared `bazel aquery` `TestRunner` action keys before/after explicit `--test_env=RUST_MIN_STACK=...` and after moving the Bazel env to `.bazelrc` - `bazel test //codex-rs/tui:tui-unit-tests --test_output=errors` - failed locally on the existing sandbox-specific status snapshot permission mismatch, but loaded the Starlark changes and ran the TUI test shards
2026-04-22 19:51:49 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
test: set Rust test thread stack size (#19067) ## Summary Set `RUST_MIN_STACK=8388608` for Rust test entry points so libtest-spawned test threads get an 8 MiB stack. The Windows BuildBuddy failure on #18893 showed `//codex-rs/tui:tui-unit-tests` exiting with a stack overflow in a `#[tokio::test]` even though later test binaries in the shard printed successful summaries. Default `#[tokio::test]` uses a current-thread Tokio runtime, which means the async test body is driven on libtest's std-spawned test thread. Increasing the test thread stack addresses that failure mode directly. To date, we have been fixing these stack-pressure problems with localized future-size reductions, such as #13429, and by adding `Box::pin()` in specific async wrapper chains. This gives us a baseline test-runner stack size instead of continuing to patch individual tests only after CI finds another large async future. ## What changed - Added `common --test_env=RUST_MIN_STACK=8388608` in `.bazelrc` so Bazel test actions receive the env var through Bazel's cache-keyed test environment path. - Set the same `RUST_MIN_STACK` value for Cargo/nextest CI entry points and `just test`. - Annotated the existing Windows Bazel linker stack reserve as 8 MiB so it stays aligned with the libtest thread stack size. ## Testing - `just --list` - parsed `.github/workflows/rust-ci.yml` and `.github/workflows/rust-ci-full.yml` with Ruby's YAML loader - compared `bazel aquery` `TestRunner` action keys before/after explicit `--test_env=RUST_MIN_STACK=...` and after moving the Bazel env to `.bazelrc` - `bazel test //codex-rs/tui:tui-unit-tests --test_output=errors` - failed locally on the existing sandbox-specific status snapshot permission mismatch, but loaded the Starlark changes and ran the TUI test shards
2026-04-22 19:51:49 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
[codex] Add comprehensive root formatting check (#25683) ## Why The root formatting entrypoints could drift: `just fmt` did not format the Justfile itself, and the CI-facing check recipe only checked Python scripts instead of matching everything formatted by `just fmt`. ## What changed - Add a shared cross-platform Python formatter driver used by both `just fmt` and `just fmt-check`. - Run Justfile, Rust, Python SDK, and internal-script formatter groups concurrently while buffering each formatter group's output until it finishes. - Log formatter starts immediately, then print each formatter group's labeled output when it completes. - Keep the SDK lint-fix and Ruff formatting passes ordered, with source comments explaining their distinct roles and the check-mode equivalents. - Run Ruff through shared `uv run --no-sync --with ruff` overlays so formatting works on clean glibc Linux checkouts without installing the platform-specific SDK runtime wheel. - Show `fmt-check` help text in `just -l` and simplify CI to call the shared driver through `just fmt-check`. - Pin the general CI workflow to `just@1.51.0` so its formatter agrees with the checked-in Justfile. - Add regression coverage for the thin Just recipes and the driver's formatter graph. ## Validation - `just fmt` - `just fmt-check` - `python3 -m pytest sdk/python/tests/test_artifact_workflow_and_binaries.py -k 'root_fmt or root_format' -q` - `pnpm run format` - `git diff --check` - `just -l | rg -n '^ fmt|fmt-check'` - `uvx --from uv==0.7.22 uv run --frozen --project sdk/python --no-sync --with ruff ruff check --diff sdk/python`
2026-06-01 18:20:25 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
[codex] Add comprehensive root formatting check (#25683) ## Why The root formatting entrypoints could drift: `just fmt` did not format the Justfile itself, and the CI-facing check recipe only checked Python scripts instead of matching everything formatted by `just fmt`. ## What changed - Add a shared cross-platform Python formatter driver used by both `just fmt` and `just fmt-check`. - Run Justfile, Rust, Python SDK, and internal-script formatter groups concurrently while buffering each formatter group's output until it finishes. - Log formatter starts immediately, then print each formatter group's labeled output when it completes. - Keep the SDK lint-fix and Ruff formatting passes ordered, with source comments explaining their distinct roles and the check-mode equivalents. - Run Ruff through shared `uv run --no-sync --with ruff` overlays so formatting works on clean glibc Linux checkouts without installing the platform-specific SDK runtime wheel. - Show `fmt-check` help text in `just -l` and simplify CI to call the shared driver through `just fmt-check`. - Pin the general CI workflow to `just@1.51.0` so its formatter agrees with the checked-in Justfile. - Add regression coverage for the thin Just recipes and the driver's formatter graph. ## Validation - `just fmt` - `just fmt-check` - `python3 -m pytest sdk/python/tests/test_artifact_workflow_and_binaries.py -k 'root_fmt or root_format' -q` - `pnpm run format` - `git diff --check` - `just -l | rg -n '^ fmt|fmt-check'` - `uvx --from uv==0.7.22 uv run --frozen --project sdk/python --no-sync --with ruff ruff check --diff sdk/python`
2026-06-01 18:20:25 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
Use released DotSlash package for argument-comment lint (#15199) ## Why The argument-comment lint now has a packaged DotSlash artifact from [#15198](https://github.com/openai/codex/pull/15198), so the normal repo lint path should use that released payload instead of rebuilding the lint from source every time. That keeps `just clippy` and CI aligned with the shipped artifact while preserving a separate source-build path for people actively hacking on the lint crate. The current alpha package also exposed two integration wrinkles that the repo-side prebuilt wrapper needs to smooth over: - the bundled Dylint library filename includes the host triple, for example `@nightly-2025-09-18-aarch64-apple-darwin`, and Dylint derives `RUSTUP_TOOLCHAIN` from that filename - on Windows, Dylint's driver path also expects `RUSTUP_HOME` to be present in the environment Without those adjustments, the prebuilt CI jobs fail during `cargo metadata` or driver setup. This change makes the checked-in prebuilt wrapper normalize the packaged library name to the plain `nightly-2025-09-18` channel before invoking `cargo-dylint`, and it teaches both the wrapper and the packaged runner source to infer `RUSTUP_HOME` from `rustup show home` when the environment does not already provide it. After the prebuilt Windows lint job started running successfully, it also surfaced a handful of existing anonymous literal callsites in `windows-sandbox-rs`. This PR now annotates those callsites so the new cross-platform lint job is green on the current tree. ## What Changed - checked in the current `tools/argument-comment-lint/argument-comment-lint` DotSlash manifest - kept `tools/argument-comment-lint/run.sh` as the source-build wrapper for lint development - added `tools/argument-comment-lint/run-prebuilt-linter.sh` as the normal enforcement path, using the checked-in DotSlash package and bundled `cargo-dylint` - updated `just clippy` and `just argument-comment-lint` to use the prebuilt wrapper - split `.github/workflows/rust-ci.yml` so source-package checks live in a dedicated `argument_comment_lint_package` job, while the released lint runs in an `argument_comment_lint_prebuilt` matrix on Linux, macOS, and Windows - kept the pinned `nightly-2025-09-18` toolchain install in the prebuilt CI matrix, since the prebuilt package still relies on rustup-provided toolchain components - updated `tools/argument-comment-lint/run-prebuilt-linter.sh` to normalize host-qualified nightly library filenames, keep the `rustup` shim directory ahead of direct toolchain `cargo` binaries, and export `RUSTUP_HOME` when needed for Windows Dylint driver setup - updated `tools/argument-comment-lint/src/bin/argument-comment-lint.rs` so future published DotSlash artifacts apply the same nightly-filename normalization and `RUSTUP_HOME` inference internally - fixed the remaining Windows lint violations in `codex-rs/windows-sandbox-rs` by adding the required `/*param*/` comments at the reported callsites - documented the checked-in DotSlash file, wrapper split, archive layout, nightly prerequisite, and Windows `RUSTUP_HOME` requirement in `tools/argument-comment-lint/README.md`
2026-03-19 20:19:22 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
[codex] Speed up local nextest runs (#26479) ## Why `just test` currently uses the CI-oriented nextest profile, which serializes app-server integration tests even on developer machines that can run several safely. Bounded local parallelism substantially shortens this common iteration loop without changing CI behavior. Eight-worker experiments were faster, but keeping them reliable required relaxing several test deadlines. Four workers for integration tests is a solid tradeoff that speeds up local testing without needing to change test logic. ## What changed - Add a `local` nextest profile that inherits the existing defaults. - Allow up to four app-server integration tests to run concurrently under that profile. - Make `just test` select the local profile on Unix and Windows. - Keep the default CI profile serialized and leave all test deadlines unchanged. The tests use separate processes, randomized temporary `CODEX_HOME` directories, and ephemeral ports. The remaining shared constraints are system resources; each app-server also uses a multi-thread Tokio runtime, and fuzzy-search tests can create additional worker threads, so the local cap remains intentionally conservative. ## Performance and validation All measurements below are warm, execution-only app-server runs with nextest retries disabled. On the current rebased branch, an AMD EPYC 7763 machine with 16 logical CPUs and 62 GiB RAM completed three consecutive runs: | Run | Nextest time | Wall time | Result | | --- | ---: | ---: | --- | | 1 | 142.941s | 145.17s | 836/836 passed | | 2 | 143.402s | 145.59s | 836/836 passed | | 3 | 142.870s | 145.08s | 836/836 passed | The mean wall time was 145.28s. The slow-inventory, approval replay, and zsh-fork tests all passed with their original deadlines. Earlier measurements on the same Linux machine, before the suite grew, showed the scaling that motivated the change: | App-server concurrency | Nextest time | Result | | --- | ---: | --- | | 1 | 369.5s | 572/572 passed | | 2 | 194.5s | 572/572 passed | | 4 | 111.0s mean over 3 runs | 3/3 clean | Four workers reduced that execution time by about 70%, a roughly 3.3x speedup over serialization.
2026-06-09 12:48:04 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
[codex] Speed up local nextest runs (#26479) ## Why `just test` currently uses the CI-oriented nextest profile, which serializes app-server integration tests even on developer machines that can run several safely. Bounded local parallelism substantially shortens this common iteration loop without changing CI behavior. Eight-worker experiments were faster, but keeping them reliable required relaxing several test deadlines. Four workers for integration tests is a solid tradeoff that speeds up local testing without needing to change test logic. ## What changed - Add a `local` nextest profile that inherits the existing defaults. - Allow up to four app-server integration tests to run concurrently under that profile. - Make `just test` select the local profile on Unix and Windows. - Keep the default CI profile serialized and leave all test deadlines unchanged. The tests use separate processes, randomized temporary `CODEX_HOME` directories, and ephemeral ports. The remaining shared constraints are system resources; each app-server also uses a multi-thread Tokio runtime, and fuzzy-search tests can create additional worker threads, so the local cap remains intentionally conservative. ## Performance and validation All measurements below are warm, execution-only app-server runs with nextest retries disabled. On the current rebased branch, an AMD EPYC 7763 machine with 16 logical CPUs and 62 GiB RAM completed three consecutive runs: | Run | Nextest time | Wall time | Result | | --- | ---: | ---: | --- | | 1 | 142.941s | 145.17s | 836/836 passed | | 2 | 143.402s | 145.59s | 836/836 passed | | 3 | 142.870s | 145.08s | 836/836 passed | The mean wall time was 145.28s. The slow-inventory, approval replay, and zsh-fork tests all passed with their original deadlines. Earlier measurements on the same Linux machine, before the suite grew, showed the scaling that motivated the change: | App-server concurrency | Nextest time | Result | | --- | ---: | --- | | 1 | 369.5s | 572/572 passed | | 2 | 194.5s | 572/572 passed | | 4 | 111.0s mean over 3 runs | 3/3 clean | Four workers reduced that execution time by about 70%, a roughly 3.3x speedup over serialization.
2026-06-09 12:48:04 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
[codex] Fix Windows BuildBuddy Bazel wrapper execution (#25915) ## Why #25156 moved Bazel CI launches into a shared Python wrapper. On Windows, launching Bazel with `os.execvp` can split the spaced `--test_env=PATH=...` argument and fail to propagate the eventual Bazel exit status, allowing jobs to pass without running tests. This reapplies the wrapper after #25909 with a Windows-safe launch path. ## What changed Use a waited `subprocess.run` launch on Windows while preserving `os.execvp` on Unix. Add a process-level regression test for spaced arguments and child exit status, and run it on Windows Bazel shard 1. ## Experiment To confirm Bazel was actually invoking tests, patch `87b61d0be6` temporarily added an intentionally failing `codex-core` unit test. Bazel failed on that sentinel on all three major platforms: - [Linux Bazel test](https://github.com/openai/codex/actions/runs/26841132773/job/79151062486) - [macOS Bazel test](https://github.com/openai/codex/actions/runs/26841132773/job/79151062362) - [Windows Bazel test shard 1/4](https://github.com/openai/codex/actions/runs/26841132773/job/79151062155) The sentinel was removed after collecting this evidence. Windows Bazel [clippy](https://github.com/openai/codex/actions/runs/26841132773/job/79151062914) and [release verification](https://github.com/openai/codex/actions/runs/26841132773/job/79151062739) also passed. ## Validation After removing the sentinel, `just test -p codex-core` no longer reported it. The local run retained two unrelated environment-specific failures.
2026-06-02 16:22:32 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
[codex] Add comprehensive root formatting check (#25683) ## Why The root formatting entrypoints could drift: `just fmt` did not format the Justfile itself, and the CI-facing check recipe only checked Python scripts instead of matching everything formatted by `just fmt`. ## What changed - Add a shared cross-platform Python formatter driver used by both `just fmt` and `just fmt-check`. - Run Justfile, Rust, Python SDK, and internal-script formatter groups concurrently while buffering each formatter group's output until it finishes. - Log formatter starts immediately, then print each formatter group's labeled output when it completes. - Keep the SDK lint-fix and Ruff formatting passes ordered, with source comments explaining their distinct roles and the check-mode equivalents. - Run Ruff through shared `uv run --no-sync --with ruff` overlays so formatting works on clean glibc Linux checkouts without installing the platform-specific SDK runtime wheel. - Show `fmt-check` help text in `just -l` and simplify CI to call the shared driver through `just fmt-check`. - Pin the general CI workflow to `just@1.51.0` so its formatter agrees with the checked-in Justfile. - Add regression coverage for the thin Just recipes and the driver's formatter graph. ## Validation - `just fmt` - `just fmt-check` - `python3 -m pytest sdk/python/tests/test_artifact_workflow_and_binaries.py -k 'root_fmt or root_format' -q` - `pnpm run format` - `git diff --check` - `just -l | rg -n '^ fmt|fmt-check'` - `uvx --from uv==0.7.22 uv run --frozen --project sdk/python --no-sync --with ruff ruff check --diff sdk/python`
2026-06-01 18:20:25 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
[codex] Add comprehensive root formatting check (#25683) ## Why The root formatting entrypoints could drift: `just fmt` did not format the Justfile itself, and the CI-facing check recipe only checked Python scripts instead of matching everything formatted by `just fmt`. ## What changed - Add a shared cross-platform Python formatter driver used by both `just fmt` and `just fmt-check`. - Run Justfile, Rust, Python SDK, and internal-script formatter groups concurrently while buffering each formatter group's output until it finishes. - Log formatter starts immediately, then print each formatter group's labeled output when it completes. - Keep the SDK lint-fix and Ruff formatting passes ordered, with source comments explaining their distinct roles and the check-mode equivalents. - Run Ruff through shared `uv run --no-sync --with ruff` overlays so formatting works on clean glibc Linux checkouts without installing the platform-specific SDK runtime wheel. - Show `fmt-check` help text in `just -l` and simplify CI to call the shared driver through `just fmt-check`. - Pin the general CI workflow to `just@1.51.0` so its formatter agrees with the checked-in Justfile. - Add regression coverage for the thin Just recipes and the driver's formatter graph. ## Validation - `just fmt` - `just fmt-check` - `python3 -m pytest sdk/python/tests/test_artifact_workflow_and_binaries.py -k 'root_fmt or root_format' -q` - `pnpm run format` - `git diff --check` - `just -l | rg -n '^ fmt|fmt-check'` - `uvx --from uv==0.7.22 uv run --frozen --project sdk/python --no-sync --with ruff ruff check --diff sdk/python`
2026-06-01 18:20:25 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
[codex] Add comprehensive root formatting check (#25683) ## Why The root formatting entrypoints could drift: `just fmt` did not format the Justfile itself, and the CI-facing check recipe only checked Python scripts instead of matching everything formatted by `just fmt`. ## What changed - Add a shared cross-platform Python formatter driver used by both `just fmt` and `just fmt-check`. - Run Justfile, Rust, Python SDK, and internal-script formatter groups concurrently while buffering each formatter group's output until it finishes. - Log formatter starts immediately, then print each formatter group's labeled output when it completes. - Keep the SDK lint-fix and Ruff formatting passes ordered, with source comments explaining their distinct roles and the check-mode equivalents. - Run Ruff through shared `uv run --no-sync --with ruff` overlays so formatting works on clean glibc Linux checkouts without installing the platform-specific SDK runtime wheel. - Show `fmt-check` help text in `just -l` and simplify CI to call the shared driver through `just fmt-check`. - Pin the general CI workflow to `just@1.51.0` so its formatter agrees with the checked-in Justfile. - Add regression coverage for the thin Just recipes and the driver's formatter graph. ## Validation - `just fmt` - `just fmt-check` - `python3 -m pytest sdk/python/tests/test_artifact_workflow_and_binaries.py -k 'root_fmt or root_format' -q` - `pnpm run format` - `git diff --check` - `just -l | rg -n '^ fmt|fmt-check'` - `uvx --from uv==0.7.22 uv run --frozen --project sdk/python --no-sync --with ruff ruff check --diff sdk/python`
2026-06-01 18:20:25 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
feat: add support for building with Bazel (#8875) This PR configures Codex CLI so it can be built with [Bazel](https://bazel.build) in addition to Cargo. The `.bazelrc` includes configuration so that remote builds can be done using [BuildBuddy](https://www.buildbuddy.io). If you are familiar with Bazel, things should work as you expect, e.g., run `bazel test //... --keep-going` to run all the tests in the repo, but we have also added some new aliases in the `justfile` for convenience: - `just bazel-test` to run tests locally - `just bazel-remote-test` to run tests remotely (currently, the remote build is for x86_64 Linux regardless of your host platform). Note we are currently seeing the following test failures in the remote build, so we still need to figure out what is happening here: ``` failures: suite::compact::manual_compact_twice_preserves_latest_user_messages suite::compact_resume_fork::compact_resume_after_second_compaction_preserves_history suite::compact_resume_fork::compact_resume_and_fork_preserve_model_history_view ``` - `just build-for-release` to build release binaries for all platforms/architectures remotely To setup remote execution: - [Create a buildbuddy account](https://app.buildbuddy.io/) (OpenAI employees should also request org access at https://openai.buildbuddy.io/join/ with their `@openai.com` email address.) - [Copy your API key](https://app.buildbuddy.io/docs/setup/) to `~/.bazelrc` (add the line `build --remote_header=x-buildbuddy-api-key=YOUR_KEY`) - Use `--config=remote` in your `bazel` invocations (or add `common --config=remote` to your `~/.bazelrc`, or use the `just` commands) ## CI In terms of CI, this PR introduces `.github/workflows/bazel.yml`, which uses Bazel to run the tests _locally_ on Mac and Linux GitHub runners (we are working on supporting Windows, but that is not ready yet). Note that the failures we are seeing in `just bazel-remote-test` do not occur on these GitHub CI jobs, so everything in `.github/workflows/bazel.yml` is green right now. The `bazel.yml` uses extra config in `.github/workflows/ci.bazelrc` so that macOS CI jobs build _remotely_ on Linux hosts (using the `docker://docker.io/mbolin491/codex-bazel` Docker image declared in the root `BUILD.bazel`) using cross-compilation to build the macOS artifacts. Then these artifacts are downloaded locally to GitHub's macOS runner so the tests can be executed natively. This is the relevant config that enables this: ``` common:macos --config=remote common:macos --strategy=remote common:macos --strategy=TestRunner=darwin-sandbox,local ``` Because of the remote caching benefits we get from BuildBuddy, these new CI jobs can be extremely fast! For example, consider these two jobs that ran all the tests on Linux x86_64: - Bazel 1m37s https://github.com/openai/codex/actions/runs/20861063212/job/59940545209?pr=8875 - Cargo 9m20s https://github.com/openai/codex/actions/runs/20861063192/job/59940559592?pr=8875 For now, we will continue to run both the Bazel and Cargo jobs for PRs, but once we add support for Windows and running Clippy, we should be able to cutover to using Bazel exclusively for PRs, which should still speed things up considerably. We will probably continue to run the Cargo jobs post-merge for commits that land on `main` as a sanity check. Release builds will also continue to be done by Cargo for now. Earlier attempt at this PR: https://github.com/openai/codex/pull/8832 Earlier attempt to add support for Buck2, now abandoned: https://github.com/openai/codex/pull/8504 --------- Co-authored-by: David Zbarsky <dzbarsky@gmail.com> Co-authored-by: Michael Bolin <mbolin@openai.com>
2026-01-09 14:09:43 -05:00
build: migrate argument-comment-lint to a native Bazel aspect (#16106) ## Why `argument-comment-lint` had become a PR bottleneck because the repo-wide lane was still effectively running a `cargo dylint`-style flow across the workspace instead of reusing Bazel's Rust dependency graph. That kept the lint enforced, but it threw away the main benefit of moving this job under Bazel in the first place: metadata reuse and cacheable per-target analysis in the same shape as Clippy. This change moves the repo-wide lint onto a native Bazel Rust aspect so Linux and macOS can lint `codex-rs` without rebuilding the world crate-by-crate through the wrapper path. ## What Changed - add a nightly Rust toolchain with `rustc-dev` for Bazel and a dedicated crate-universe repo for `tools/argument-comment-lint` - add `tools/argument-comment-lint/driver.rs` and `tools/argument-comment-lint/lint_aspect.bzl` so Bazel can run the lint as a custom `rustc_driver` - switch repo-wide `just argument-comment-lint` and the Linux/macOS `rust-ci` lanes to `bazel build --config=argument-comment-lint //codex-rs/...` - keep the Python/DotSlash wrappers as the package-scoped fallback path and as the current Windows CI path - gate the Dylint entrypoint behind a `bazel_native` feature so the Bazel-native library avoids the `dylint_*` packaging stack - update the aspect runtime environment so the driver can locate `rustc_driver` correctly under remote execution - keep the dedicated `tools/argument-comment-lint` package tests and wrapper unit tests in CI so the source and packaged entrypoints remain covered ## Verification - `python3 -m unittest discover -s tools/argument-comment-lint -p 'test_*.py'` - `cargo test` in `tools/argument-comment-lint` - `bazel build //tools/argument-comment-lint:argument-comment-lint-driver --@rules_rust//rust/toolchain/channel=nightly` - `bazel build --config=argument-comment-lint //codex-rs/utils/path-utils:all` - `bazel build --config=argument-comment-lint //codex-rs/rollout:rollout` --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/openai/codex/pull/16106). * #16120 * __->__ #16106
2026-03-28 12:41:56 -07:00
feat: add support for building with Bazel (#8875) This PR configures Codex CLI so it can be built with [Bazel](https://bazel.build) in addition to Cargo. The `.bazelrc` includes configuration so that remote builds can be done using [BuildBuddy](https://www.buildbuddy.io). If you are familiar with Bazel, things should work as you expect, e.g., run `bazel test //... --keep-going` to run all the tests in the repo, but we have also added some new aliases in the `justfile` for convenience: - `just bazel-test` to run tests locally - `just bazel-remote-test` to run tests remotely (currently, the remote build is for x86_64 Linux regardless of your host platform). Note we are currently seeing the following test failures in the remote build, so we still need to figure out what is happening here: ``` failures: suite::compact::manual_compact_twice_preserves_latest_user_messages suite::compact_resume_fork::compact_resume_after_second_compaction_preserves_history suite::compact_resume_fork::compact_resume_and_fork_preserve_model_history_view ``` - `just build-for-release` to build release binaries for all platforms/architectures remotely To setup remote execution: - [Create a buildbuddy account](https://app.buildbuddy.io/) (OpenAI employees should also request org access at https://openai.buildbuddy.io/join/ with their `@openai.com` email address.) - [Copy your API key](https://app.buildbuddy.io/docs/setup/) to `~/.bazelrc` (add the line `build --remote_header=x-buildbuddy-api-key=YOUR_KEY`) - Use `--config=remote` in your `bazel` invocations (or add `common --config=remote` to your `~/.bazelrc`, or use the `just` commands) ## CI In terms of CI, this PR introduces `.github/workflows/bazel.yml`, which uses Bazel to run the tests _locally_ on Mac and Linux GitHub runners (we are working on supporting Windows, but that is not ready yet). Note that the failures we are seeing in `just bazel-remote-test` do not occur on these GitHub CI jobs, so everything in `.github/workflows/bazel.yml` is green right now. The `bazel.yml` uses extra config in `.github/workflows/ci.bazelrc` so that macOS CI jobs build _remotely_ on Linux hosts (using the `docker://docker.io/mbolin491/codex-bazel` Docker image declared in the root `BUILD.bazel`) using cross-compilation to build the macOS artifacts. Then these artifacts are downloaded locally to GitHub's macOS runner so the tests can be executed natively. This is the relevant config that enables this: ``` common:macos --config=remote common:macos --strategy=remote common:macos --strategy=TestRunner=darwin-sandbox,local ``` Because of the remote caching benefits we get from BuildBuddy, these new CI jobs can be extremely fast! For example, consider these two jobs that ran all the tests on Linux x86_64: - Bazel 1m37s https://github.com/openai/codex/actions/runs/20861063212/job/59940545209?pr=8875 - Cargo 9m20s https://github.com/openai/codex/actions/runs/20861063192/job/59940559592?pr=8875 For now, we will continue to run both the Bazel and Cargo jobs for PRs, but once we add support for Windows and running Clippy, we should be able to cutover to using Bazel exclusively for PRs, which should still speed things up considerably. We will probably continue to run the Cargo jobs post-merge for commits that land on `main` as a sanity check. Release builds will also continue to be done by Cargo for now. Earlier attempt at this PR: https://github.com/openai/codex/pull/8832 Earlier attempt to add support for Buck2, now abandoned: https://github.com/openai/codex/pull/8504 --------- Co-authored-by: David Zbarsky <dzbarsky@gmail.com> Co-authored-by: Michael Bolin <mbolin@openai.com>
2026-01-09 14:09:43 -05:00
ci: align Bazel repo cache and Windows clippy target handling (#16740) ## Why Bazel CI had two independent Windows issues: - The workflow saved/restored `~/.cache/bazel-repo-cache`, but `.bazelrc` configured `common:ci-windows --repository_cache=D:/a/.cache/bazel-repo-cache`, so `actions/cache` and Bazel could point at different directories. - The Windows `Bazel clippy` job passed the full explicit target list from `//codex-rs/...`, but some of those explicit targets are intentionally incompatible with `//:local_windows`. `run-argument-comment-lint-bazel.sh` already handles that with `--skip_incompatible_explicit_targets`; the clippy workflow path did not. I also tried switching the workflow cache path to `D:\a\.cache\bazel-repo-cache`, but the Windows clippy job repeatedly failed with `Failed to restore: Cache service responded with 400`, so the final change standardizes on `$HOME/.cache/bazel-repo-cache` and makes cache restore non-fatal. ## What Changed - Expose one repository-cache path from `.github/actions/setup-bazel-ci/action.yml` and export that path as `BAZEL_REPOSITORY_CACHE` so `run-bazel-ci.sh` passes it to Bazel after `--config=ci-*`. - Move `actions/cache/restore` out of the composite action into `.github/workflows/bazel.yml`, and make restore failures non-fatal there. - Save exactly the exported cache path in `.github/workflows/bazel.yml`. - Remove `common:ci-windows --repository_cache=D:/a/.cache/bazel-repo-cache` from `.bazelrc` so the Windows CI config no longer disagrees with the workflow cache path. - Pass `--skip_incompatible_explicit_targets` in the Windows `Bazel clippy` job so incompatible explicit targets do not fail analysis while the lint aspect still traverses compatible Rust dependencies. ## Verification - Parsed `.github/actions/setup-bazel-ci/action.yml` and `.github/workflows/bazel.yml` with Ruby's YAML loader. - Resubmitted PR `#16740`; CI is rerunning on the amended commit.
2026-04-03 20:18:33 -07:00
[codex] Add comprehensive root formatting check (#25683) ## Why The root formatting entrypoints could drift: `just fmt` did not format the Justfile itself, and the CI-facing check recipe only checked Python scripts instead of matching everything formatted by `just fmt`. ## What changed - Add a shared cross-platform Python formatter driver used by both `just fmt` and `just fmt-check`. - Run Justfile, Rust, Python SDK, and internal-script formatter groups concurrently while buffering each formatter group's output until it finishes. - Log formatter starts immediately, then print each formatter group's labeled output when it completes. - Keep the SDK lint-fix and Ruff formatting passes ordered, with source comments explaining their distinct roles and the check-mode equivalents. - Run Ruff through shared `uv run --no-sync --with ruff` overlays so formatting works on clean glibc Linux checkouts without installing the platform-specific SDK runtime wheel. - Show `fmt-check` help text in `just -l` and simplify CI to call the shared driver through `just fmt-check`. - Pin the general CI workflow to `just@1.51.0` so its formatter agrees with the checked-in Justfile. - Add regression coverage for the thin Just recipes and the driver's formatter graph. ## Validation - `just fmt` - `just fmt-check` - `python3 -m pytest sdk/python/tests/test_artifact_workflow_and_binaries.py -k 'root_fmt or root_format' -q` - `pnpm run format` - `git diff --check` - `just -l | rg -n '^ fmt|fmt-check'` - `uvx --from uv==0.7.22 uv run --frozen --project sdk/python --no-sync --with ruff ruff check --diff sdk/python`
2026-06-01 18:20:25 -07:00
ci: add Bazel clippy workflow for codex-rs (#15955) ## Why `bazel.yml` already builds and tests the Bazel graph, but `rust-ci.yml` still runs `cargo clippy` separately. This PR starts the transition to a Bazel-backed lint lane for `codex-rs` so we can eventually replace the duplicate Rust build, test, and lint work with Bazel while explicitly keeping the V8 Bazel path out of scope for now. To make that lane practical, the workflow also needs to look like the Bazel job we already trust. That means sharing the common Bazel setup and invocation logic instead of hand-copying it, and covering the arm64 macOS path in addition to Linux. Landing the workflow green also required fixing the first lint findings that Bazel surfaced and adding the matching local entrypoint. ## What changed - add a reusable `build:clippy` config to `.bazelrc` and export `codex-rs/clippy.toml` from `codex-rs/BUILD.bazel` so Bazel can run the repository's existing Clippy policy - add `just bazel-clippy` so the local developer entrypoint matches the new CI lane - extend `.github/workflows/bazel.yml` with a dedicated Bazel clippy job for `codex-rs`, scoped to `//codex-rs/... -//codex-rs/v8-poc:all` - run that clippy job on Linux x64 and arm64 macOS - factor the shared Bazel workflow setup into `.github/actions/setup-bazel-ci/action.yml` and the shared Bazel invocation logic into `.github/scripts/run-bazel-ci.sh` so the clippy and build/test jobs stay aligned - fix the first Bazel-clippy findings needed to keep the lane green, including the cross-target `cmsghdr::cmsg_len` normalization in `codex-rs/shell-escalation/src/unix/socket.rs` and the no-`voice-input` dead-code warnings in `codex-rs/tui` and `codex-rs/tui_app_server` ## Verification - `just bazel-clippy` - `RUNNER_OS=macOS ./.github/scripts/run-bazel-ci.sh -- build --config=clippy --build_metadata=COMMIT_SHA=local-check --build_metadata=TAG_job=clippy -- //codex-rs/... -//codex-rs/v8-poc:all` - `bazel build --config=clippy //codex-rs/shell-escalation:shell-escalation` - `CARGO_TARGET_DIR=/tmp/codex4-shell-escalation-test cargo test -p codex-shell-escalation` - `ruby -e 'require "yaml"; YAML.load_file(".github/workflows/bazel.yml"); YAML.load_file(".github/actions/setup-bazel-ci/action.yml")'` ## Notes - `CARGO_TARGET_DIR=/tmp/codex4-tui-app-server-test cargo test -p codex-tui-app-server` still hits existing guardian-approvals test and snapshot failures unrelated to this PR's Bazel-clippy changes. Related: #15954
2026-03-27 12:02:41 -07:00
ci: add Bazel clippy workflow for codex-rs (#15955) ## Why `bazel.yml` already builds and tests the Bazel graph, but `rust-ci.yml` still runs `cargo clippy` separately. This PR starts the transition to a Bazel-backed lint lane for `codex-rs` so we can eventually replace the duplicate Rust build, test, and lint work with Bazel while explicitly keeping the V8 Bazel path out of scope for now. To make that lane practical, the workflow also needs to look like the Bazel job we already trust. That means sharing the common Bazel setup and invocation logic instead of hand-copying it, and covering the arm64 macOS path in addition to Linux. Landing the workflow green also required fixing the first lint findings that Bazel surfaced and adding the matching local entrypoint. ## What changed - add a reusable `build:clippy` config to `.bazelrc` and export `codex-rs/clippy.toml` from `codex-rs/BUILD.bazel` so Bazel can run the repository's existing Clippy policy - add `just bazel-clippy` so the local developer entrypoint matches the new CI lane - extend `.github/workflows/bazel.yml` with a dedicated Bazel clippy job for `codex-rs`, scoped to `//codex-rs/... -//codex-rs/v8-poc:all` - run that clippy job on Linux x64 and arm64 macOS - factor the shared Bazel workflow setup into `.github/actions/setup-bazel-ci/action.yml` and the shared Bazel invocation logic into `.github/scripts/run-bazel-ci.sh` so the clippy and build/test jobs stay aligned - fix the first Bazel-clippy findings needed to keep the lane green, including the cross-target `cmsghdr::cmsg_len` normalization in `codex-rs/shell-escalation/src/unix/socket.rs` and the no-`voice-input` dead-code warnings in `codex-rs/tui` and `codex-rs/tui_app_server` ## Verification - `just bazel-clippy` - `RUNNER_OS=macOS ./.github/scripts/run-bazel-ci.sh -- build --config=clippy --build_metadata=COMMIT_SHA=local-check --build_metadata=TAG_job=clippy -- //codex-rs/... -//codex-rs/v8-poc:all` - `bazel build --config=clippy //codex-rs/shell-escalation:shell-escalation` - `CARGO_TARGET_DIR=/tmp/codex4-shell-escalation-test cargo test -p codex-shell-escalation` - `ruby -e 'require "yaml"; YAML.load_file(".github/workflows/bazel.yml"); YAML.load_file(".github/actions/setup-bazel-ci/action.yml")'` ## Notes - `CARGO_TARGET_DIR=/tmp/codex4-tui-app-server-test cargo test -p codex-tui-app-server` still hits existing guardian-approvals test and snapshot failures unrelated to this PR's Bazel-clippy changes. Related: #15954
2026-03-27 12:02:41 -07:00
build: migrate argument-comment-lint to a native Bazel aspect (#16106) ## Why `argument-comment-lint` had become a PR bottleneck because the repo-wide lane was still effectively running a `cargo dylint`-style flow across the workspace instead of reusing Bazel's Rust dependency graph. That kept the lint enforced, but it threw away the main benefit of moving this job under Bazel in the first place: metadata reuse and cacheable per-target analysis in the same shape as Clippy. This change moves the repo-wide lint onto a native Bazel Rust aspect so Linux and macOS can lint `codex-rs` without rebuilding the world crate-by-crate through the wrapper path. ## What Changed - add a nightly Rust toolchain with `rustc-dev` for Bazel and a dedicated crate-universe repo for `tools/argument-comment-lint` - add `tools/argument-comment-lint/driver.rs` and `tools/argument-comment-lint/lint_aspect.bzl` so Bazel can run the lint as a custom `rustc_driver` - switch repo-wide `just argument-comment-lint` and the Linux/macOS `rust-ci` lanes to `bazel build --config=argument-comment-lint //codex-rs/...` - keep the Python/DotSlash wrappers as the package-scoped fallback path and as the current Windows CI path - gate the Dylint entrypoint behind a `bazel_native` feature so the Bazel-native library avoids the `dylint_*` packaging stack - update the aspect runtime environment so the driver can locate `rustc_driver` correctly under remote execution - keep the dedicated `tools/argument-comment-lint` package tests and wrapper unit tests in CI so the source and packaged entrypoints remain covered ## Verification - `python3 -m unittest discover -s tools/argument-comment-lint -p 'test_*.py'` - `cargo test` in `tools/argument-comment-lint` - `bazel build //tools/argument-comment-lint:argument-comment-lint-driver --@rules_rust//rust/toolchain/channel=nightly` - `bazel build --config=argument-comment-lint //codex-rs/utils/path-utils:all` - `bazel build --config=argument-comment-lint //codex-rs/rollout:rollout` --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/openai/codex/pull/16106). * #16120 * __->__ #16106
2026-03-28 12:41:56 -07:00
[codex] Add comprehensive root formatting check (#25683) ## Why The root formatting entrypoints could drift: `just fmt` did not format the Justfile itself, and the CI-facing check recipe only checked Python scripts instead of matching everything formatted by `just fmt`. ## What changed - Add a shared cross-platform Python formatter driver used by both `just fmt` and `just fmt-check`. - Run Justfile, Rust, Python SDK, and internal-script formatter groups concurrently while buffering each formatter group's output until it finishes. - Log formatter starts immediately, then print each formatter group's labeled output when it completes. - Keep the SDK lint-fix and Ruff formatting passes ordered, with source comments explaining their distinct roles and the check-mode equivalents. - Run Ruff through shared `uv run --no-sync --with ruff` overlays so formatting works on clean glibc Linux checkouts without installing the platform-specific SDK runtime wheel. - Show `fmt-check` help text in `just -l` and simplify CI to call the shared driver through `just fmt-check`. - Pin the general CI workflow to `just@1.51.0` so its formatter agrees with the checked-in Justfile. - Add regression coverage for the thin Just recipes and the driver's formatter graph. ## Validation - `just fmt` - `just fmt-check` - `python3 -m pytest sdk/python/tests/test_artifact_workflow_and_binaries.py -k 'root_fmt or root_format' -q` - `pnpm run format` - `git diff --check` - `just -l | rg -n '^ fmt|fmt-check'` - `uvx --from uv==0.7.22 uv run --frozen --project sdk/python --no-sync --with ruff ruff check --diff sdk/python`
2026-06-01 18:20:25 -07:00
build: migrate argument-comment-lint to a native Bazel aspect (#16106) ## Why `argument-comment-lint` had become a PR bottleneck because the repo-wide lane was still effectively running a `cargo dylint`-style flow across the workspace instead of reusing Bazel's Rust dependency graph. That kept the lint enforced, but it threw away the main benefit of moving this job under Bazel in the first place: metadata reuse and cacheable per-target analysis in the same shape as Clippy. This change moves the repo-wide lint onto a native Bazel Rust aspect so Linux and macOS can lint `codex-rs` without rebuilding the world crate-by-crate through the wrapper path. ## What Changed - add a nightly Rust toolchain with `rustc-dev` for Bazel and a dedicated crate-universe repo for `tools/argument-comment-lint` - add `tools/argument-comment-lint/driver.rs` and `tools/argument-comment-lint/lint_aspect.bzl` so Bazel can run the lint as a custom `rustc_driver` - switch repo-wide `just argument-comment-lint` and the Linux/macOS `rust-ci` lanes to `bazel build --config=argument-comment-lint //codex-rs/...` - keep the Python/DotSlash wrappers as the package-scoped fallback path and as the current Windows CI path - gate the Dylint entrypoint behind a `bazel_native` feature so the Bazel-native library avoids the `dylint_*` packaging stack - update the aspect runtime environment so the driver can locate `rustc_driver` correctly under remote execution - keep the dedicated `tools/argument-comment-lint` package tests and wrapper unit tests in CI so the source and packaged entrypoints remain covered ## Verification - `python3 -m unittest discover -s tools/argument-comment-lint -p 'test_*.py'` - `cargo test` in `tools/argument-comment-lint` - `bazel build //tools/argument-comment-lint:argument-comment-lint-driver --@rules_rust//rust/toolchain/channel=nightly` - `bazel build --config=argument-comment-lint //codex-rs/utils/path-utils:all` - `bazel build --config=argument-comment-lint //codex-rs/rollout:rollout` --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/openai/codex/pull/16106). * #16120 * __->__ #16106
2026-03-28 12:41:56 -07:00
build: migrate argument-comment-lint to a native Bazel aspect (#16106) ## Why `argument-comment-lint` had become a PR bottleneck because the repo-wide lane was still effectively running a `cargo dylint`-style flow across the workspace instead of reusing Bazel's Rust dependency graph. That kept the lint enforced, but it threw away the main benefit of moving this job under Bazel in the first place: metadata reuse and cacheable per-target analysis in the same shape as Clippy. This change moves the repo-wide lint onto a native Bazel Rust aspect so Linux and macOS can lint `codex-rs` without rebuilding the world crate-by-crate through the wrapper path. ## What Changed - add a nightly Rust toolchain with `rustc-dev` for Bazel and a dedicated crate-universe repo for `tools/argument-comment-lint` - add `tools/argument-comment-lint/driver.rs` and `tools/argument-comment-lint/lint_aspect.bzl` so Bazel can run the lint as a custom `rustc_driver` - switch repo-wide `just argument-comment-lint` and the Linux/macOS `rust-ci` lanes to `bazel build --config=argument-comment-lint //codex-rs/...` - keep the Python/DotSlash wrappers as the package-scoped fallback path and as the current Windows CI path - gate the Dylint entrypoint behind a `bazel_native` feature so the Bazel-native library avoids the `dylint_*` packaging stack - update the aspect runtime environment so the driver can locate `rustc_driver` correctly under remote execution - keep the dedicated `tools/argument-comment-lint` package tests and wrapper unit tests in CI so the source and packaged entrypoints remain covered ## Verification - `python3 -m unittest discover -s tools/argument-comment-lint -p 'test_*.py'` - `cargo test` in `tools/argument-comment-lint` - `bazel build //tools/argument-comment-lint:argument-comment-lint-driver --@rules_rust//rust/toolchain/channel=nightly` - `bazel build --config=argument-comment-lint //codex-rs/utils/path-utils:all` - `bazel build --config=argument-comment-lint //codex-rs/rollout:rollout` --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/openai/codex/pull/16106). * #16120 * __->__ #16106
2026-03-28 12:41:56 -07:00
feat: add support for building with Bazel (#8875) This PR configures Codex CLI so it can be built with [Bazel](https://bazel.build) in addition to Cargo. The `.bazelrc` includes configuration so that remote builds can be done using [BuildBuddy](https://www.buildbuddy.io). If you are familiar with Bazel, things should work as you expect, e.g., run `bazel test //... --keep-going` to run all the tests in the repo, but we have also added some new aliases in the `justfile` for convenience: - `just bazel-test` to run tests locally - `just bazel-remote-test` to run tests remotely (currently, the remote build is for x86_64 Linux regardless of your host platform). Note we are currently seeing the following test failures in the remote build, so we still need to figure out what is happening here: ``` failures: suite::compact::manual_compact_twice_preserves_latest_user_messages suite::compact_resume_fork::compact_resume_after_second_compaction_preserves_history suite::compact_resume_fork::compact_resume_and_fork_preserve_model_history_view ``` - `just build-for-release` to build release binaries for all platforms/architectures remotely To setup remote execution: - [Create a buildbuddy account](https://app.buildbuddy.io/) (OpenAI employees should also request org access at https://openai.buildbuddy.io/join/ with their `@openai.com` email address.) - [Copy your API key](https://app.buildbuddy.io/docs/setup/) to `~/.bazelrc` (add the line `build --remote_header=x-buildbuddy-api-key=YOUR_KEY`) - Use `--config=remote` in your `bazel` invocations (or add `common --config=remote` to your `~/.bazelrc`, or use the `just` commands) ## CI In terms of CI, this PR introduces `.github/workflows/bazel.yml`, which uses Bazel to run the tests _locally_ on Mac and Linux GitHub runners (we are working on supporting Windows, but that is not ready yet). Note that the failures we are seeing in `just bazel-remote-test` do not occur on these GitHub CI jobs, so everything in `.github/workflows/bazel.yml` is green right now. The `bazel.yml` uses extra config in `.github/workflows/ci.bazelrc` so that macOS CI jobs build _remotely_ on Linux hosts (using the `docker://docker.io/mbolin491/codex-bazel` Docker image declared in the root `BUILD.bazel`) using cross-compilation to build the macOS artifacts. Then these artifacts are downloaded locally to GitHub's macOS runner so the tests can be executed natively. This is the relevant config that enables this: ``` common:macos --config=remote common:macos --strategy=remote common:macos --strategy=TestRunner=darwin-sandbox,local ``` Because of the remote caching benefits we get from BuildBuddy, these new CI jobs can be extremely fast! For example, consider these two jobs that ran all the tests on Linux x86_64: - Bazel 1m37s https://github.com/openai/codex/actions/runs/20861063212/job/59940545209?pr=8875 - Cargo 9m20s https://github.com/openai/codex/actions/runs/20861063192/job/59940559592?pr=8875 For now, we will continue to run both the Bazel and Cargo jobs for PRs, but once we add support for Windows and running Clippy, we should be able to cutover to using Bazel exclusively for PRs, which should still speed things up considerably. We will probably continue to run the Cargo jobs post-merge for commits that land on `main` as a sanity check. Release builds will also continue to be done by Cargo for now. Earlier attempt at this PR: https://github.com/openai/codex/pull/8832 Earlier attempt to add support for Buck2, now abandoned: https://github.com/openai/codex/pull/8504 --------- Co-authored-by: David Zbarsky <dzbarsky@gmail.com> Co-authored-by: Michael Bolin <mbolin@openai.com>
2026-01-09 14:09:43 -05:00
[codex] Fix Windows BuildBuddy Bazel wrapper execution (#25915) ## Why #25156 moved Bazel CI launches into a shared Python wrapper. On Windows, launching Bazel with `os.execvp` can split the spaced `--test_env=PATH=...` argument and fail to propagate the eventual Bazel exit status, allowing jobs to pass without running tests. This reapplies the wrapper after #25909 with a Windows-safe launch path. ## What changed Use a waited `subprocess.run` launch on Windows while preserving `os.execvp` on Unix. Add a process-level regression test for spaced arguments and child exit status, and run it on Windows Bazel shard 1. ## Experiment To confirm Bazel was actually invoking tests, patch `87b61d0be6` temporarily added an intentionally failing `codex-core` unit test. Bazel failed on that sentinel on all three major platforms: - [Linux Bazel test](https://github.com/openai/codex/actions/runs/26841132773/job/79151062486) - [macOS Bazel test](https://github.com/openai/codex/actions/runs/26841132773/job/79151062362) - [Windows Bazel test shard 1/4](https://github.com/openai/codex/actions/runs/26841132773/job/79151062155) The sentinel was removed after collecting this evidence. Windows Bazel [clippy](https://github.com/openai/codex/actions/runs/26841132773/job/79151062914) and [release verification](https://github.com/openai/codex/actions/runs/26841132773/job/79151062739) also passed. ## Validation After removing the sentinel, `just test -p codex-core` no longer reported it. The local run retained two unrelated environment-specific failures.
2026-06-02 16:22:32 -07:00
feat: add support for building with Bazel (#8875) This PR configures Codex CLI so it can be built with [Bazel](https://bazel.build) in addition to Cargo. The `.bazelrc` includes configuration so that remote builds can be done using [BuildBuddy](https://www.buildbuddy.io). If you are familiar with Bazel, things should work as you expect, e.g., run `bazel test //... --keep-going` to run all the tests in the repo, but we have also added some new aliases in the `justfile` for convenience: - `just bazel-test` to run tests locally - `just bazel-remote-test` to run tests remotely (currently, the remote build is for x86_64 Linux regardless of your host platform). Note we are currently seeing the following test failures in the remote build, so we still need to figure out what is happening here: ``` failures: suite::compact::manual_compact_twice_preserves_latest_user_messages suite::compact_resume_fork::compact_resume_after_second_compaction_preserves_history suite::compact_resume_fork::compact_resume_and_fork_preserve_model_history_view ``` - `just build-for-release` to build release binaries for all platforms/architectures remotely To setup remote execution: - [Create a buildbuddy account](https://app.buildbuddy.io/) (OpenAI employees should also request org access at https://openai.buildbuddy.io/join/ with their `@openai.com` email address.) - [Copy your API key](https://app.buildbuddy.io/docs/setup/) to `~/.bazelrc` (add the line `build --remote_header=x-buildbuddy-api-key=YOUR_KEY`) - Use `--config=remote` in your `bazel` invocations (or add `common --config=remote` to your `~/.bazelrc`, or use the `just` commands) ## CI In terms of CI, this PR introduces `.github/workflows/bazel.yml`, which uses Bazel to run the tests _locally_ on Mac and Linux GitHub runners (we are working on supporting Windows, but that is not ready yet). Note that the failures we are seeing in `just bazel-remote-test` do not occur on these GitHub CI jobs, so everything in `.github/workflows/bazel.yml` is green right now. The `bazel.yml` uses extra config in `.github/workflows/ci.bazelrc` so that macOS CI jobs build _remotely_ on Linux hosts (using the `docker://docker.io/mbolin491/codex-bazel` Docker image declared in the root `BUILD.bazel`) using cross-compilation to build the macOS artifacts. Then these artifacts are downloaded locally to GitHub's macOS runner so the tests can be executed natively. This is the relevant config that enables this: ``` common:macos --config=remote common:macos --strategy=remote common:macos --strategy=TestRunner=darwin-sandbox,local ``` Because of the remote caching benefits we get from BuildBuddy, these new CI jobs can be extremely fast! For example, consider these two jobs that ran all the tests on Linux x86_64: - Bazel 1m37s https://github.com/openai/codex/actions/runs/20861063212/job/59940545209?pr=8875 - Cargo 9m20s https://github.com/openai/codex/actions/runs/20861063192/job/59940559592?pr=8875 For now, we will continue to run both the Bazel and Cargo jobs for PRs, but once we add support for Windows and running Clippy, we should be able to cutover to using Bazel exclusively for PRs, which should still speed things up considerably. We will probably continue to run the Cargo jobs post-merge for commits that land on `main` as a sanity check. Release builds will also continue to be done by Cargo for now. Earlier attempt at this PR: https://github.com/openai/codex/pull/8832 Earlier attempt to add support for Buck2, now abandoned: https://github.com/openai/codex/pull/8504 --------- Co-authored-by: David Zbarsky <dzbarsky@gmail.com> Co-authored-by: Michael Bolin <mbolin@openai.com>
2026-01-09 14:09:43 -05:00
[codex] Add comprehensive root formatting check (#25683) ## Why The root formatting entrypoints could drift: `just fmt` did not format the Justfile itself, and the CI-facing check recipe only checked Python scripts instead of matching everything formatted by `just fmt`. ## What changed - Add a shared cross-platform Python formatter driver used by both `just fmt` and `just fmt-check`. - Run Justfile, Rust, Python SDK, and internal-script formatter groups concurrently while buffering each formatter group's output until it finishes. - Log formatter starts immediately, then print each formatter group's labeled output when it completes. - Keep the SDK lint-fix and Ruff formatting passes ordered, with source comments explaining their distinct roles and the check-mode equivalents. - Run Ruff through shared `uv run --no-sync --with ruff` overlays so formatting works on clean glibc Linux checkouts without installing the platform-specific SDK runtime wheel. - Show `fmt-check` help text in `just -l` and simplify CI to call the shared driver through `just fmt-check`. - Pin the general CI workflow to `just@1.51.0` so its formatter agrees with the checked-in Justfile. - Add regression coverage for the thin Just recipes and the driver's formatter graph. ## Validation - `just fmt` - `just fmt-check` - `python3 -m pytest sdk/python/tests/test_artifact_workflow_and_binaries.py -k 'root_fmt or root_format' -q` - `pnpm run format` - `git diff --check` - `just -l | rg -n '^ fmt|fmt-check'` - `uvx --from uv==0.7.22 uv run --frozen --project sdk/python --no-sync --with ruff ruff check --diff sdk/python`
2026-06-01 18:20:25 -07:00
build: migrate argument-comment-lint to a native Bazel aspect (#16106) ## Why `argument-comment-lint` had become a PR bottleneck because the repo-wide lane was still effectively running a `cargo dylint`-style flow across the workspace instead of reusing Bazel's Rust dependency graph. That kept the lint enforced, but it threw away the main benefit of moving this job under Bazel in the first place: metadata reuse and cacheable per-target analysis in the same shape as Clippy. This change moves the repo-wide lint onto a native Bazel Rust aspect so Linux and macOS can lint `codex-rs` without rebuilding the world crate-by-crate through the wrapper path. ## What Changed - add a nightly Rust toolchain with `rustc-dev` for Bazel and a dedicated crate-universe repo for `tools/argument-comment-lint` - add `tools/argument-comment-lint/driver.rs` and `tools/argument-comment-lint/lint_aspect.bzl` so Bazel can run the lint as a custom `rustc_driver` - switch repo-wide `just argument-comment-lint` and the Linux/macOS `rust-ci` lanes to `bazel build --config=argument-comment-lint //codex-rs/...` - keep the Python/DotSlash wrappers as the package-scoped fallback path and as the current Windows CI path - gate the Dylint entrypoint behind a `bazel_native` feature so the Bazel-native library avoids the `dylint_*` packaging stack - update the aspect runtime environment so the driver can locate `rustc_driver` correctly under remote execution - keep the dedicated `tools/argument-comment-lint` package tests and wrapper unit tests in CI so the source and packaged entrypoints remain covered ## Verification - `python3 -m unittest discover -s tools/argument-comment-lint -p 'test_*.py'` - `cargo test` in `tools/argument-comment-lint` - `bazel build //tools/argument-comment-lint:argument-comment-lint-driver --@rules_rust//rust/toolchain/channel=nightly` - `bazel build --config=argument-comment-lint //codex-rs/utils/path-utils:all` - `bazel build --config=argument-comment-lint //codex-rs/rollout:rollout` --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/openai/codex/pull/16106). * #16120 * __->__ #16106
2026-03-28 12:41:56 -07:00
build: migrate argument-comment-lint to a native Bazel aspect (#16106) ## Why `argument-comment-lint` had become a PR bottleneck because the repo-wide lane was still effectively running a `cargo dylint`-style flow across the workspace instead of reusing Bazel's Rust dependency graph. That kept the lint enforced, but it threw away the main benefit of moving this job under Bazel in the first place: metadata reuse and cacheable per-target analysis in the same shape as Clippy. This change moves the repo-wide lint onto a native Bazel Rust aspect so Linux and macOS can lint `codex-rs` without rebuilding the world crate-by-crate through the wrapper path. ## What Changed - add a nightly Rust toolchain with `rustc-dev` for Bazel and a dedicated crate-universe repo for `tools/argument-comment-lint` - add `tools/argument-comment-lint/driver.rs` and `tools/argument-comment-lint/lint_aspect.bzl` so Bazel can run the lint as a custom `rustc_driver` - switch repo-wide `just argument-comment-lint` and the Linux/macOS `rust-ci` lanes to `bazel build --config=argument-comment-lint //codex-rs/...` - keep the Python/DotSlash wrappers as the package-scoped fallback path and as the current Windows CI path - gate the Dylint entrypoint behind a `bazel_native` feature so the Bazel-native library avoids the `dylint_*` packaging stack - update the aspect runtime environment so the driver can locate `rustc_driver` correctly under remote execution - keep the dedicated `tools/argument-comment-lint` package tests and wrapper unit tests in CI so the source and packaged entrypoints remain covered ## Verification - `python3 -m unittest discover -s tools/argument-comment-lint -p 'test_*.py'` - `cargo test` in `tools/argument-comment-lint` - `bazel build //tools/argument-comment-lint:argument-comment-lint-driver --@rules_rust//rust/toolchain/channel=nightly` - `bazel build --config=argument-comment-lint //codex-rs/utils/path-utils:all` - `bazel build --config=argument-comment-lint //codex-rs/rollout:rollout` --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/openai/codex/pull/16106). * #16120 * __->__ #16106
2026-03-28 12:41:56 -07:00
build: migrate argument-comment-lint to a native Bazel aspect (#16106) ## Why `argument-comment-lint` had become a PR bottleneck because the repo-wide lane was still effectively running a `cargo dylint`-style flow across the workspace instead of reusing Bazel's Rust dependency graph. That kept the lint enforced, but it threw away the main benefit of moving this job under Bazel in the first place: metadata reuse and cacheable per-target analysis in the same shape as Clippy. This change moves the repo-wide lint onto a native Bazel Rust aspect so Linux and macOS can lint `codex-rs` without rebuilding the world crate-by-crate through the wrapper path. ## What Changed - add a nightly Rust toolchain with `rustc-dev` for Bazel and a dedicated crate-universe repo for `tools/argument-comment-lint` - add `tools/argument-comment-lint/driver.rs` and `tools/argument-comment-lint/lint_aspect.bzl` so Bazel can run the lint as a custom `rustc_driver` - switch repo-wide `just argument-comment-lint` and the Linux/macOS `rust-ci` lanes to `bazel build --config=argument-comment-lint //codex-rs/...` - keep the Python/DotSlash wrappers as the package-scoped fallback path and as the current Windows CI path - gate the Dylint entrypoint behind a `bazel_native` feature so the Bazel-native library avoids the `dylint_*` packaging stack - update the aspect runtime environment so the driver can locate `rustc_driver` correctly under remote execution - keep the dedicated `tools/argument-comment-lint` package tests and wrapper unit tests in CI so the source and packaged entrypoints remain covered ## Verification - `python3 -m unittest discover -s tools/argument-comment-lint -p 'test_*.py'` - `cargo test` in `tools/argument-comment-lint` - `bazel build //tools/argument-comment-lint:argument-comment-lint-driver --@rules_rust//rust/toolchain/channel=nightly` - `bazel build --config=argument-comment-lint //codex-rs/utils/path-utils:all` - `bazel build --config=argument-comment-lint //codex-rs/rollout:rollout` --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/openai/codex/pull/16106). * #16120 * __->__ #16106
2026-03-28 12:41:56 -07:00
Use released DotSlash package for argument-comment lint (#15199) ## Why The argument-comment lint now has a packaged DotSlash artifact from [#15198](https://github.com/openai/codex/pull/15198), so the normal repo lint path should use that released payload instead of rebuilding the lint from source every time. That keeps `just clippy` and CI aligned with the shipped artifact while preserving a separate source-build path for people actively hacking on the lint crate. The current alpha package also exposed two integration wrinkles that the repo-side prebuilt wrapper needs to smooth over: - the bundled Dylint library filename includes the host triple, for example `@nightly-2025-09-18-aarch64-apple-darwin`, and Dylint derives `RUSTUP_TOOLCHAIN` from that filename - on Windows, Dylint's driver path also expects `RUSTUP_HOME` to be present in the environment Without those adjustments, the prebuilt CI jobs fail during `cargo metadata` or driver setup. This change makes the checked-in prebuilt wrapper normalize the packaged library name to the plain `nightly-2025-09-18` channel before invoking `cargo-dylint`, and it teaches both the wrapper and the packaged runner source to infer `RUSTUP_HOME` from `rustup show home` when the environment does not already provide it. After the prebuilt Windows lint job started running successfully, it also surfaced a handful of existing anonymous literal callsites in `windows-sandbox-rs`. This PR now annotates those callsites so the new cross-platform lint job is green on the current tree. ## What Changed - checked in the current `tools/argument-comment-lint/argument-comment-lint` DotSlash manifest - kept `tools/argument-comment-lint/run.sh` as the source-build wrapper for lint development - added `tools/argument-comment-lint/run-prebuilt-linter.sh` as the normal enforcement path, using the checked-in DotSlash package and bundled `cargo-dylint` - updated `just clippy` and `just argument-comment-lint` to use the prebuilt wrapper - split `.github/workflows/rust-ci.yml` so source-package checks live in a dedicated `argument_comment_lint_package` job, while the released lint runs in an `argument_comment_lint_prebuilt` matrix on Linux, macOS, and Windows - kept the pinned `nightly-2025-09-18` toolchain install in the prebuilt CI matrix, since the prebuilt package still relies on rustup-provided toolchain components - updated `tools/argument-comment-lint/run-prebuilt-linter.sh` to normalize host-qualified nightly library filenames, keep the `rustup` shim directory ahead of direct toolchain `cargo` binaries, and export `RUSTUP_HOME` when needed for Windows Dylint driver setup - updated `tools/argument-comment-lint/src/bin/argument-comment-lint.rs` so future published DotSlash artifacts apply the same nightly-filename normalization and `RUSTUP_HOME` inference internally - fixed the remaining Windows lint violations in `codex-rs/windows-sandbox-rs` by adding the required `/*param*/` comments at the reported callsites - documented the checked-in DotSlash file, wrapper split, archive layout, nightly prerequisite, and Windows `RUSTUP_HOME` requirement in `tools/argument-comment-lint/README.md`
2026-03-19 20:19:22 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00
[codex] Make justfile recipes Windows-aware (#24983) ## Summary Make the root `justfile` usable from Windows without maintaining a separate Windows copy of most recipes. The repo recipes previously assumed POSIX shell behavior for things like variadic argument forwarding (`"$@"`) and stderr redirection (`2>/dev/null`). That made common workflows such as `just fmt`, `just test`, and `just log` unreliable from Windows. This PR introduces a small cross-platform shell adapter so recipes can stay mostly unified while still expanding the few shell-specific constructs correctly on macOS/Linux and Windows. ## What Changed - Add `scripts/just-shell.py` as the configured `just` shell adapter. - On Unix it invokes `sh -cu`. - On Windows it invokes `pwsh -CommandWithArgs` so arguments containing spaces are preserved. - Add portable recipe placeholders: - `{args}` expands to `"$@"` on Unix and the equivalent PowerShell forwarded-args expression on Windows. - `{stderr-null}` expands to the platform-specific stderr suppression used by `fmt`. - Convert most variadic one-line recipes to the unified `{args}` form, including `codex`, `exec`, `file-search`, `app-server-test-client`, `fix`, `clippy`, `bench`, `mcp-server-run`, `write-app-server-schema`, and `argument-comment-lint-from-source`. - Keep genuinely shell-specific recipes split or Unix-only for now, including recipes backed by `.sh` scripts or recipes whose bodies are more than simple command forwarding. - Add a Windows `just install` path that installs PowerShell via `winget` when `pwsh` is not available, then runs the same basic Rust setup steps. - Update the SDK test that validates the root `fmt` recipe so it recognizes the new portable stderr placeholder. ## Validation - `just --summary` - `just --dry-run fmt` - `just --dry-run bench-smoke` - `just --dry-run codex foo "bar binky" baz` - `just --dry-run write-hooks-schema` - `just --dry-run bazel-lock-update` - `just --dry-run argument-comment-lint-from-source -- "foo bar"` - `git diff --check -- justfile scripts/just-shell.py sdk/python/tests/test_artifact_workflow_and_binaries.py` - Verified Windows argv preservation through `scripts/just-shell.py` with arguments containing spaces. - `uv run --frozen --project sdk/python --extra dev pytest sdk/python/tests/test_artifact_workflow_and_binaries.py::test_root_fmt_recipe_formats_rust_and_python_sdk`
2026-06-01 11:26:36 -07:00