build: package and launch code mode host

This commit is contained in:
Channing Conger
2026-06-12 05:39:29 +00:00
parent b0cf57bdeb
commit 30401f3963
19 changed files with 309 additions and 39 deletions
@@ -8,6 +8,7 @@ Usage: build-codex-package-archive.sh \
--bundle <primary|app-server> \
--entrypoint-dir <dir> \
--archive-dir <dir> \
[--code-mode-host-bin <path>] \
[--bwrap-bin <path>] \
[--codex-command-runner-bin <path>] \
[--codex-windows-sandbox-setup-bin <path>] \
@@ -19,6 +20,7 @@ target=""
bundle=""
entrypoint_dir=""
archive_dir=""
code_mode_host_bin=""
target_suffixed_entrypoint="false"
resource_args=()
bwrap_bin_provided="false"
@@ -43,6 +45,10 @@ while [[ $# -gt 0 ]]; do
archive_dir="${2:?--archive-dir requires a value}"
shift 2
;;
--code-mode-host-bin)
code_mode_host_bin="${2:?--code-mode-host-bin requires a value}"
shift 2
;;
--bwrap-bin)
resource_args+=(--bwrap-bin "${2:?--bwrap-bin requires a value}")
bwrap_bin_provided="true"
@@ -110,8 +116,18 @@ case "$target" in
esac
entrypoint_name="$entrypoint"
code_mode_host_name="codex-code-mode-host"
if [[ "$target_suffixed_entrypoint" == "true" ]]; then
entrypoint_name="${entrypoint_name}-${target}"
code_mode_host_name="${code_mode_host_name}-${target}"
fi
if [[ -z "$code_mode_host_bin" ]]; then
code_mode_host_bin="${entrypoint_dir%/}/${code_mode_host_name}${exe_suffix}"
fi
if [[ ! -f "$code_mode_host_bin" ]]; then
echo "Code-mode host binary ${code_mode_host_bin} not found" >&2
exit 1
fi
case "$target" in
@@ -159,6 +175,7 @@ python_args=(
--target "$target"
--variant "$variant"
--entrypoint-bin "${entrypoint_dir%/}/${entrypoint_name}${exe_suffix}"
--code-mode-host-bin "$code_mode_host_bin"
--cargo-profile release
--package-dir "$package_dir"
--archive-output "$gzip_archive_path"