| ... | @@ -361,6 +361,7 @@ pub fn addError(step: *Step, comptime fmt: []const u8, args: anytype) error{OutO | ... | @@ -361,6 +361,7 @@ pub fn addError(step: *Step, comptime fmt: []const u8, args: anytype) error{OutO |
| 361 | pub const ZigProcess = struct { | 361 | pub const ZigProcess = struct { |
| 362 | child: std.process.Child, | 362 | child: std.process.Child, |
| 363 | poller: std.io.Poller(StreamEnum), | 363 | poller: std.io.Poller(StreamEnum), |
| | 364 | progress_ipc_fd: if (std.Progress.have_ipc) ?std.posix.fd_t else void, |
| 364 | | 365 | |
| 365 | pub const StreamEnum = enum { stdout, stderr }; | 366 | pub const StreamEnum = enum { stdout, stderr }; |
| 366 | }; | 367 | }; |
| ... | @@ -375,6 +376,7 @@ pub fn evalZigProcess( | ... | @@ -375,6 +376,7 @@ pub fn evalZigProcess( |
| 375 | ) !?[]const u8 { | 376 | ) !?[]const u8 { |
| 376 | if (s.getZigProcess()) |zp| { | 377 | if (s.getZigProcess()) |zp| { |
| 377 | assert(watch); | 378 | assert(watch); |
| | 379 | if (std.Progress.have_ipc) if (zp.progress_ipc_fd) |fd| prog_node.setIpcFd(fd); |
| 378 | return zigProcessUpdate(s, zp, watch); | 380 | return zigProcessUpdate(s, zp, watch); |
| 379 | } | 381 | } |
| 380 | assert(argv.len != 0); | 382 | assert(argv.len != 0); |
| ... | @@ -404,6 +406,7 @@ pub fn evalZigProcess( | ... | @@ -404,6 +406,7 @@ pub fn evalZigProcess( |
| 404 | .stdout = child.stdout.?, | 406 | .stdout = child.stdout.?, |
| 405 | .stderr = child.stderr.?, | 407 | .stderr = child.stderr.?, |
| 406 | }), | 408 | }), |
| | 409 | .progress_ipc_fd = if (std.Progress.have_ipc) child.progress_node.getIpcFd() else {}, |
| 407 | }; | 410 | }; |
| 408 | if (watch) s.setZigProcess(zp); | 411 | if (watch) s.setZigProcess(zp); |
| 409 | defer if (!watch) zp.poller.deinit(); | 412 | defer if (!watch) zp.poller.deinit(); |
| ... | @@ -435,6 +438,8 @@ pub fn evalZigProcess( | ... | @@ -435,6 +438,8 @@ pub fn evalZigProcess( |
| 435 | try handleChildProcessTerm(s, term, null, argv); | 438 | try handleChildProcessTerm(s, term, null, argv); |
| 436 | } | 439 | } |
| 437 | | 440 | |
| | 441 | // This is intentionally printed for failure on the first build but not for |
| | 442 | // subsequent rebuilds. |
| 438 | if (s.result_error_bundle.errorMessageCount() > 0) { | 443 | if (s.result_error_bundle.errorMessageCount() > 0) { |
| 439 | return s.fail("the following command failed with {d} compilation errors:\n{s}", .{ | 444 | return s.fail("the following command failed with {d} compilation errors:\n{s}", .{ |
| 440 | s.result_error_bundle.errorMessageCount(), | 445 | s.result_error_bundle.errorMessageCount(), |