|
|
@@ -6,6 +6,7 @@ from __future__ import annotations
|
|
|
import argparse
|
|
|
import hashlib
|
|
|
import json
|
|
|
+import os
|
|
|
import subprocess
|
|
|
import sys
|
|
|
import tempfile
|
|
|
@@ -14,6 +15,22 @@ from pathlib import Path
|
|
|
HOST = Path(__file__).resolve().parents[1]
|
|
|
REPO = HOST.parent
|
|
|
SKIP_GO_PREFIXES = ("internal/gen/",)
|
|
|
+TOOLCHAIN_PATH_PREFIX = (
|
|
|
+ "/data/prod2u/bin",
|
|
|
+ "/data/prod2u/opt/go1.25.13/bin",
|
|
|
+ "/opt/python-3.12/bin",
|
|
|
+ "/usr/bin",
|
|
|
+ "/bin",
|
|
|
+)
|
|
|
+
|
|
|
+
|
|
|
+def _ensure_toolchain_path() -> None:
|
|
|
+ cur = os.environ.get("PATH", "")
|
|
|
+ parts = [p for p in TOOLCHAIN_PATH_PREFIX if p]
|
|
|
+ for p in cur.split(os.pathsep):
|
|
|
+ if p and p not in parts:
|
|
|
+ parts.append(p)
|
|
|
+ os.environ["PATH"] = os.pathsep.join(parts)
|
|
|
|
|
|
|
|
|
def sha256(path: Path) -> str:
|
|
|
@@ -90,6 +107,7 @@ def maybe_buf() -> str:
|
|
|
|
|
|
|
|
|
def main() -> int:
|
|
|
+ _ensure_toolchain_path()
|
|
|
ap = argparse.ArgumentParser()
|
|
|
ap.add_argument("--repo-root", type=Path, default=None)
|
|
|
ap.add_argument("--evidence-root", type=Path, default=None)
|