authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2024-03-09 17:47:56-08:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2024-03-11 05:06:17-07:00
logc32e0d3000f4ee539c00577b75e18c683e84f2c4
treef842da57cacd61decee1cdd400dbe4db64eff8f3
parentb16890e6ddb451301f09029e3b0649168dc53918

Fix progress when multiple zig rc child processes are building resinator


2 files changed, 11 insertions(+), 5 deletions(-)

lib/compiler/resinator/main.zig+2-2
......@@ -47,9 +47,9 @@ pub fn main() !void {
4747 };
4848
4949 if (zig_integration) {
50 // Send progress with an empty string to indicate that the building of the
50 // Send progress with a special string to indicate that the building of the
5151 // resinator binary is finished and we've moved on to actually compiling the .rc file
52 try error_handler.server.serveStringMessage(.progress, "");
52 try error_handler.server.serveStringMessage(.progress, "<resinator>");
5353 }
5454
5555 var options = options: {
src/Compilation.zig+9-3
......@@ -5042,12 +5042,18 @@ fn spawnZigRc(
50425042 },
50435043 .progress => {
50445044 node_name.clearRetainingCapacity();
5045 if (body.len > 0) {
5045 // <resinator> is a special string that indicates that the child
5046 // process has reached resinator's main function
5047 if (std.mem.eql(u8, body, "<resinator>")) {
5048 child_progress_node.setName(src_basename);
5049 }
5050 // Ignore 0-length strings since if multiple zig rc commands
5051 // are executed at the same time, only one will send progress strings
5052 // while the other(s) will send empty strings.
5053 else if (body.len > 0) {
50465054 try node_name.appendSlice(arena, "build 'zig rc'... ");
50475055 try node_name.appendSlice(arena, body);
50485056 child_progress_node.setName(node_name.items);
5049 } else {
5050 child_progress_node.setName(src_basename);
50515057 }
50525058 },
50535059 else => {}, // ignore other messages