Documented source build fails on macOS arm64: sandboxed V8 asset returns 404 and `codex-code-mode-host` is not built
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:
- Building only
codex-cliproducestarget/debug/codex, but not the now-required sibling executabletarget/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
- 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; and2e32d95894— 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
codexandcodex-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:
- Extract/reuse the verified V8 artifact setup already implemented by
scripts/codex_packageand.github/actions/setup-rusty-v8as a first-class local developer helper. - Add a supported
just buildrecipe 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
- Make
just codexensure the host has been built with the same V8 configuration before launching the CLI. - Update
docs/install.mdto use this supported command instead of rawcargo build/cargo run --bin codex. - 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.
6 Comments
Just tried the equivalent workaround on Linux x86_64 and confirmed it works there too. I agree it would be good to either have this documented or otherwise handled in the build toolchain.
Confirming the same failure on Windows x86_64 with
rust-v0.147.0(be6e8eac02) — this is not macOS-specific.codex-code-mode-runtimeenables the sandboxed V8 build (codex-rs/code-mode-runtime/Cargo.toml:v8 = { workspace = true, features = ["v8_enable_sandbox"] }), so thev8crate's build script (rusty_v8 150.4.0 perCargo.lock) requests:rusty_v8 has never published a
ptrcomp_sandboxvariant for Windows. The complete v150.4.0 Windows asset list is:rusty_v8_release_{x86_64,aarch64}-pc-windows-msvc.lib.gzrusty_v8_simdutf_release_{x86_64,aarch64}-pc-windows-msvc.lib.gz(verified today: the plain-variant URL answers 200, the
ptrcomp_sandboxone 404).Consequence: any plain
cargo build/cargo testacross the workspace is broken on Windows too, unless you take the multi-hourV8_FROM_SOURCEroute. Workaround we use to run the rest of the test suite:cargo run --bin codexand the bazel release path (//codex-rs/cli:release_binaries) are unaffected since they don't pull incode-mode-runtime.No just use the workaround in the first post. Openai has their own rusty_v8 fork that contains the needed precompiled files.
Independent reproduction on another macOS version and current
main:Environment
rustc 1.95.0 (59807616e 2026-04-14)cargo 1.95.0 (f2d3ce0bd 2026-03-21)mainat8cabf5a6cf103cebe338d46346e43e3201e64f41With no V8 overrides, the documented command:
still fails while compiling
v8 v150.4.0, attempting to download:and receiving
HTTP Error 404: Not Found.I then downloaded these three assets from the Codex
rusty-v8-v150.4.0release:shasum -a 256 -c rusty_v8_ptrcomp_sandbox_release_aarch64-apple-darwin.sha256reportedOKfor both the archive and binding. After settingRUSTY_V8_ARCHIVEandRUSTY_V8_SRC_BINDING_PATHto those verified files:codex-cli+codex-code-mode-hostbuild succeeded;cargo buildsucceeded;target/debug/codex --versionexits 0 and printscodex-cli 0.0.0;target/debug/codex-code-mode-host --helpexits 0;target/debug/codex features listexits 0 and reportscode_mode_host stable true.This confirms the failure is still present on current
mainand is not specific to macOS 26. In this environment, supplying the Codex-hosted sandboxed V8 archive and binding was the only additional step needed to make the complete source build succeed.I traced the current local, CI, and package build paths. The smallest fix appears to be an integration change rather than a new V8 downloader.
Root cause
docs/install.mdand the rootjustfileuse rawcargo build/cargo run --bin codex, so neither path prepares the Codex-built V8 artifacts.codex-code-mode-runtimeenablesv8_enable_sandbox, which also enables pointer compression. Without overrides, the upstreamv8build script constructs theptrcomp_sandbox_releasefilename under the Deno release URL, where that asset does not exist..github/actions/setup-rusty-v8/action.ymlandscripts/codex_package/v8.pyalready resolve the exactv8version fromCargo.lock, download the matchingopenai/codexrelease pair, verify the two checksums, and provideRUSTY_V8_ARCHIVEplusRUSTY_V8_SRC_BINDING_PATH.cargo run --bin codexdoes not build the siblingcodex-code-mode-hostbinary. For a normal Cargo launch,InstallContextresolves the host beside the running Codex executable, so both binaries need to be produced in the same target/profile directory.Proposed smallest reviewable scope
If this direction matches the maintainers' intent, I would propose:
scripts/codex_package/v8.py::resolve_codex_v8_cargo_envinstead of duplicating download/checksum logic.``
sh
``cargo build \
-p codex-cli --bin codex \
-p codex-code-mode-host --bin codex-code-mode-host
just buildrecipe, and either makejust codexuse the same preparation/build path or document a separate launch command, depending on the preferred developer UX.docs/install.mdto use the supported recipe rather than raw Cargo commands.I would keep this separate from the full package builder: that builder also assembles package layout/resources and defaults to release-oriented targets, while the developer path should build for the active native Cargo target and preserve normal local iteration behavior.
I have not opened a PR because
CONTRIBUTING.mdstates that external code contributions require an explicit invitation. Would the maintainers be willing to confirm the preferred local entry point and, if the scope above aligns, invite me to implement it?Just get the release from rusty-v8-release pipeline: https://github.com/openai/codex/actions/runs/30401869566 or https://github.com/openai/codex/releases/tag/rusty-v8-v150.4.0
set up RUSTY_V8_ARCHIVE and RUSTY_V8_SRC_BINDING_PATH
and it will work, including Windows platform.