|
|
@@ -23,6 +23,7 @@ def main() -> int:
|
|
|
parser.add_argument("--profile", choices=("6400-front-rear",), default="6400-front-rear")
|
|
|
parser.add_argument("--output-dir", type=Path, required=True)
|
|
|
parser.add_argument("--bitstream-sha256", required=True)
|
|
|
+ parser.add_argument("--wsl-source-root")
|
|
|
args = parser.parse_args()
|
|
|
contract_path = ROOT / "generated/6400/host-contract.json"
|
|
|
golden_path = ROOT / "generated/6400/golden-vectors.json"
|
|
|
@@ -30,8 +31,15 @@ def main() -> int:
|
|
|
golden = json.loads(golden_path.read_text(encoding="utf-8"))
|
|
|
if contract["contract_sha256"] != golden["contract_sha256"]:
|
|
|
raise SystemExit("contract/golden SHA mismatch")
|
|
|
- commit = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=ROOT, text=True).strip()
|
|
|
- if subprocess.check_output(["git", "status", "--porcelain"], cwd=ROOT, text=True).strip():
|
|
|
+ git_prefix = ["git"]
|
|
|
+ git_cwd = ROOT
|
|
|
+ if args.wsl_source_root:
|
|
|
+ if sys.platform != "win32":
|
|
|
+ raise SystemExit("--wsl-source-root is only valid for the Windows GUI build")
|
|
|
+ git_prefix = ["wsl.exe", "-d", "Debian13", "--cd", args.wsl_source_root, "git"]
|
|
|
+ git_cwd = None
|
|
|
+ commit = subprocess.check_output([*git_prefix, "rev-parse", "HEAD"], cwd=git_cwd, text=True).strip()
|
|
|
+ if subprocess.check_output([*git_prefix, "status", "--porcelain"], cwd=git_cwd, text=True).strip():
|
|
|
raise SystemExit("GUI packaging requires an exact clean commit")
|
|
|
output = args.output_dir.resolve()
|
|
|
output.mkdir(parents=True, exist_ok=True)
|