You can cargo build your own codex rust 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. forked from openai/codex https://github.com/openai/codex - Notifications https://github.com/login?return to=%2Fandrewarrow%2Fcodex You must be signed in to change notification settings - Fork 0 https://github.com/login?return to=%2Fandrewarrow%2Fcodex Expand file tree / Copy path aa.sh More file actions executable file · 70 lines 56 loc · 2.27 KB / Copy path aa.sh File metadata and controls executable file · 70 lines 56 loc · 2.27 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 /usr/bin/env bash set -euo pipefail script dir="$ cd -- "$ dirname -- "${BASH SOURCE 0 }" " && pwd " cd "$script dir" v8 version="$ sed -nE 's/^v8 = "= ^" + "$/\1/p' Cargo.toml | head -n 1 " if -z "$v8 version" ; then echo "Could not determine the pinned v8 version from Cargo.toml." &2 exit 1 fi v8 target="aarch64-apple-darwin" v8 profile="ptrcomp sandbox release" v8 tmp="/private/tmp/codex-v8-${v8 version}" v8 release url="https://github.com/openai/codex/releases/download/rusty-v8-v${v8 version}" v8 archive name="librusty v8 ${v8 profile} ${v8 target}.a.gz" v8 binding name="src binding ${v8 profile} ${v8 target}.rs" v8 manifest name="rusty v8 ${v8 profile} ${v8 target}.sha256" v8 trusted manifest="${script dir}/../third party/v8/rusty v8 ${v8 version//./ } release manifests.sha256" mkdir -p "$v8 tmp" download { local url="$1" local destination="$2" local temporary="${destination}.part" echo "Downloading $ basename "$destination" " if curl --fail --location --retry 3 --retry-delay 2 --silent --show-error \ "$url" -o "$temporary"; then rm -f "$temporary" return 1 fi mv "$temporary" "$destination" } v8 manifest="${v8 tmp}/${v8 manifest name}" v8 archive="${v8 tmp}/${v8 archive name}" v8 binding="${v8 tmp}/${v8 binding name}" if -f "$v8 trusted manifest" ; then echo "Missing trusted V8 manifest: $v8 trusted manifest" &2 exit 1 fi download "${v8 release url}/${v8 manifest name}" "$v8 manifest" expected manifest checksum="$ awk -v name="$v8 manifest name" '$2 == name { print $1; exit }' "$v8 trusted manifest" " actual manifest checksum="$ shasum -a 256 "$v8 manifest" | awk '{ print $1 }' " if -z "$expected manifest checksum" || "$actual manifest checksum" = "$expected manifest checksum" ; then echo "V8 checksum manifest verification failed for $v8 manifest name." &2 exit 1 fi if -f "$v8 archive" ; then download "${v8 release url}/${v8 archive name}" "$v8 archive" fi if -f "$v8 binding" ; then download "${v8 release url}/${v8 binding name}" "$v8 binding" fi cd "$v8 tmp" && shasum -a 256 -c "$v8 manifest" export RUSTY V8 ARCHIVE="$v8 archive" export RUSTY V8 SRC BINDING PATH="$v8 binding" cargo build --release \ -p codex-cli --bin codex \ -p codex-code-mode-host --bin codex-code-mode-host