diff --git a/build.zig.zon b/build.zig.zon index 7c331bd..43eb8d6 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -7,8 +7,8 @@ .dependencies = .{ .mustache = .{ - .url = "git+https://github.com/batiati/mustache-zig?ref=master#822933184fb0cbc8e692e9c73618deb2b0b8108c", - .hash = "122008747b05328191a1b3c2a83520b82f11e87ae12e2cc8f92305792203802a0b02", + .url = "git+https://github.com/batiati/mustache-zig?ref=master#7046270199f68eae32a9e79f3933088621f27d24", + .hash = "12201f5bda90b5de1915dc60da9cf1cd846d79a36c2e1313aa467462fa985f117bcc", }, }, .paths = .{ diff --git a/share/build_runners/live.zig b/share/build_runners/live.zig index d175ece..998e9a5 100644 --- a/share/build_runners/live.zig +++ b/share/build_runners/live.zig @@ -563,7 +563,7 @@ fn prepare( } // Just to make diff'ing easier. - // Synced with Zig build runner, version 0.14.0-dev.2052+6a364b4a5 . + // Synced with Zig build runner, version 0.14.0-dev.3018+c0d85cda5 . if (true) return zig_ebuilder_section: { const Report = @import("Report.zig"); @@ -856,7 +856,7 @@ fn runStepNames( if (run.prominent_compile_errors and total_compile_errors > 0) { for (step_stack.keys()) |s| { if (s.result_error_bundle.errorMessageCount() > 0) { - s.result_error_bundle.renderToStdErr(renderOptions(ttyconf)); + s.result_error_bundle.renderToStdErr(.{ .ttyconf = ttyconf, .include_reference_trace = (b.reference_trace orelse 0) > 0 }); } } @@ -1235,7 +1235,11 @@ fn workerMakeOneStep( defer std.debug.unlockStdErr(); const gpa = b.allocator; - printErrorMessages(gpa, s, run.ttyconf, run.stderr, run.prominent_compile_errors) catch {}; + const options: std.zig.ErrorBundle.RenderOptions = .{ + .ttyconf = run.ttyconf, + .include_reference_trace = (b.reference_trace orelse 0) > 0, + }; + printErrorMessages(gpa, s, options, run.stderr, run.prominent_compile_errors) catch {}; } handle_result: { @@ -1291,7 +1295,7 @@ fn workerMakeOneStep( pub fn printErrorMessages( gpa: Allocator, failing_step: *Step, - ttyconf: std.io.tty.Config, + options: std.zig.ErrorBundle.RenderOptions, stderr: File, prominent_compile_errors: bool, ) !void { @@ -1306,6 +1310,7 @@ pub fn printErrorMessages( } // Now, `step_stack` has the subtree that we want to print, in reverse order. + const ttyconf = options.ttyconf; try ttyconf.setColor(stderr, .dim); var indent: usize = 0; while (step_stack.popOrNull()) |s| : (indent += 1) { @@ -1331,8 +1336,9 @@ pub fn printErrorMessages( } } - if (!prominent_compile_errors and failing_step.result_error_bundle.errorMessageCount() > 0) - try failing_step.result_error_bundle.renderToWriter(renderOptions(ttyconf), stderr.writer()); + if (!prominent_compile_errors and failing_step.result_error_bundle.errorMessageCount() > 0) { + try failing_step.result_error_bundle.renderToWriter(options, stderr.writer()); + } for (failing_step.result_error_msgs.items) |msg| { try ttyconf.setColor(stderr, .red); @@ -1533,14 +1539,6 @@ fn get_tty_conf(color: Color, stderr: File) std.io.tty.Config { }; } -fn renderOptions(ttyconf: std.io.tty.Config) std.zig.ErrorBundle.RenderOptions { - return .{ - .ttyconf = ttyconf, - .include_source_line = ttyconf != .no_color, - .include_reference_trace = ttyconf != .no_color, - }; -} - fn fatalWithHint(comptime f: []const u8, args: anytype) noreturn { std.debug.print(f ++ "\n access the help menu with 'zig build -h'\n", args); process.exit(1);