std.Build: fix '--webui' crash

Using '--webui' without '--time-report' when there are Run steps in the
graph was regressed by https://github.com/ziglang/zig/pull/25029.
This commit is contained in:
Matthew Lugg 2025-10-28 13:34:53 +00:00
parent 9215121688
commit 0dde70ef76
No known key found for this signature in database
GPG key ID: 3F5B7DCCBF4AF02E

View file

@ -1587,11 +1587,15 @@ fn spawnChildAndCollect(
run.step.test_results = res.test_results;
if (res.test_metadata) |tm| {
run.cached_test_metadata = tm.toCachedTestMetadata();
if (options.web_server) |ws| ws.updateTimeReportRunTest(
run,
&run.cached_test_metadata.?,
tm.ns_per_test,
);
if (options.web_server) |ws| {
if (b.graph.time_report) {
ws.updateTimeReportRunTest(
run,
&run.cached_test_metadata.?,
tm.ns_per_test,
);
}
}
}
return null;
} else {