authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-06-16 19:28:13-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-06-16 19:28:13-07:00
log42658de76287ecd24691d774232c5ec07107a0ee
treee0189cd022c8f5da1330aa0d6bbc8d7ac7ae24b1
parent20e20f9238b1f4537a8186d80afbdf7516e127f6

std.process.Child: `run` fn accepts std.Progress.Node

There was not a way to pass a progress node to this function until now.

1 files changed, 3 insertions(+), 1 deletions(-)

lib/std/process/Child.zig+3-1
......@@ -101,7 +101,7 @@ resource_usage_statistics: ResourceUsageStatistics = .{},
101101///
102102/// The child's progress tree will be grafted into the parent's progress tree,
103103/// by substituting this node with the child's root node.
104progress_node: std.Progress.Node = .{ .index = .none },
104progress_node: std.Progress.Node = std.Progress.Node.none,
105105
106106pub const ResourceUsageStatistics = struct {
107107 rusage: @TypeOf(rusage_init) = rusage_init,
......@@ -376,6 +376,7 @@ pub fn run(args: struct {
376376 env_map: ?*const EnvMap = null,
377377 max_output_bytes: usize = 50 * 1024,
378378 expand_arg0: Arg0Expand = .no_expand,
379 progress_node: std.Progress.Node = std.Progress.Node.none,
379380}) RunError!RunResult {
380381 var child = ChildProcess.init(args.argv, args.allocator);
381382 child.stdin_behavior = .Ignore;
......@@ -385,6 +386,7 @@ pub fn run(args: struct {
385386 child.cwd_dir = args.cwd_dir;
386387 child.env_map = args.env_map;
387388 child.expand_arg0 = args.expand_arg0;
389 child.progress_node = args.progress_node;
388390
389391 var stdout = std.ArrayList(u8).init(args.allocator);
390392 var stderr = std.ArrayList(u8).init(args.allocator);