| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent cafcd60 commit 3a0d9bc
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,6 +55,30 @@ | |||
| 55 | 55 | "path": "codex-responses-api-proxy.exe" | |
| 56 | 56 | } | |
| 57 | 57 | } | |
| 58 | + }, | ||
| 59 | + "codex-command-runner": { | ||
| 60 | + "platforms": { | ||
| 61 | + "windows-x86_64": { | ||
| 62 | + "regex": "^codex-command-runner-x86_64-pc-windows-msvc\\.exe\\.zst$", | ||
| 63 | + "path": "codex-command-runner.exe" | ||
| 64 | + }, | ||
| 65 | + "windows-aarch64": { | ||
| 66 | + "regex": "^codex-command-runner-aarch64-pc-windows-msvc\\.exe\\.zst$", | ||
| 67 | + "path": "codex-command-runner.exe" | ||
| 68 | + } | ||
| 69 | + } | ||
| 70 | + }, | ||
| 71 | + "codex-windows-sandbox-setup": { | ||
| 72 | + "platforms": { | ||
| 73 | + "windows-x86_64": { | ||
| 74 | + "regex": "^codex-windows-sandbox-setup-x86_64-pc-windows-msvc\\.exe\\.zst$", | ||
| 75 | + "path": "codex-windows-sandbox-setup.exe" | ||
| 76 | + }, | ||
| 77 | + "windows-aarch64": { | ||
| 78 | + "regex": "^codex-windows-sandbox-setup-aarch64-pc-windows-msvc\\.exe\\.zst$", | ||
| 79 | + "path": "codex-windows-sandbox-setup.exe" | ||
| 80 | + } | ||
| 81 | + } | ||
| 58 | 82 | } | |
| 59 | 83 | } | |
| 60 | 84 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,9 +20,14 @@ | |||
| 20 | 20 | "codex-responses-api-proxy": ["codex-responses-api-proxy"], | |
| 21 | 21 | "codex-sdk": ["codex"], | |
| 22 | 22 | } | |
| 23 | + WINDOWS_ONLY_COMPONENTS: dict[str, list[str]] = { | ||
| 24 | + "codex": ["codex-windows-sandbox-setup", "codex-command-runner"], | ||
| 25 | + } | ||
| 23 | 26 | COMPONENT_DEST_DIR: dict[str, str] = { | |
| 24 | 27 | "codex": "codex", | |
| 25 | 28 | "codex-responses-api-proxy": "codex-responses-api-proxy", | |
| 29 | + "codex-windows-sandbox-setup": "codex", | ||
| 30 | + "codex-command-runner": "codex", | ||
| 26 | 31 | "rg": "path", | |
| 27 | 32 | } | |
| 28 | 33 | ||
@@ -103,7 +108,7 @@ def main() -> int: | |||
| 103 | 108 | "pointing to a directory containing pre-installed binaries." | |
| 104 | 109 | ) | |
| 105 | 110 | ||
| 106 | - copy_native_binaries(vendor_src, staging_dir, native_components) | ||
| 111 | + copy_native_binaries(vendor_src, staging_dir, package, native_components) | ||
| 107 | 112 | ||
| 108 | 113 | if release_version: | |
| 109 | 114 | staging_dir_str = str(staging_dir) | |
@@ -232,7 +237,12 @@ def stage_codex_sdk_sources(staging_dir: Path) -> None: | |||
| 232 | 237 | shutil.copy2(license_src, staging_dir / "LICENSE") | |
| 233 | 238 | ||
| 234 | 239 | ||
| 235 | - def copy_native_binaries(vendor_src: Path, staging_dir: Path, components: list[str]) -> None: | ||
| 240 | + def copy_native_binaries( | ||
| 241 | + vendor_src: Path, | ||
| 242 | + staging_dir: Path, | ||
| 243 | + package: str, | ||
| 244 | + components: list[str], | ||
| 245 | + ) -> None: | ||
| 236 | 246 | vendor_src = vendor_src.resolve() | |
| 237 | 247 | if not vendor_src.exists(): | |
| 238 | 248 | raise RuntimeError(f"Vendor source directory not found: {vendor_src}") | |
@@ -250,6 +260,9 @@ def copy_native_binaries(vendor_src: Path, staging_dir: Path, components: list[s | |||
| 250 | 260 | if not target_dir.is_dir(): | |
| 251 | 261 | continue | |
| 252 | 262 | ||
| 263 | + if "windows" in target_dir.name: | ||
| 264 | + components_set.update(WINDOWS_ONLY_COMPONENTS.get(package, [])) | ||
| 265 | + | ||
| 253 | 266 | dest_target_dir = vendor_dest / target_dir.name | |
| 254 | 267 | dest_target_dir.mkdir(parents=True, exist_ok=True) | |
| 255 | 268 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,8 +36,11 @@ class BinaryComponent: | |||
| 36 | 36 | artifact_prefix: str # matches the artifact filename prefix (e.g. codex-<target>.zst) | |
| 37 | 37 | dest_dir: str # directory under vendor/<target>/ where the binary is installed | |
| 38 | 38 | binary_basename: str # executable name inside dest_dir (before optional .exe) | |
| 39 | + targets: tuple[str, ...] | None = None # limit installation to specific targets | ||
| 39 | 40 | ||
| 40 | 41 | ||
| 42 | + WINDOWS_TARGETS = tuple(target for target in BINARY_TARGETS if "windows" in target) | ||
| 43 | + | ||
| 41 | 44 | BINARY_COMPONENTS = { | |
| 42 | 45 | "codex": BinaryComponent( | |
| 43 | 46 | artifact_prefix="codex", | |
@@ -49,6 +52,18 @@ class BinaryComponent: | |||
| 49 | 52 | dest_dir="codex-responses-api-proxy", | |
| 50 | 53 | binary_basename="codex-responses-api-proxy", | |
| 51 | 54 | ), | |
| 55 | + "codex-windows-sandbox-setup": BinaryComponent( | ||
| 56 | + artifact_prefix="codex-windows-sandbox-setup", | ||
| 57 | + dest_dir="codex", | ||
| 58 | + binary_basename="codex-windows-sandbox-setup", | ||
| 59 | + targets=WINDOWS_TARGETS, | ||
| 60 | + ), | ||
| 61 | + "codex-command-runner": BinaryComponent( | ||
| 62 | + artifact_prefix="codex-command-runner", | ||
| 63 | + dest_dir="codex", | ||
| 64 | + binary_basename="codex-command-runner", | ||
| 65 | + targets=WINDOWS_TARGETS, | ||
| 66 | + ), | ||
| 52 | 67 | } | |
| 53 | 68 | ||
| 54 | 69 | RG_TARGET_PLATFORM_PAIRS: list[tuple[str, str]] = [ | |
@@ -79,7 +94,8 @@ def parse_args() -> argparse.Namespace: | |||
| 79 | 94 | choices=tuple(list(BINARY_COMPONENTS) + ["rg"]), | |
| 80 | 95 | help=( | |
| 81 | 96 | "Limit installation to the specified components." | |
| 82 | - " May be repeated. Defaults to 'codex' and 'rg'." | ||
| 97 | + " May be repeated. Defaults to codex, codex-windows-sandbox-setup," | ||
| 98 | + " codex-command-runner, and rg." | ||
| 83 | 99 | ), | |
| 84 | 100 | ) | |
| 85 | 101 | parser.add_argument( | |
@@ -101,7 +117,12 @@ def main() -> int: | |||
| 101 | 117 | vendor_dir = codex_cli_root / VENDOR_DIR_NAME | |
| 102 | 118 | vendor_dir.mkdir(parents=True, exist_ok=True) | |
| 103 | 119 | ||
| 104 | - components = args.components or ["codex", "rg"] | ||
| 120 | + components = args.components or [ | ||
| 121 | + "codex", | ||
| 122 | + "codex-windows-sandbox-setup", | ||
| 123 | + "codex-command-runner", | ||
| 124 | + "rg", | ||
| 125 | + ] | ||
| 105 | 126 | ||
| 106 | 127 | workflow_url = (args.workflow_url or DEFAULT_WORKFLOW_URL).strip() | |
| 107 | 128 | if not workflow_url: | |
@@ -116,8 +137,7 @@ def main() -> int: | |||
| 116 | 137 | install_binary_components( | |
| 117 | 138 | artifacts_dir, | |
| 118 | 139 | vendor_dir, | |
| 119 | - BINARY_TARGETS, | ||
| 120 | - [name for name in components if name in BINARY_COMPONENTS], | ||
| 140 | + [BINARY_COMPONENTS[name] for name in components if name in BINARY_COMPONENTS], | ||
| 121 | 141 | ) | |
| 122 | 142 | ||
| 123 | 143 | if "rg" in components: | |
@@ -206,23 +226,19 @@ def _download_artifacts(workflow_id: str, dest_dir: Path) -> None: | |||
| 206 | 226 | def install_binary_components( | |
| 207 | 227 | artifacts_dir: Path, | |
| 208 | 228 | vendor_dir: Path, | |
| 209 | - targets: Iterable[str], | ||
| 210 | - component_names: Sequence[str], | ||
| 229 | + selected_components: Sequence[BinaryComponent], | ||
| 211 | 230 | ) -> None: | |
| 212 | - selected_components = [BINARY_COMPONENTS[name] for name in component_names if name in BINARY_COMPONENTS] | ||
| 213 | 231 | if not selected_components: | |
| 214 | 232 | return | |
| 215 | 233 | ||
| 216 | - targets = list(targets) | ||
| 217 | - if not targets: | ||
| 218 | - return | ||
| 219 | - | ||
| 220 | 234 | for component in selected_components: | |
| 235 | + component_targets = list(component.targets or BINARY_TARGETS) | ||
| 236 | + | ||
| 221 | 237 | print( | |
| 222 | 238 | f"Installing {component.binary_basename} binaries for targets: " | |
| 223 | - + ", ".join(targets) | ||
| 239 | + + ", ".join(component_targets) | ||
| 224 | 240 | ) | |
| 225 | - max_workers = min(len(targets), max(1, (os.cpu_count() or 1))) | ||
| 241 | + max_workers = min(len(component_targets), max(1, (os.cpu_count() or 1))) | ||
| 226 | 242 | with ThreadPoolExecutor(max_workers=max_workers) as executor: | |
| 227 | 243 | futures = { | |
| 228 | 244 | executor.submit( | |
@@ -232,7 +248,7 @@ def install_binary_components( | |||
| 232 | 248 | target, | |
| 233 | 249 | component, | |
| 234 | 250 | ): target | |
| 235 | - for target in targets | ||
| 251 | + for target in component_targets | ||
| 236 | 252 | } | |
| 237 | 253 | for future in as_completed(futures): | |
| 238 | 254 | installed_path = future.result() | |
| Back | FazBrowse Home | New Git URL |
0 commit comments