mirror of
https://github.com/openai/codex.git
synced 2026-10-18 17:18:52 +00:00
Add a just recipe for assembling Codex packages (#39584)
## What changed - Add `just assemble-codex-package` as the documented entry point for the package builder. - Export `CODEX_REPO_ROOT` from `just` and release CI, and require the package builder to use it for repository-relative inputs. - Resolve the ripgrep and zsh manifests relative to their Python modules. GitOrigin-RevId: 039d12107a49171f064b0119adc6b99cf97c6c1e
This commit is contained in:
committed by
copyberry
parent
3b45c29062
commit
8e2265196e
@@ -4,6 +4,14 @@ This package contains the implementation behind `scripts/build_codex_package.py`
|
||||
The top-level script is the stable executable entry point; these modules keep the
|
||||
package-building logic split by responsibility.
|
||||
|
||||
Run the builder through `just`:
|
||||
|
||||
```bash
|
||||
just assemble-codex-package --help
|
||||
just assemble-codex-package --variant codex-app-server
|
||||
just assemble-codex-package --target x86_64-unknown-linux-gnu
|
||||
```
|
||||
|
||||
The builder creates a canonical Codex package directory:
|
||||
|
||||
```text
|
||||
|
||||
@@ -3,12 +3,9 @@
|
||||
from pathlib import Path
|
||||
|
||||
from .dotslash import fetch_dotslash_executable
|
||||
from .targets import REPO_ROOT
|
||||
from .targets import TargetSpec
|
||||
from .targets import resolve_input_path
|
||||
from .targets import TargetSpec, resolve_input_path
|
||||
|
||||
|
||||
RG_MANIFEST = REPO_ROOT / "scripts" / "codex_package" / "rg"
|
||||
RG_MANIFEST = Path(__file__).with_name("rg")
|
||||
|
||||
|
||||
def resolve_rg_bin(spec: TargetSpec, rg_bin: Path | None) -> Path:
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
"""Supported package targets and default binary discovery."""
|
||||
|
||||
import os
|
||||
import platform
|
||||
import stat
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
SCRIPT_DIR = Path(__file__).resolve().parents[1]
|
||||
REPO_ROOT = SCRIPT_DIR.parent
|
||||
_repo_root = os.environ.get("CODEX_REPO_ROOT")
|
||||
if _repo_root is None:
|
||||
raise RuntimeError(
|
||||
"CODEX_REPO_ROOT must point to the repository root; "
|
||||
"run `just assemble-codex-package` to set it automatically"
|
||||
)
|
||||
REPO_ROOT = Path(_repo_root)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
||||
@@ -3,12 +3,9 @@
|
||||
from pathlib import Path
|
||||
|
||||
from .dotslash import fetch_dotslash_executable
|
||||
from .targets import REPO_ROOT
|
||||
from .targets import TargetSpec
|
||||
from .targets import resolve_input_path
|
||||
from .targets import TargetSpec, resolve_input_path
|
||||
|
||||
|
||||
ZSH_MANIFEST = REPO_ROOT / "scripts" / "codex_package" / "codex-zsh"
|
||||
ZSH_MANIFEST = Path(__file__).with_name("codex-zsh")
|
||||
ZSH_RESOURCE_PATH = Path("zsh") / "bin" / "zsh"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user