From e6b6a728b36335d9ac32dd216082aaf1faa6327e Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 9 Jul 2024 20:06:56 -0700 Subject: [PATCH] build runner: fix build summary painting over CLI progress by obtaining the stderr lock when printing the build summary --- lib/compiler/build_runner.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/compiler/build_runner.zig b/lib/compiler/build_runner.zig index ea1cfda266..7cc3d2bcd7 100644 --- a/lib/compiler/build_runner.zig +++ b/lib/compiler/build_runner.zig @@ -682,9 +682,12 @@ fn runStepNames( } const ttyconf = run.ttyconf; - const stderr = run.stderr; if (run.summary != .none) { + std.debug.lockStdErr(); + defer std.debug.unlockStdErr(); + const stderr = run.stderr; + const total_count = success_count + failure_count + pending_count + skipped_count; ttyconf.setColor(stderr, .cyan) catch {}; stderr.writeAll("Build Summary:") catch {};