Small builder to produce codex binaries with a CoCalc-specific patch that enriches
file_change events (adds pre_contents) for JSONL output from codex exec.
- Clones the upstream codex repo at a tag (default
rust-v0.76.0). - Applies a minimal patch to
codex execJSONL output sofile_changeevents include the original file contents (per path) after a patch apply. This lets downstream tools show diffs/patchflow without re-reading files at event time. - Builds
codex-cli(and related binaries) and places them indist/.
TAG=rust-v0.76.0 ./build.sh
ls dist/A workflow (.github/workflows/build.yml) runs ./build.sh and uploads the built
binaries as an artifact (codex-cocalc-binaries).
file_change_pre_contents.patch: extendsFileChangeItemwith optionalpre_contents.event_processor_with_jsonl_output.patch: captures pre-contents at patch begin and emits them in thefile_changeitem.
- Changes are minimal and upstream-friendly; if upstream changes break the patch, adjust the patch files and rerun.
- Binaries are suitable for per-project containers or local use (cocalc-plus).