mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-07 14:24:43 +00:00
build runner: update watch caption to include subprocesses
This commit is contained in:
parent
987f63208e
commit
445bd7a06f
3 changed files with 12 additions and 5 deletions
|
|
@ -72,7 +72,6 @@ pub fn main() !void {
|
||||||
.query = .{},
|
.query = .{},
|
||||||
.result = try std.zig.system.resolveTargetQuery(.{}),
|
.result = try std.zig.system.resolveTargetQuery(.{}),
|
||||||
},
|
},
|
||||||
.incremental = null,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
graph.cache.addPrefix(.{ .path = null, .handle = std.fs.cwd() });
|
graph.cache.addPrefix(.{ .path = null, .handle = std.fs.cwd() });
|
||||||
|
|
@ -411,8 +410,8 @@ pub fn main() !void {
|
||||||
// trigger a rebuild on all steps with modified inputs, as well as their
|
// trigger a rebuild on all steps with modified inputs, as well as their
|
||||||
// recursive dependants.
|
// recursive dependants.
|
||||||
var caption_buf: [std.Progress.Node.max_name_len]u8 = undefined;
|
var caption_buf: [std.Progress.Node.max_name_len]u8 = undefined;
|
||||||
const caption = std.fmt.bufPrint(&caption_buf, "Watching {d} Directories", .{
|
const caption = std.fmt.bufPrint(&caption_buf, "watching {d} directories, {d} processes", .{
|
||||||
w.dir_table.entries.len,
|
w.dir_table.entries.len, countSubProcesses(run.step_stack.keys()),
|
||||||
}) catch &caption_buf;
|
}) catch &caption_buf;
|
||||||
var debouncing_node = main_progress_node.start(caption, 0);
|
var debouncing_node = main_progress_node.start(caption, 0);
|
||||||
var debounce_timeout: Watch.Timeout = .none;
|
var debounce_timeout: Watch.Timeout = .none;
|
||||||
|
|
@ -445,6 +444,14 @@ fn markFailedStepsDirty(gpa: Allocator, all_steps: []const *Step) void {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn countSubProcesses(all_steps: []const *Step) usize {
|
||||||
|
var count: usize = 0;
|
||||||
|
for (all_steps) |s| {
|
||||||
|
count += @intFromBool(s.getZigProcess() != null);
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
const Run = struct {
|
const Run = struct {
|
||||||
max_rss: u64,
|
max_rss: u64,
|
||||||
max_rss_is_default: bool,
|
max_rss_is_default: bool,
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ pub const Graph = struct {
|
||||||
needed_lazy_dependencies: std.StringArrayHashMapUnmanaged(void) = .{},
|
needed_lazy_dependencies: std.StringArrayHashMapUnmanaged(void) = .{},
|
||||||
/// Information about the native target. Computed before build() is invoked.
|
/// Information about the native target. Computed before build() is invoked.
|
||||||
host: ResolvedTarget,
|
host: ResolvedTarget,
|
||||||
incremental: ?bool,
|
incremental: ?bool = null,
|
||||||
};
|
};
|
||||||
|
|
||||||
const AvailableDeps = []const struct { []const u8, []const u8 };
|
const AvailableDeps = []const struct { []const u8, []const u8 };
|
||||||
|
|
|
||||||
|
|
@ -603,7 +603,7 @@ fn zigProcessUpdate(s: *Step, zp: *ZigProcess, watch: bool) !?[]const u8 {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn getZigProcess(s: *Step) ?*ZigProcess {
|
pub fn getZigProcess(s: *Step) ?*ZigProcess {
|
||||||
return switch (s.id) {
|
return switch (s.id) {
|
||||||
.compile => s.cast(Compile).?.zig_process,
|
.compile => s.cast(Compile).?.zig_process,
|
||||||
else => null,
|
else => null,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue