Skip to content

Commit 04b3acf

Browse files
committed
restore useful compiler errors on dumb terminals
This reverts a part of 7cc4a69, and fixes ziglang#16376. While the "correct" behavior on dumb terminals is still to be determined, this is arguably a major regression from 0.10.0 to 0.11.0, leaving users of various tools and CI platforms without any useful build logs. This change mirrors the behavior of basically every other compiler out there, which is to just not color the output (done implicitly in `std.io.tty`). Of course, the idea for machine-readable compiler errors still has merit, and with things like the to-be-implemented Zig compiler server [0] and ZLS, there are just better ways to go about it than to print somewhat useless error messages that a good portion of users will see. [0]: ziglang#615
1 parent 4f952c7 commit 04b3acf

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

lib/build_runner.zig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,5 @@ fn get_tty_conf(color: Color, stderr: std.fs.File) std.io.tty.Config {
10641064
fn renderOptions(ttyconf: std.io.tty.Config) std.zig.ErrorBundle.RenderOptions {
10651065
return .{
10661066
.ttyconf = ttyconf,
1067-
.include_source_line = ttyconf != .no_color,
1068-
.include_reference_trace = ttyconf != .no_color,
10691067
};
10701068
}

src/main.zig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6369,8 +6369,6 @@ fn renderOptions(color: Color) std.zig.ErrorBundle.RenderOptions {
63696369
const ttyconf = get_tty_conf(color);
63706370
return .{
63716371
.ttyconf = ttyconf,
6372-
.include_source_line = ttyconf != .no_color,
6373-
.include_reference_trace = ttyconf != .no_color,
63746372
};
63756373
}
63766374

0 commit comments

Comments
 (0)