Fix zig 0.15.0-dev.1149+4e6a04929 build errors

This commit is contained in:
Arnold Filip
2025-07-21 15:00:15 +02:00
parent 34a7c6c861
commit 9ae739c4c9
2 changed files with 12 additions and 10 deletions

View File

@@ -161,7 +161,8 @@ const CheckNamedStep = struct {
);
defer stderr_file.close();
const stderr = stderr_file.reader();
var buffer: [4096]u8 = undefined;
const stderr = stderr_file.reader(&buffer);
{
// Skip the logo.
const nlines = mem.count(u8, root.logo, "\n");
@@ -213,7 +214,8 @@ const CheckStep = struct {
);
defer stderr_file.close();
const stderr = stderr_file.reader();
var buffer: [4096]u8 = undefined;
const stderr = stderr_file.reader(&buffer);
for (exercises) |ex| {
if (ex.number() == 1) {
// Skip the logo.
@@ -298,7 +300,7 @@ fn check(
}
fn readLine(reader: fs.File.Reader, buf: []u8) !?[]const u8 {
if (try reader.readUntilDelimiterOrEof(buf, '\n')) |line| {
if (try reader.file.deprecatedReader().readUntilDelimiterOrEof(buf, '\n')) |line| {
return mem.trimRight(u8, line, " \r\n");
}
@@ -405,7 +407,8 @@ fn heal(allocator: Allocator, exercises: []const Exercise, work_path: []const u8
/// difference that returns an error when the temp path cannot be created.
pub fn makeTempPath(b: *Build) ![]const u8 {
const rand_int = std.crypto.random.int(u64);
const tmp_dir_sub_path = "tmp" ++ fs.path.sep_str ++ Build.hex64(rand_int);
const rand_hex64 = std.fmt.hex(rand_int);
const tmp_dir_sub_path = "tmp" ++ fs.path.sep_str ++ rand_hex64;
const path = b.cache_root.join(b.allocator, &.{tmp_dir_sub_path}) catch
@panic("OOM");
try b.cache_root.handle.makePath(tmp_dir_sub_path);