mirror of
https://github.com/openai/codex.git
synced 2026-11-17 22:10:37 +00:00
Merge bdafb7ab46 into sapling-pr-archive-bolinfest
This commit is contained in:
@@ -84,6 +84,32 @@ def parse_args() -> argparse.Namespace:
|
||||
"variant. If omitted, the entrypoint is built with Cargo."
|
||||
),
|
||||
)
|
||||
parser.add_argument(
|
||||
"--bwrap-bin",
|
||||
type=Path,
|
||||
help=(
|
||||
"Optional prebuilt Linux bwrap executable. If omitted for Linux "
|
||||
"targets, bwrap is built with Cargo."
|
||||
),
|
||||
)
|
||||
parser.add_argument(
|
||||
"--codex-command-runner-bin",
|
||||
type=Path,
|
||||
help=(
|
||||
"Optional prebuilt Windows codex-command-runner.exe executable. "
|
||||
"If omitted for Windows targets, codex-command-runner is built "
|
||||
"with Cargo."
|
||||
),
|
||||
)
|
||||
parser.add_argument(
|
||||
"--codex-windows-sandbox-setup-bin",
|
||||
type=Path,
|
||||
help=(
|
||||
"Optional prebuilt Windows codex-windows-sandbox-setup.exe "
|
||||
"executable. If omitted for Windows targets, "
|
||||
"codex-windows-sandbox-setup is built with Cargo."
|
||||
),
|
||||
)
|
||||
parser.add_argument(
|
||||
"--rg-bin",
|
||||
type=Path,
|
||||
@@ -111,14 +137,25 @@ def main() -> int:
|
||||
variant,
|
||||
cargo=args.cargo,
|
||||
profile=args.cargo_profile,
|
||||
entrypoint_bin=(
|
||||
resolve_input_path(
|
||||
args.entrypoint_bin,
|
||||
"prebuilt entrypoint executable",
|
||||
"--entrypoint-bin",
|
||||
)
|
||||
if args.entrypoint_bin is not None
|
||||
else None
|
||||
entrypoint_bin=resolve_optional_input_path(
|
||||
args.entrypoint_bin,
|
||||
"prebuilt entrypoint executable",
|
||||
"--entrypoint-bin",
|
||||
),
|
||||
bwrap_bin=resolve_optional_input_path(
|
||||
args.bwrap_bin,
|
||||
"prebuilt Linux bwrap executable",
|
||||
"--bwrap-bin",
|
||||
),
|
||||
codex_command_runner_bin=resolve_optional_input_path(
|
||||
args.codex_command_runner_bin,
|
||||
"prebuilt Windows codex-command-runner.exe executable",
|
||||
"--codex-command-runner-bin",
|
||||
),
|
||||
codex_windows_sandbox_setup_bin=resolve_optional_input_path(
|
||||
args.codex_windows_sandbox_setup_bin,
|
||||
"prebuilt Windows codex-windows-sandbox-setup.exe executable",
|
||||
"--codex-windows-sandbox-setup-bin",
|
||||
),
|
||||
)
|
||||
version = read_workspace_version()
|
||||
@@ -141,3 +178,14 @@ def main() -> int:
|
||||
|
||||
print(f"Built Codex package directory at {package_dir}")
|
||||
return 0
|
||||
|
||||
|
||||
def resolve_optional_input_path(
|
||||
explicit_path: Path | None,
|
||||
description: str,
|
||||
flag_name: str,
|
||||
) -> Path | None:
|
||||
if explicit_path is None:
|
||||
return None
|
||||
|
||||
return resolve_input_path(explicit_path, description, flag_name)
|
||||
|
||||
Reference in New Issue
Block a user