mirror of
https://github.com/ziglang/zig.git
synced 2025-12-17 11:43:16 +00:00
Revert "build runner: print to stderr in dumb terminals"
This reverts commit e6f759e1c64668c50d3ff2d02c64a66c871da0ac. I changed my mind. I don't like the output because it makes it harder to find the actual errors in CI logs.
This commit is contained in:
parent
20b35332fe
commit
ba77959137
@ -278,12 +278,8 @@ pub fn main() !void {
|
|||||||
.windows_api => {},
|
.windows_api => {},
|
||||||
}
|
}
|
||||||
|
|
||||||
var progress: std.Progress = .{};
|
var progress: std.Progress = .{ .dont_print_on_dumb = true };
|
||||||
const main_progress_node = progress.start("", 0);
|
const main_progress_node = progress.start("", 0);
|
||||||
if (ttyconf == .no_color) {
|
|
||||||
progress.timer = null;
|
|
||||||
progress.terminal = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
builder.debug_log_scopes = debug_log_scopes.items;
|
builder.debug_log_scopes = debug_log_scopes.items;
|
||||||
builder.resolveInstallPrefix(install_prefix, dir_list);
|
builder.resolveInstallPrefix(install_prefix, dir_list);
|
||||||
@ -306,9 +302,6 @@ pub fn main() !void {
|
|||||||
.enable_summary = enable_summary,
|
.enable_summary = enable_summary,
|
||||||
.ttyconf = ttyconf,
|
.ttyconf = ttyconf,
|
||||||
.stderr = stderr,
|
.stderr = stderr,
|
||||||
|
|
||||||
.step_index = 0,
|
|
||||||
.step_count = undefined,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (run.max_rss == 0) {
|
if (run.max_rss == 0) {
|
||||||
@ -339,9 +332,6 @@ const Run = struct {
|
|||||||
enable_summary: ?bool,
|
enable_summary: ?bool,
|
||||||
ttyconf: std.debug.TTY.Config,
|
ttyconf: std.debug.TTY.Config,
|
||||||
stderr: std.fs.File,
|
stderr: std.fs.File,
|
||||||
|
|
||||||
step_count: usize,
|
|
||||||
step_index: usize,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
fn runStepNames(
|
fn runStepNames(
|
||||||
@ -405,8 +395,7 @@ fn runStepNames(
|
|||||||
{
|
{
|
||||||
defer parent_prog_node.end();
|
defer parent_prog_node.end();
|
||||||
|
|
||||||
run.step_count = step_stack.count();
|
var step_prog = parent_prog_node.start("run steps", step_stack.count());
|
||||||
var step_prog = parent_prog_node.start("run steps", run.step_count);
|
|
||||||
defer step_prog.end();
|
defer step_prog.end();
|
||||||
|
|
||||||
var wait_group: std.Thread.WaitGroup = .{};
|
var wait_group: std.Thread.WaitGroup = .{};
|
||||||
@ -750,27 +739,6 @@ fn workerMakeOneStep(
|
|||||||
sub_prog_node.activate();
|
sub_prog_node.activate();
|
||||||
defer sub_prog_node.end();
|
defer sub_prog_node.end();
|
||||||
|
|
||||||
const stderr = run.stderr;
|
|
||||||
const ttyconf = run.ttyconf;
|
|
||||||
|
|
||||||
// If we are unable to print a fancy terminal progress bar, then we resort
|
|
||||||
// to 1 line printed to stderr for each step, similar to Ninja.
|
|
||||||
if (ttyconf == .no_color) {
|
|
||||||
var buf: [120]u8 = undefined;
|
|
||||||
const step_index = @atomicRmw(usize, &run.step_index, .Add, 1, .Monotonic);
|
|
||||||
const text = std.fmt.bufPrint(&buf, "[{d}/{d}] Making {s}{s}\n", .{
|
|
||||||
step_index + 1, run.step_count, s.owner.dep_prefix, s.name,
|
|
||||||
}) catch |err| switch (err) {
|
|
||||||
error.NoSpaceLeft => blk: {
|
|
||||||
buf[buf.len - 4 ..].* = "...\n".*;
|
|
||||||
break :blk &buf;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
std.debug.getStderrMutex().lock();
|
|
||||||
defer std.debug.getStderrMutex().unlock();
|
|
||||||
stderr.writeAll(text) catch {};
|
|
||||||
}
|
|
||||||
|
|
||||||
const make_result = s.make(&sub_prog_node);
|
const make_result = s.make(&sub_prog_node);
|
||||||
|
|
||||||
// No matter the result, we want to display error/warning messages.
|
// No matter the result, we want to display error/warning messages.
|
||||||
@ -778,6 +746,9 @@ fn workerMakeOneStep(
|
|||||||
sub_prog_node.context.lock_stderr();
|
sub_prog_node.context.lock_stderr();
|
||||||
defer sub_prog_node.context.unlock_stderr();
|
defer sub_prog_node.context.unlock_stderr();
|
||||||
|
|
||||||
|
const stderr = run.stderr;
|
||||||
|
const ttyconf = run.ttyconf;
|
||||||
|
|
||||||
for (s.result_error_msgs.items) |msg| {
|
for (s.result_error_msgs.items) |msg| {
|
||||||
// Sometimes it feels like you just can't catch a break. Finally,
|
// Sometimes it feels like you just can't catch a break. Finally,
|
||||||
// with Zig, you can.
|
// with Zig, you can.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user