Skip to content

package: include zsh fork in Codex package#23756

Open
bolinfest wants to merge 1 commit into
pr24129from
pr23756
Open

package: include zsh fork in Codex package#23756
bolinfest wants to merge 1 commit into
pr24129from
pr23756

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented May 20, 2026

Why

The package layout gives Codex a stable place for runtime helpers that should travel with the entrypoint. shell_zsh_fork still required users to configure zsh_path manually, even though we already publish prebuilt zsh fork artifacts.

This PR builds on #24129's shared DotSlash artifact fetcher and uses it to include the zsh fork in Codex packages when a matching target artifact exists. Packaged Codex builds can then discover the bundled fork automatically while still respecting any explicit user-provided zsh_path.

What Changed

  • Added scripts/codex_package/codex-zsh, a checked-in DotSlash manifest for the current macOS arm64 and Linux zsh fork artifacts.
  • Taught scripts/build_codex_package.py to fetch the matching zsh fork artifact and install it at codex-resources/zsh/bin/zsh when available for the selected target.
  • Added package layout validation for the optional bundled zsh resource.
  • Added InstallContext::bundled_zsh_path() and InstallContext::bundled_zsh_bin_dir() for package-layout resource discovery.
  • Threaded the packaged zsh path through config loading as the lowest-precedence zsh_path default, preserving explicit CLI/profile/global config values.
  • Switched package executable copying from metadata-preserving copy2() to copyfile() plus explicit executable bits, which avoids macOS file-flag failures when local smoke tests use system binaries as inputs.

Testing

  • python3 -m py_compile scripts/codex_package/dotslash.py scripts/codex_package/ripgrep.py scripts/codex_package/cli.py scripts/codex_package/layout.py scripts/codex_package/zsh.py
  • python3 -m unittest discover scripts/codex_package
  • cargo test -p codex-core zsh_path

Stack created with Sapling. Best reviewed with ReviewStack.

@bolinfest bolinfest requested a review from a team as a code owner May 20, 2026 21:17
@bolinfest bolinfest force-pushed the pr23756 branch 2 times, most recently from 5883f12 to 6b5de5b Compare May 22, 2026 17:08
Summary:
- add a checked-in codex-zsh DotSlash manifest for supported Unix targets
- fetch the matching zsh fork artifact during package builds and install it at codex-resources/zsh/bin/zsh when available
- expose the bundled zsh fork through install-context and thread it through config loading as the lowest-precedence zsh_path default
- use copyfile for package executable staging so local package smoke tests do not preserve platform-specific source metadata

Test Plan:
- just fmt
- python3 -m py_compile scripts/codex_package/cli.py scripts/codex_package/layout.py scripts/codex_package/zsh.py
- python3 -m unittest discover scripts/codex_package
- cargo test -p codex-core zsh_path
@bolinfest bolinfest changed the base branch from main to pr24129 May 22, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant