mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
Pin V8 release manifests and prevent published release replacement (#43444)
## Why Artifact checksums alone do not authenticate the downloaded checksum manifest. V8 downloads need a trusted digest recorded in the repository, and published releases should not have their assets overwritten. ## What changed - Pin the V8 `150.4.0` release manifest digests and verify manifests before downloading archives or bindings in packaging and `setup-rusty-v8`, preserving CRLF support. - Refuse to replace published V8 releases, remove unfinished drafts on retry, and use `gh release create` to upload assets before publication. - Install Windows `sccache` through a pinned `taiki-e/install-action` in the release and canary workflows. - Document independent manifest verification and digest recording for version updates. ## Testing Add five packaging tests covering successful downloads, CRLF manifests, tampered manifests, missing pins, and missing pin files. Rejection tests verify that artifacts are not downloaded. GitOrigin-RevId: 5c771cdcff376388e124faa4826bf81135d84b50
This commit is contained in:
@@ -74,6 +74,7 @@ def fetch_codex_v8_artifacts(
|
||||
checksums = cache_dir / checksums_name
|
||||
|
||||
download_file(f"{release_url}/{checksums.name}", checksums)
|
||||
verify_release_checksum_manifest(checksums, version=version)
|
||||
expected_checksums = load_checksums(checksums, {archive.name, binding.name})
|
||||
for artifact in [archive, binding]:
|
||||
ensure_valid_artifact(
|
||||
@@ -107,6 +108,32 @@ def default_cache_root() -> Path:
|
||||
return Path(tempfile.gettempdir()) / "codex-package"
|
||||
|
||||
|
||||
def verify_release_checksum_manifest(checksums_path: Path, *, version: str) -> None:
|
||||
version_suffix = version.replace(".", "_")
|
||||
trusted_checksums = (
|
||||
REPO_ROOT
|
||||
/ "third_party"
|
||||
/ "v8"
|
||||
/ f"rusty_v8_{version_suffix}_release_manifests.sha256"
|
||||
)
|
||||
|
||||
for line in trusted_checksums.read_text(encoding="utf-8").splitlines():
|
||||
digest, artifact_name = line.split(maxsplit=1)
|
||||
if artifact_name != checksums_path.name:
|
||||
continue
|
||||
if has_checksum(checksums_path, digest):
|
||||
return
|
||||
|
||||
checksums_path.unlink(missing_ok=True)
|
||||
raise RuntimeError(
|
||||
f"V8 checksum manifest {checksums_path} does not match its trusted SHA-256."
|
||||
)
|
||||
|
||||
raise RuntimeError(
|
||||
f"V8 checksum manifest {checksums_path.name} has no trusted SHA-256 for {version}."
|
||||
)
|
||||
|
||||
|
||||
def load_checksums(checksums_path: Path, artifact_names: set[str]) -> dict[str, str]:
|
||||
checksums: dict[str, str] = {}
|
||||
lines = checksums_path.read_text(encoding="utf-8").splitlines()
|
||||
|
||||
Reference in New Issue
Block a user