cd /news/ai-tools/you-can-cargo-build-your-own-codex-r… · home topics ai-tools article
[ARTICLE · art-135184] src=github.com ↗ pub= topic=ai-tools verified=true sentiment=· neutral

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.

read2 min views9 publishedSep 20, 2026
You can cargo build your own codex rust
Image: Michielbdejong (auto-discovered)

forked from

openai/codex #

Notifications You must be signed in to change notification settings #

[Fork

0](https://github.com/login?return_to=%2Fandrewarrow%2Fcodex)

Expand file tree #

/

Copy path

More file actions

executable file

·

70 lines (56 loc) · 2.27 KB /

Copy path

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 "Down $(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
── more in #ai-tools 4 stories · sorted by recency
── more on @openai/codex 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/you-can-cargo-build-…] indexed:0 read:2min 2026-09-20 ·