Skip to content

Documented source build fails on macOS arm64: sandboxed V8 asset returns 404 and codex-code-mode-host is not built #36698

Description

@noscripter

Issue body

What version of Codex CLI is running?

Source checkout of main at bb5054fe47abe73ecbbd454751066a28c89f4bb9 (codex-cli 0.0.0).

What subscription do you have?

N/A — this is a source-build failure before any API request or model invocation.

Which model were you using?

N/A.

What platform is your computer?

Darwin 25.6.0 arm64 arm
macOS 26.6 (25G72)
rustc 1.95.0 (59807616e 2026-04-14)
cargo 1.95.0 (f2d3ce0bd 2026-03-21)
toolchain: 1.95.0-aarch64-apple-darwin (repository override)

What terminal emulator and version are you using?

Not relevant; this reproduces during a non-interactive Cargo build.

Codex doctor report

Not available before applying the workaround because the documented source build does not produce a runnable local package.

What issue are you seeing?

The documented source-build flow in docs/install.md says to run:

cd codex/codex-rs
cargo build
cargo run --bin codex -- "explain this codebase to me"

This no longer works on a clean Apple Silicon checkout of current main.

There are two connected failures:

  1. Building only codex-cli produces target/debug/codex, but not the now-required sibling executable target/debug/codex-code-mode-host. Running the CLI then reports:

    /path/to/codex/codex-rs/target/debug/codex-code-mode-host: No such file or directory

  2. Building the host explicitly fails while compiling v8 v150.4.0:

    error: failed to run custom build command for v8 v150.4.0

    static lib URL: https://github.com/denoland/rusty_v8/releases/download/v150.4.0/librusty_v8_ptrcomp_sandbox_release_aarch64-apple-darwin.a.gz
    HTTP Error 404: Not Found

    Failed to download V8 prebuilt archive from
    https://github.com/denoland/rusty_v8/releases/download/v150.4.0/librusty_v8_ptrcomp_sandbox_release_aarch64-apple-darwin.a.gz

The failing filename is the sandbox-enabled ptrcomp_sandbox_release variant selected by v8_enable_sandbox. The Codex rusty-v8-v150.4.0 release contains the corresponding OpenAI-built archive and binding, and .github/actions/setup-rusty-v8/action.yml already downloads them and supplies:

RUSTY_V8_ARCHIVE
RUSTY_V8_SRC_BINDING_PATH

However, the documented direct Cargo/Just development path does not perform this setup. The repository's package builder contains similar download-and-verification logic, but it is not used by cargo build, just codex, or the source-build instructions.

This is related to, but different from, #31906. That issue concerns a Homebrew package missing the sidecar. This report concerns a clean build from source and the sandboxed V8 dependency setup.

The likely regression window is the combination of:

  • 97576b1794 — run code mode exclusively through the standalone host; and
  • 2e32d95894 — enable sandboxed V8 for code mode.

What steps can reproduce the bug?

Starting from a clean checkout:

git clone https://github.com/openai/codex.git
cd codex/codex-rs

The previously sufficient command builds the CLI but not its required host.

cargo build -p codex-cli --bin codex
./target/debug/codex

Attempt to build the missing host.

cargo build -p codex-code-mode-host --bin codex-code-mode-host

The last command fails on the Deno rusty_v8 404 shown above. Running the documented plain cargo build also reaches the same V8 failure.

What is the expected behavior?

The documented build-from-source command should produce a runnable local Codex installation from a clean checkout.

If codex-code-mode-host is mandatory, the supported local build command should:

  • build both codex and codex-code-mode-host;
  • place them where runtime discovery expects them;
  • obtain and checksum-verify the correct sandbox-enabled V8 archive and Rust binding automatically; and
  • avoid requiring contributors to discover CI-only environment variables.

Suggested fix

Preferred approach:

  1. Extract/reuse the verified V8 artifact setup already implemented by scripts/codex_package and .github/actions/setup-rusty-v8 as a first-class local developer helper.

  2. Add a supported just build recipe that runs that helper and then performs one grouped Cargo build for:

    cargo build
    -p codex-cli --bin codex
    -p codex-code-mode-host --bin codex-code-mode-host

  3. Make just codex ensure the host has been built with the same V8 configuration before launching the CLI.

  4. Update docs/install.md to use this supported command instead of raw cargo build / cargo run --bin codex.

  5. Add a clean-checkout macOS arm64 CI smoke test that executes the documented source-build command and verifies both sibling binaries exist and start.

At minimum, the documentation should explain the two required binaries and show how to download and verify the Codex-hosted V8 pair before setting RUSTY_V8_ARCHIVE and RUSTY_V8_SRC_BINDING_PATH.

Confirmed workaround

Downloading the three assets below from the rusty-v8-v150.4.0 Codex release, verifying the supplied checksum file, and exporting the two paths makes the grouped build succeed:

librusty_v8_ptrcomp_sandbox_release_aarch64-apple-darwin.a.gz
src_binding_ptrcomp_sandbox_release_aarch64-apple-darwin.rs
rusty_v8_ptrcomp_sandbox_release_aarch64-apple-darwin.sha256

export RUSTY_V8_ARCHIVE=/path/to/librusty_v8_ptrcomp_sandbox_release_aarch64-apple-darwin.a.gz
export RUSTY_V8_SRC_BINDING_PATH=/path/to/src_binding_ptrcomp_sandbox_release_aarch64-apple-darwin.rs

cargo build
-p codex-cli --bin codex
-p codex-code-mode-host --bin codex-code-mode-host

./target/debug/codex

With those overrides, both arm64 Mach-O binaries build successfully and the CLI resolves the host beside itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions