Skip to content

Commit 26fc4fd

Browse files
committed
Update for new zig IO
`test/tests.zig` fails after ziglang/zig#25592 was merged in. This just ensures that Io is passed, it might not be the ideal solution. `build.zig` was also failing due to new color parameter.
1 parent 7ad02b0 commit 26fc4fd

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

build.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -570,12 +570,12 @@ const ZiglingStep = struct {
570570

571571
// Render compile errors at the bottom of the terminal.
572572
// TODO: use the same ttyconf from the builder.
573-
const ttyconf: std.Io.tty.Config = if (use_color_escapes)
574-
.escape_codes
573+
const color: std.zig.Color = if (use_color_escapes)
574+
.on
575575
else
576-
.no_color;
576+
.off;
577577
if (self.step.result_error_bundle.errorMessageCount() > 0) {
578-
self.step.result_error_bundle.renderToStdErr(.{ .ttyconf = ttyconf });
578+
self.step.result_error_bundle.renderToStdErr(.{}, color);
579579
}
580580
}
581581
};

test/tests.zig

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ const CheckNamedStep = struct {
161161
);
162162
defer stderr_file.close();
163163

164-
var stderr = stderr_file.readerStreaming(&.{});
164+
var threaded: std.Io.Threaded = .init_single_threaded;
165+
const io = threaded.io();
166+
var stderr = stderr_file.readerStreaming(io, &.{});
165167
{
166168
// Skip the logo.
167169
const nlines = mem.count(u8, root.logo, "\n");
@@ -213,7 +215,9 @@ const CheckStep = struct {
213215
);
214216
defer stderr_file.close();
215217

216-
var stderr = stderr_file.readerStreaming(&.{});
218+
var threaded: std.Io.Threaded = .init_single_threaded;
219+
const io = threaded.io();
220+
var stderr = stderr_file.readerStreaming(io, &.{});
217221
for (exercises) |ex| {
218222
if (ex.number() == 1) {
219223
// Skip the logo.

0 commit comments

Comments
 (0)