mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
build: package and validate code-mode host
This commit is contained in:
@@ -17,6 +17,7 @@ CODEX_RS_ROOT = REPO_ROOT / "codex-rs"
|
||||
@dataclass(frozen=True)
|
||||
class SourceBuildOutputs:
|
||||
entrypoint_bin: Path
|
||||
code_mode_host_bin: Path
|
||||
bwrap_bin: Path | None
|
||||
codex_command_runner_bin: Path | None
|
||||
codex_windows_sandbox_setup_bin: Path | None
|
||||
@@ -29,6 +30,7 @@ def build_source_binaries(
|
||||
cargo: str,
|
||||
profile: str,
|
||||
entrypoint_bin: Path | None,
|
||||
code_mode_host_bin: Path | None,
|
||||
bwrap_bin: Path | None,
|
||||
codex_command_runner_bin: Path | None,
|
||||
codex_windows_sandbox_setup_bin: Path | None,
|
||||
@@ -43,6 +45,7 @@ def build_source_binaries(
|
||||
spec,
|
||||
variant,
|
||||
build_entrypoint=entrypoint_bin is None,
|
||||
build_code_mode_host=code_mode_host_bin is None,
|
||||
build_bwrap=spec.is_linux and bwrap_bin is None,
|
||||
build_codex_command_runner=spec.is_windows and codex_command_runner_bin is None,
|
||||
build_codex_windows_sandbox_setup=spec.is_windows
|
||||
@@ -61,7 +64,7 @@ def build_source_binaries(
|
||||
cmd.extend(["--bin", binary])
|
||||
|
||||
cargo_env = None
|
||||
if entrypoint_bin is None:
|
||||
if entrypoint_bin is None or code_mode_host_bin is None:
|
||||
codex_v8_env = resolve_codex_v8_cargo_env(spec)
|
||||
if codex_v8_env:
|
||||
cargo_env = {**os.environ, **codex_v8_env}
|
||||
@@ -80,6 +83,10 @@ def build_source_binaries(
|
||||
entrypoint_bin,
|
||||
output_dir / variant.entrypoint_name(spec),
|
||||
),
|
||||
code_mode_host_bin=resolve_output_path(
|
||||
code_mode_host_bin,
|
||||
output_dir / f"codex-code-mode-host{spec.exe_suffix}",
|
||||
),
|
||||
bwrap_bin=resolve_output_path(
|
||||
bwrap_bin,
|
||||
output_dir / "bwrap" if spec.is_linux else None,
|
||||
@@ -102,6 +109,7 @@ def source_binaries_for_target(
|
||||
variant: PackageVariant,
|
||||
*,
|
||||
build_entrypoint: bool,
|
||||
build_code_mode_host: bool,
|
||||
build_bwrap: bool,
|
||||
build_codex_command_runner: bool,
|
||||
build_codex_windows_sandbox_setup: bool,
|
||||
@@ -109,6 +117,8 @@ def source_binaries_for_target(
|
||||
binaries = []
|
||||
if build_entrypoint:
|
||||
binaries.append(variant.cargo_bin)
|
||||
if build_code_mode_host:
|
||||
binaries.append("codex-code-mode-host")
|
||||
if build_bwrap:
|
||||
binaries.append("bwrap")
|
||||
if build_codex_command_runner:
|
||||
@@ -174,6 +184,7 @@ def cargo_profile_dirname(profile: str) -> str:
|
||||
def validate_source_outputs(outputs: SourceBuildOutputs) -> None:
|
||||
for path in [
|
||||
outputs.entrypoint_bin,
|
||||
outputs.code_mode_host_bin,
|
||||
outputs.bwrap_bin,
|
||||
outputs.codex_command_runner_bin,
|
||||
outputs.codex_windows_sandbox_setup_bin,
|
||||
|
||||
Reference in New Issue
Block a user