This commit is contained in:
2026-08-21 11:13:18 +08:00
parent beba8744b4
commit 41ed846c23
2028 changed files with 1327194 additions and 293 deletions
+13 -9
View File
@@ -38,13 +38,12 @@ def run_rebuild(cdsl: dict[str, Any], out_step: Path, ctx_file: Path | None = No
_sketch_is_cdsl_drawable(s) for s in sketches
)
if all_drawable and not force_exact:
try:
return _run_cdsl_only(cdsl, out_step, gold_step=gold_step)
except Exception as e:
import traceback
traceback.print_exc()
print(f" [WARN] CDSL-only path failed: {e}, falling back")
cdsl_only_error: Exception | None = None
if all_drawable and not force_exact:
try:
return _run_cdsl_only(cdsl, out_step, gold_step=gold_step)
except Exception as e:
cdsl_only_error = e
# 加载 compiler_context(后备路径)
ctx = None
@@ -66,8 +65,13 @@ def run_rebuild(cdsl: dict[str, Any], out_step: Path, ctx_file: Path | None = No
"references": ir.get("references", []),
"validation_hints": ir.get("validation_hints", {}),
}
if ctx is None and not (cdsl.get("compiler_context")):
raise RuntimeError("No compiler_context available and CDSL-only rebuild failed/unavailable")
if ctx is None and not (cdsl.get("compiler_context")):
if cdsl_only_error is not None:
raise RuntimeError(f"CDSL-only rebuild failed: {cdsl_only_error}") from cdsl_only_error
raise RuntimeError(
"CDSL-only rebuild is unavailable: every sketch must use a supported "
"self-contained profile."
)
if ctx is not None:
cdsl["compiler_context"] = ctx