package: include zsh fork in Codex package

Teach the Codex package builder to fetch the prebuilt zsh fork from a checked-in DotSlash manifest and install it under codex-resources/zsh/bin/zsh when an artifact is available for the package target.

Generalize the DotSlash download/cache/verify helper previously embedded in ripgrep packaging so additional checked-in DotSlash manifests can use the same SHA-256 and size validation path. Add install-context support for locating the bundled zsh fork and thread that path through config loading as the lowest-precedence zsh_path default, preserving explicit CLI/profile/global config values.

Also avoid preserving platform-specific file metadata when copying executables into the package directory so package smoke tests can use macOS system binaries as inputs.
This commit is contained in:
Michael Bolin
2026-05-20 14:54:06 -07:00
parent 896ee672cc
commit 9ccfe3cb29
21 changed files with 468 additions and 176 deletions
+1
View File
@@ -45,6 +45,7 @@ codex-guardian = { workspace = true }
codex-git-utils = { workspace = true }
codex-file-watcher = { workspace = true }
codex-hooks = { workspace = true }
codex-install-context = { workspace = true }
codex-otel = { workspace = true }
codex-plugin = { workspace = true }
codex-shell-command = { workspace = true }
+20
View File
@@ -9,6 +9,7 @@ use codex_core::config::Config;
use codex_core::config::ConfigOverrides;
use codex_exec_server::LOCAL_FS;
use codex_features::feature_for_key;
use codex_install_context::InstallContext;
use codex_login::AuthManager;
use codex_login::default_client::set_default_client_residency_requirement;
use codex_utils_absolute_path::AbsolutePathBuf;
@@ -159,6 +160,7 @@ impl ConfigManager {
.await?;
self.apply_runtime_feature_enablement(&mut config);
self.apply_arg0_paths(&mut config);
apply_default_zsh_path(&mut config);
Ok(config)
}
@@ -180,6 +182,7 @@ impl ConfigManager {
}
self.apply_runtime_feature_enablement(&mut config);
self.apply_arg0_paths(&mut config);
apply_default_zsh_path(&mut config);
Ok(config)
}
@@ -219,6 +222,11 @@ impl ConfigManager {
typesafe_overrides: ConfigOverrides,
fallback_cwd: Option<PathBuf>,
) -> std::io::Result<Config> {
let mut typesafe_overrides = typesafe_overrides;
if typesafe_overrides.default_zsh_path.is_none() {
typesafe_overrides.default_zsh_path = default_zsh_path();
}
let merged_cli_overrides = cli_overrides
.iter()
.cloned()
@@ -319,6 +327,18 @@ impl ConfigManager {
}
}
fn apply_default_zsh_path(config: &mut Config) {
if config.zsh_path.is_none() {
config.zsh_path = default_zsh_path();
}
}
fn default_zsh_path() -> Option<PathBuf> {
InstallContext::current()
.bundled_zsh_path()
.map(AbsolutePathBuf::into_path_buf)
}
pub(crate) fn protected_feature_keys(config_layer_stack: &ConfigLayerStack) -> BTreeSet<String> {
let mut protected_features = config_layer_stack
.effective_config()