|
|
@@ -685,7 +685,10 @@ def formal_tool_env(work_root: Path) -> dict[str, str]:
|
|
|
|
|
|
|
|
|
def active_rtl_sources() -> list[str]:
|
|
|
- return [relative for relative in PRODUCTION_RTL_SOURCES if (ROOT / relative).is_file()]
|
|
|
+ missing = [relative for relative in PRODUCTION_RTL_SOURCES if not (ROOT / relative).is_file()]
|
|
|
+ if missing:
|
|
|
+ raise FileNotFoundError(f"active source closure is incomplete: {missing}")
|
|
|
+ return list(PRODUCTION_RTL_SOURCES)
|
|
|
|
|
|
|
|
|
def hdl_testbenches() -> list[dict[str, Any]]:
|
|
|
@@ -3287,7 +3290,7 @@ def package_selftest_payload(
|
|
|
if verification_complete is not False:
|
|
|
failures.append("urgent_verification_complete_must_be_false")
|
|
|
commit = str(info.get("commit", ""))
|
|
|
- if not (FULL_COMMIT_RE.fullmatch(commit) or SHORT_COMMIT_RE.fullmatch(commit)):
|
|
|
+ if not FULL_COMMIT_RE.fullmatch(commit):
|
|
|
failures.append("package_commit_invalid")
|
|
|
info_commit_full = str(info.get("commit_full", ""))
|
|
|
if info_commit_full and not FULL_COMMIT_RE.fullmatch(info_commit_full):
|
|
|
@@ -3296,10 +3299,7 @@ def package_selftest_payload(
|
|
|
failures.append("package_commit_full_mismatch")
|
|
|
if info.get("project_config_sha256") != expected_project_config_sha256:
|
|
|
failures.append("package_project_config_sha256_mismatch")
|
|
|
- if info.get("td_source_manifest_sha256") not in {
|
|
|
- None,
|
|
|
- expected_td_source_manifest_sha256,
|
|
|
- }:
|
|
|
+ if info.get("td_source_manifest_sha256") != expected_td_source_manifest_sha256:
|
|
|
failures.append("package_td_source_manifest_sha256_mismatch")
|
|
|
if info.get("bitstream_sha256") != digest:
|
|
|
failures.append("package_bitstream_sha256_mismatch")
|
|
|
@@ -3379,15 +3379,9 @@ def package_selftest_payload(
|
|
|
if primary_td:
|
|
|
if not receipt_commit_matches(primary_td, package_expected_commit):
|
|
|
failures.append("primary_td_commit_mismatch")
|
|
|
- if primary_td.get("project_config_sha256") not in {
|
|
|
- None,
|
|
|
- expected_project_config_sha256,
|
|
|
- }:
|
|
|
+ if primary_td.get("project_config_sha256") != expected_project_config_sha256:
|
|
|
failures.append("primary_td_project_config_sha256_mismatch")
|
|
|
- if primary_td.get("td_source_manifest_sha256") not in {
|
|
|
- None,
|
|
|
- expected_td_source_manifest_sha256,
|
|
|
- }:
|
|
|
+ if primary_td.get("td_source_manifest_sha256") != expected_td_source_manifest_sha256:
|
|
|
failures.append("primary_td_td_source_manifest_sha256_mismatch")
|
|
|
if primary_td.get("bitstream_sha256") != digest:
|
|
|
failures.append("primary_td_bitstream_sha256_mismatch")
|
|
|
@@ -3396,15 +3390,9 @@ def package_selftest_payload(
|
|
|
if confirmation_td and confirmation_td.get("status") == "pass":
|
|
|
if not receipt_commit_matches(confirmation_td, package_expected_commit):
|
|
|
failures.append("confirmation_td_commit_mismatch")
|
|
|
- if confirmation_td.get("project_config_sha256") not in {
|
|
|
- None,
|
|
|
- expected_project_config_sha256,
|
|
|
- }:
|
|
|
+ if confirmation_td.get("project_config_sha256") != expected_project_config_sha256:
|
|
|
failures.append("confirmation_td_project_config_sha256_mismatch")
|
|
|
- if confirmation_td.get("td_source_manifest_sha256") not in {
|
|
|
- None,
|
|
|
- expected_td_source_manifest_sha256,
|
|
|
- }:
|
|
|
+ if confirmation_td.get("td_source_manifest_sha256") != expected_td_source_manifest_sha256:
|
|
|
failures.append("confirmation_td_td_source_manifest_sha256_mismatch")
|
|
|
if (
|
|
|
confirmation_td.get("bitstream_sha256") not in {None, ""}
|
|
|
@@ -3522,7 +3510,9 @@ def package_selftest_payload(
|
|
|
|
|
|
script_result: dict[str, Any] = {"status": "not_run", "returncode": None}
|
|
|
selftest = package / "selftest.ps1"
|
|
|
- if not failures and selftest.is_file():
|
|
|
+ if not selftest.is_file():
|
|
|
+ failures.append("package_selftest_script_missing")
|
|
|
+ elif not failures:
|
|
|
completed = subprocess.run(
|
|
|
[
|
|
|
"powershell.exe",
|
|
|
@@ -3667,10 +3657,8 @@ def _td_final_failures(
|
|
|
failures.append(prefix + "schema")
|
|
|
if receipt.get("status") != "pass":
|
|
|
failures.append(prefix + "status")
|
|
|
- if not receipt_commit_matches(receipt, expected_commit):
|
|
|
+ if receipt_commit_full(receipt) != expected_commit:
|
|
|
failures.append(prefix + "commit")
|
|
|
- if receipt.get("commit_full") not in {None, "", expected_commit}:
|
|
|
- failures.append(prefix + "commit_full")
|
|
|
if receipt.get("project_config_sha256") != expected_project_config_sha256:
|
|
|
failures.append(prefix + "project_config_sha256")
|
|
|
if receipt.get("td_source_manifest_sha256") != expected_td_source_manifest_sha256:
|
|
|
@@ -3806,7 +3794,7 @@ def _offline_final_failures(
|
|
|
failures: list[str] = []
|
|
|
if receipt.get("schema") != OFFLINE_RECEIPT_SCHEMA:
|
|
|
failures.append("offline:schema")
|
|
|
- if receipt.get("status") != "pass" or not receipt_commit_matches(receipt, expected_commit):
|
|
|
+ if receipt.get("status") != "pass" or receipt_commit_full(receipt) != expected_commit:
|
|
|
failures.append("offline:status_or_commit")
|
|
|
if receipt.get("project_config_sha256") != expected_project_config_sha256:
|
|
|
failures.append("offline:project_config_sha256")
|
|
|
@@ -3968,7 +3956,11 @@ def _package_final_failures(
|
|
|
actual_files = {
|
|
|
path.relative_to(package_dir).as_posix(): sha256_file(path)
|
|
|
for path in sorted(package_dir.rglob("*"))
|
|
|
- if path.is_file() and path not in {info_path, packaged_selftest_path}
|
|
|
+ if path.is_file() and path not in {
|
|
|
+ info_path,
|
|
|
+ package_dir / "package_manifest.json",
|
|
|
+ packaged_selftest_path,
|
|
|
+ }
|
|
|
}
|
|
|
if not info or info.get("file_sha256") != actual_files:
|
|
|
failures.append("package:file_manifest:info")
|