{"slug": "you-can-cargo-build-your-own-codex-rust", "title": "You can cargo build your own codex rust", "summary": "A GitHub fork of openai/codex published a 70-line shell script, aa.sh, that builds the Codex CLI from source by downloading prebuilt V8 artifacts. The script reads the pinned v8 version from Cargo.toml, fetches librusty_v8_ptrcomp_sandbox_release_aarch64-apple-darwin.a.gz, its src_binding file, and a SHA-256 manifest from the openai/codex rusty-v8-v release URL, verifies the manifest against a trusted checksum file in third_party/v8, then runs cargo build --release for the codex-cli and codex-code-mode-host binaries.", "body_md": "forked from \n\n[openai/codex](https://github.com/openai/codex)\n- \n [Notifications](https://github.com/login?return_to=%2Fandrewarrow%2Fcodex)\nYou must be signed in to change notification settings\n- \n [Fork\n    0](https://github.com/login?return_to=%2Fandrewarrow%2Fcodex)\n\n## Expand file tree\n\n/\n\nCopy path\n# aa.sh\n\nMore file actions\n\nexecutable file\n\n·\n70 lines (56 loc) · 2.27 KB\n\n/\n\nCopy path\n# aa.sh\n\n## File metadata and controls\n\nexecutable file\n\n·\n70 lines (56 loc) · 2.27 KB\n\n1\n\n2\n\n3\n\n4\n\n5\n\n6\n\n7\n\n8\n\n9\n\n10\n\n11\n\n12\n\n13\n\n14\n\n15\n\n16\n\n17\n\n18\n\n19\n\n20\n\n21\n\n22\n\n23\n\n24\n\n25\n\n26\n\n27\n\n28\n\n29\n\n30\n\n31\n\n32\n\n33\n\n34\n\n35\n\n36\n\n37\n\n38\n\n39\n\n40\n\n41\n\n42\n\n43\n\n44\n\n45\n\n46\n\n47\n\n48\n\n49\n\n50\n\n51\n\n52\n\n53\n\n54\n\n55\n\n56\n\n57\n\n58\n\n59\n\n60\n\n61\n\n62\n\n63\n\n64\n\n65\n\n66\n\n67\n\n68\n\n69\n\n70\n\n#!/usr/bin/env bash\n\nset -euo pipefail\n\nscript_dir=\"$(cd -- \"$(dirname -- \"${BASH_SOURCE[0]}\")\" && pwd)\"\n\ncd \"$script_dir\"\n\nv8_version=\"$(sed -nE 's/^v8 = \"=([^\"]+)\"$/\\1/p' Cargo.toml | head -n 1)\"\n\nif [[ -z \"$v8_version\" ]]; then\n\n echo \"Could not determine the pinned v8 version from Cargo.toml.\" >&2\n\n exit 1\n\nfi\n\nv8_target=\"aarch64-apple-darwin\"\n\nv8_profile=\"ptrcomp_sandbox_release\"\n\nv8_tmp=\"/private/tmp/codex-v8-${v8_version}\"\n\nv8_release_url=\"https://github.com/openai/codex/releases/download/rusty-v8-v${v8_version}\"\n\nv8_archive_name=\"librusty_v8_${v8_profile}_${v8_target}.a.gz\"\n\nv8_binding_name=\"src_binding_${v8_profile}_${v8_target}.rs\"\n\nv8_manifest_name=\"rusty_v8_${v8_profile}_${v8_target}.sha256\"\n\nv8_trusted_manifest=\"${script_dir}/../third_party/v8/rusty_v8_${v8_version//./_}_release_manifests.sha256\"\n\nmkdir -p \"$v8_tmp\"\n\ndownload() {\n\n local url=\"$1\"\n\n local destination=\"$2\"\n\n local temporary=\"${destination}.part\"\n\n echo \"Downloading $(basename \"$destination\")\"\n\n if ! curl --fail --location --retry 3 --retry-delay 2 --silent --show-error \\\n\n \"$url\" -o \"$temporary\"; then\n\n    rm -f \"$temporary\"\n\n return 1\n\n fi\n\n  mv \"$temporary\" \"$destination\"\n\n}\n\nv8_manifest=\"${v8_tmp}/${v8_manifest_name}\"\n\nv8_archive=\"${v8_tmp}/${v8_archive_name}\"\n\nv8_binding=\"${v8_tmp}/${v8_binding_name}\"\n\nif [[ ! -f \"$v8_trusted_manifest\" ]]; then\n\n echo \"Missing trusted V8 manifest: $v8_trusted_manifest\" >&2\n\n exit 1\n\nfi\n\ndownload \"${v8_release_url}/${v8_manifest_name}\" \"$v8_manifest\"\n\nexpected_manifest_checksum=\"$(awk -v name=\"$v8_manifest_name\" '$2 == name { print $1; exit }' \"$v8_trusted_manifest\")\"\n\nactual_manifest_checksum=\"$(shasum -a 256 \"$v8_manifest\" | awk '{ print $1 }')\"\n\nif [[ -z \"$expected_manifest_checksum\" || \"$actual_manifest_checksum\" != \"$expected_manifest_checksum\" ]]; then\n\n echo \"V8 checksum manifest verification failed for $v8_manifest_name.\" >&2\n\n exit 1\n\nfi\n\nif [[ ! -f \"$v8_archive\" ]]; then\n\n  download \"${v8_release_url}/${v8_archive_name}\" \"$v8_archive\"\n\nfi\n\nif [[ ! -f \"$v8_binding\" ]]; then\n\n  download \"${v8_release_url}/${v8_binding_name}\" \"$v8_binding\"\n\nfi\n\n(cd \"$v8_tmp\" && shasum -a 256 -c \"$v8_manifest\")\n\nexport RUSTY_V8_ARCHIVE=\"$v8_archive\"\n\nexport RUSTY_V8_SRC_BINDING_PATH=\"$v8_binding\"\n\ncargo build --release \\\n\n  -p codex-cli --bin codex \\\n\n  -p codex-code-mode-host --bin codex-code-mode-host", "url": "https://wpnews.pro/news/you-can-cargo-build-your-own-codex-rust", "canonical_source": "https://github.com/andrewarrow/codex/blob/aa/codex-rs/aa.sh", "published_at": "2026-09-20 15:34:50+00:00", "updated_at": "2026-09-20 15:53:07.427880+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "ai-agents"], "entities": ["openai/codex", "andrewarrow/codex", "GitHub", "V8", "Rust", "Cargo", "codex-cli", "codex-code-mode-host"], "alternates": {"html": "https://wpnews.pro/news/you-can-cargo-build-your-own-codex-rust", "markdown": "https://wpnews.pro/news/you-can-cargo-build-your-own-codex-rust.md", "text": "https://wpnews.pro/news/you-can-cargo-build-your-own-codex-rust.txt", "jsonld": "https://wpnews.pro/news/you-can-cargo-build-your-own-codex-rust.jsonld"}}