Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 06d99f0799
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ("linux", "aarch64"): "aarch64-unknown-linux-musl", | ||
| ("linux", "x86_64"): "x86_64-unknown-linux-musl", |
There was a problem hiding this comment.
Avoid defaulting Linux hosts to musl targets
default_target() now maps Linux hosts to *-unknown-linux-musl, so running build_codex_package.py without --target on a typical Linux Rust setup (which usually only has the native *-unknown-linux-gnu std installed) causes cargo build --target ...-musl to fail unless users manually add that target/toolchain. This regresses the new default behavior and conflicts with the CLI promise that omitting --target uses the host platform.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 7265106. Linux host defaults now map to x86_64-unknown-linux-gnu / aarch64-unknown-linux-gnu, and those are supported package targets. The existing musl targets remain available for release jobs that pass --target explicitly. I verified the Linux host mapping with patched platform.system()/platform.machine() and ran a fake-Cargo package build for x86_64-unknown-linux-gnu.
## Why The Codex package builder should produce a complete package without requiring callers to pre-populate `rg` under `codex-cli/vendor` or have `dotslash` installed on `PATH`. The repo already tracks the authoritative DotSlash manifest in `codex-cli/bin/rg`, so the builder can read that metadata directly and fetch the correct ripgrep archive for the target it is packaging. ## What changed - Added `scripts/codex_package/ripgrep.py` to parse `codex-cli/bin/rg` after stripping the shebang, select the target platform entry, download the configured artifact, and verify the recorded size and SHA-256 digest. - Added a cache under `$TMPDIR/codex-package/<target>-rg` so verified archives can be reused without fetching again. - Extracted `rg`/`rg.exe` from `tar.gz` and `zip` artifacts into the package-builder cache, then copied that into `codex-path` through the existing package layout flow. - Kept `--rg-bin` as an explicit local override for offline tests and unusual local workflows. - Documented the default `rg` fetch/cache behavior in `scripts/codex_package/README.md`. ## Verification - Ran wrapper/module syntax compilation. - Ran `scripts/build_codex_package.py --help` from `/private/tmp`. - Ran a local manifest fetch test covering shebang-stripped manifest parsing, `tar.gz` extraction, `zip` extraction, size/SHA-256 verification, and cache reuse after deleting the original source archives. - Ran fake-cargo package/archive builds for macOS, Linux, and Windows target layouts with `--rg-bin`, including an assertion that generated tar archives contain no duplicate member names. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/openai/codex/pull/23526). * #23541 * __->__ #23526
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 release target 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
--targetoptional and maps the host OS/architecture to supported Codex package release targets.--package-diroptional and creates a newcodex-package-*temp directory when omitted.scripts/codex_package/README.md.Verification
scripts/build_codex_package.pyandscripts/codex_package/*.pywithPYTHONDONTWRITEBYTECODE=1.scripts/build_codex_package.py --helpfrom outside the repo.x86_64andaarch64to musl target triples.--targetand--package-dir; verified the generated metadata target, expected package files, and printed temp package path.