mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
Add skip reason to build summary
Add a message to why a step was skipped to the build summary by adding an optional result_skip_reason field to Step, and setting it whenever the MakeSkipped error is returned. Solved https://github.com/ziglang/zig/issues/14965
This commit is contained in:
parent
854774d468
commit
b6514e8a57
3 changed files with 25 additions and 5 deletions
|
|
@ -1062,6 +1062,10 @@ fn printStepStatus(
|
|||
.skipped, .skipped_oom => |skip| {
|
||||
try ttyconf.setColor(stderr, .yellow);
|
||||
try stderr.writeAll(" skipped");
|
||||
if (s.result_skip_reason) |reason| {
|
||||
try stderr.writeAll(": ");
|
||||
try stderr.writeAll(reason);
|
||||
}
|
||||
if (skip == .skipped_oom) {
|
||||
try stderr.writeAll(" (not enough memory)");
|
||||
try ttyconf.setColor(stderr, .dim);
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ state: State,
|
|||
max_rss: usize,
|
||||
|
||||
result_error_msgs: ArrayList([]const u8),
|
||||
result_skip_reason: ?[]const u8 = null,
|
||||
result_error_bundle: std.zig.ErrorBundle,
|
||||
result_stderr: []const u8,
|
||||
result_cached: bool,
|
||||
|
|
|
|||
|
|
@ -1317,7 +1317,10 @@ fn runCommand(
|
|||
.link_libc = exe.is_linking_libc,
|
||||
})) {
|
||||
.native, .rosetta => {
|
||||
if (allow_skip) return error.MakeSkipped;
|
||||
if (allow_skip) {
|
||||
run.step.result_skip_reason = "Invalid binary";
|
||||
return error.MakeSkipped;
|
||||
}
|
||||
break :interpret;
|
||||
},
|
||||
.wine => |bin_name| {
|
||||
|
|
@ -1395,7 +1398,10 @@ fn runCommand(
|
|||
}
|
||||
},
|
||||
.bad_dl => |foreign_dl| {
|
||||
if (allow_skip) return error.MakeSkipped;
|
||||
if (allow_skip) {
|
||||
run.step.result_skip_reason = "Invalid binary";
|
||||
return error.MakeSkipped;
|
||||
}
|
||||
|
||||
const host_dl = b.graph.host.result.dynamic_linker.get() orelse "(none)";
|
||||
|
||||
|
|
@ -1407,7 +1413,10 @@ fn runCommand(
|
|||
, .{ host_dl, foreign_dl });
|
||||
},
|
||||
.bad_os_or_cpu => {
|
||||
if (allow_skip) return error.MakeSkipped;
|
||||
if (allow_skip) {
|
||||
run.step.result_skip_reason = "Invalid os or cpu";
|
||||
return error.MakeSkipped;
|
||||
}
|
||||
|
||||
const host_name = try b.graph.host.result.zigTriple(b.allocator);
|
||||
const foreign_name = try root_target.zigTriple(b.allocator);
|
||||
|
|
@ -1428,8 +1437,12 @@ fn runCommand(
|
|||
try Step.handleVerbose2(step.owner, cwd, run.env_map, interp_argv.items);
|
||||
|
||||
break :term spawnChildAndCollect(run, interp_argv.items, &env_map, has_side_effects, options, fuzz_context) catch |e| {
|
||||
if (!run.failing_to_execute_foreign_is_an_error) return error.MakeSkipped;
|
||||
if (!run.failing_to_execute_foreign_is_an_error) {
|
||||
run.step.result_skip_reason = "Foreign binary failed";
|
||||
return error.MakeSkipped;
|
||||
}
|
||||
if (e == error.MakeFailed) return error.MakeFailed; // error already reported
|
||||
|
||||
return step.fail("unable to spawn interpreter {s}: {s}", .{
|
||||
interp_argv.items[0], @errorName(e),
|
||||
});
|
||||
|
|
@ -2294,8 +2307,10 @@ fn failForeign(
|
|||
) error{ MakeFailed, MakeSkipped, OutOfMemory } {
|
||||
switch (run.stdio) {
|
||||
.check, .zig_test => {
|
||||
if (run.skip_foreign_checks)
|
||||
if (run.skip_foreign_checks) {
|
||||
run.step.result_skip_reason = "Foreign binary failed";
|
||||
return error.MakeSkipped;
|
||||
}
|
||||
|
||||
const b = run.step.owner;
|
||||
const host_name = try b.graph.host.result.zigTriple(b.allocator);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue