Skip to content

Commit 8e00398

Browse files
committed
refactor(runtime_validation): 删掉那个从来没人调用的汇总谓词
`has_proven_mismatch()` 在本轮之前就是死的,我只是把它改名成 `has_blocking_failure()` —— 改名的死代码比死代码更糟。 真正的门在 `ninja_backend` 里逐个产物走,因为它要**指名是哪一个**并打印它的解释。 再放一个「有没有失败」的谓词读同一份数据,就是同一个决策两处推导,而没人调用的 那一处正是会悄悄不再一致的那一处。留一条注释说明为什么这里没有它。
1 parent 93ab297 commit 8e00398

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

src/build/runtime_validation.cppm

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,14 @@ struct ValidatedArtifact {
3939
struct ValidationReport {
4040
std::vector<ValidatedArtifact> artifacts;
4141

42-
// Any artifact PROVEN bad — payloads mixed, or a DT_NEEDED that the
43-
// artifact's own loader will not find. Asks the verdict rather than
44-
// enumerating states here, so a fifth state cannot be added without this
45-
// gate deciding what it means.
46-
bool has_blocking_failure() const {
47-
return std::ranges::any_of(artifacts, [](auto const& artifact) {
48-
return artifact.verdict.blocking();
49-
});
50-
}
42+
// NOTE: there is deliberately no `has_blocking_failure()` here.
43+
//
44+
// There used to be a `has_proven_mismatch()`, and nothing ever called it —
45+
// the real gate walks the artifacts in `ninja_backend` so it can name WHICH
46+
// one failed and print its explanation. A second predicate that answers
47+
// "did anything fail" from the same data is the same decision in two
48+
// places, and the one with no callers is the one that silently stops
49+
// agreeing. Ask `verdict.blocking()` per artifact.
5150
};
5251

5352
struct StoredRuntimeSummary {

0 commit comments

Comments
 (0)