codex/scripts
Michael Bolin 79f044ed34
build: default Codex package target and output (#23541)
## Why

The package builder should be easy to run during local iteration.
Requiring callers to provide both a target triple and an output
directory every time makes the common host-package case more awkward
than necessary.

This PR keeps explicit overrides available, but makes the default
invocation useful: build for the current host platform and place the
package in a fresh temporary directory. Because a temp output path is
otherwise easy to lose, the builder continues to print the final package
directory path when it completes.

## What changed

- Makes `--target` optional and maps the host OS/architecture to
supported Codex package target triples.
- Uses GNU Linux target triples for Linux host defaults, while keeping
the musl targets available for release jobs that pass `--target`
explicitly.
- Makes `--package-dir` optional and creates a new `codex-package-*`
temp directory when omitted.
- Documents the new defaults in `scripts/codex_package/README.md`.

## Verification

- Compiled `scripts/build_codex_package.py` and
`scripts/codex_package/*.py` with `PYTHONDONTWRITEBYTECODE=1`.
- Ran `scripts/build_codex_package.py --help` from outside the repo.
- Verified Linux host detection maps `x86_64` and `aarch64` to GNU
target triples.
- Ran a fake-Cargo package build while omitting both `--target` and
`--package-dir`; verified the generated metadata target, expected
package files, and printed temp package path.
- Ran a fake-Cargo package build for `x86_64-unknown-linux-gnu` and
verified `codex`, `bwrap`, and `rg` are assembled into the package.
History 2026-05-20 00:05:43 +00:00
..
codex_package build: default Codex package target and output (#23541) 2026-05-20 00:05:43 +00:00
install release/npm: bundle standalone bwrap on Linux (#21257) 2026-05-05 18:21:52 -07:00
asciicheck.py Enforce ASCII in README.md (#513) 2025-04-22 10:07:40 -04:00
build_codex_package.py build: add Codex package builder (#23513) 2026-05-19 19:54:03 +00:00
check-module-bazel-lock.sh bazel: enforce MODULE.bazel.lock sync with Cargo.lock (#11790) 2026-02-14 02:11:19 +00:00
check_blob_size.py check for large binaries in CI (#14382) 2026-03-11 22:39:08 +00:00
debug-codex.sh Enable plan tool by default (#5384) 2025-10-21 16:25:05 +00:00
list-bazel-clippy-targets.sh bazel: run sharded rust integration tests (#21057) 2026-05-04 13:33:14 -07:00
list-bazel-release-targets.sh Add Bazel verify-release-build job (#17705) 2026-04-14 15:36:51 -07:00
mock_responses_websocket_server.py WebSocket test server script (#9175) 2026-01-13 16:21:14 -08:00
readme_toc.py fix: ToC so it doesn’t include itself or duplicate the end marker (#4388) 2025-11-05 14:52:51 -08:00
run_tui_with_exec_server.sh Run exec-server fs operations through sandbox helper (#17294) 2026-04-12 18:36:03 -07:00
stage_npm_packages.py release/npm: bundle standalone bwrap on Linux (#21257) 2026-05-05 18:21:52 -07:00
start-codex-exec.sh Auto install start-codex-exec.sh dependencies (#17990) 2026-04-15 13:27:17 -07:00
test-remote-env.sh Fix rust-ci-full failures due to missing bwrap (#21604) 2026-05-08 09:52:19 -07:00