authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-07-03 19:50:33-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-07-07 22:43:53-07:00
log4ccc6f2b5777afd06f0fddbea4e0e0d0c92b007d
tree8b53ece560d6706659b8221a59aa53c661f4dae9
parent64899076624f24025728484ffd6762c94e15173f

compiler: fix remaining build failures


6 files changed, 15 insertions(+), 15 deletions(-)

lib/std/fs/File.zig+5-5
...@@ -1802,10 +1802,10 @@ pub const Writer = struct {...@@ -1802,10 +1802,10 @@ pub const Writer = struct {
1802 }1802 }
1803 const copy_file_range = switch (native_os) {1803 const copy_file_range = switch (native_os) {
1804 .freebsd => std.os.freebsd.copy_file_range,1804 .freebsd => std.os.freebsd.copy_file_range,
1805 .linux => if (std.c.versionCheck(.{ .major = 2, .minor = 27, .patch = 0 })) std.os.linux.wrapped.copy_file_range else void,1805 .linux => if (std.c.versionCheck(.{ .major = 2, .minor = 27, .patch = 0 })) std.os.linux.wrapped.copy_file_range else {},
1806 else => void,1806 else => {},
1807 };1807 };
1808 if (copy_file_range != void) cfr: {1808 if (@TypeOf(copy_file_range) != void) cfr: {
1809 if (w.copy_file_range_err != null) break :cfr;1809 if (w.copy_file_range_err != null) break :cfr;
1810 const buffered = limit.slice(file_reader.interface.buffer);1810 const buffered = limit.slice(file_reader.interface.buffer);
1811 if (io_w.end != 0 or buffered.len != 0) return drain(io_w, &.{buffered}, 1);1811 if (io_w.end != 0 or buffered.len != 0) return drain(io_w, &.{buffered}, 1);
...@@ -1814,7 +1814,7 @@ pub const Writer = struct {...@@ -1814,7 +1814,7 @@ pub const Writer = struct {
1814 const off_in_ptr: ?*i64 = switch (file_reader.mode) {1814 const off_in_ptr: ?*i64 = switch (file_reader.mode) {
1815 .positional_reading, .streaming_reading => return error.Unimplemented,1815 .positional_reading, .streaming_reading => return error.Unimplemented,
1816 .positional => p: {1816 .positional => p: {
1817 off_in = file_reader.pos;1817 off_in = @intCast(file_reader.pos);
1818 break :p &off_in;1818 break :p &off_in;
1819 },1819 },
1820 .streaming => null,1820 .streaming => null,
...@@ -1823,7 +1823,7 @@ pub const Writer = struct {...@@ -1823,7 +1823,7 @@ pub const Writer = struct {
1823 const off_out_ptr: ?*i64 = switch (w.mode) {1823 const off_out_ptr: ?*i64 = switch (w.mode) {
1824 .positional_reading, .streaming_reading => return error.Unimplemented,1824 .positional_reading, .streaming_reading => return error.Unimplemented,
1825 .positional => p: {1825 .positional => p: {
1826 off_out = w.pos;1826 off_out = @intCast(w.pos);
1827 break :p &off_out;1827 break :p &off_out;
1828 },1828 },
1829 .streaming => null,1829 .streaming => null,
src/libs/freebsd.zig+2-2
...@@ -497,13 +497,13 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) anye...@@ -497,13 +497,13 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) anye
497 .lt => continue,497 .lt => continue,
498 .gt => {498 .gt => {
499 // TODO Expose via compile error mechanism instead of log.499 // TODO Expose via compile error mechanism instead of log.
500 log.warn("invalid target FreeBSD libc version: {}", .{target_version});500 log.warn("invalid target FreeBSD libc version: {f}", .{target_version});
501 return error.InvalidTargetLibCVersion;501 return error.InvalidTargetLibCVersion;
502 },502 },
503 }503 }
504 } else blk: {504 } else blk: {
505 const latest_index = metadata.all_versions.len - 1;505 const latest_index = metadata.all_versions.len - 1;
506 log.warn("zig cannot build new FreeBSD libc version {}; providing instead {}", .{506 log.warn("zig cannot build new FreeBSD libc version {f}; providing instead {f}", .{
507 target_version, metadata.all_versions[latest_index],507 target_version, metadata.all_versions[latest_index],
508 });508 });
509 break :blk latest_index;509 break :blk latest_index;
src/libs/glibc.zig+2-2
...@@ -736,13 +736,13 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) anye...@@ -736,13 +736,13 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) anye
736 .lt => continue,736 .lt => continue,
737 .gt => {737 .gt => {
738 // TODO Expose via compile error mechanism instead of log.738 // TODO Expose via compile error mechanism instead of log.
739 log.warn("invalid target glibc version: {}", .{target_version});739 log.warn("invalid target glibc version: {f}", .{target_version});
740 return error.InvalidTargetGLibCVersion;740 return error.InvalidTargetGLibCVersion;
741 },741 },
742 }742 }
743 } else blk: {743 } else blk: {
744 const latest_index = metadata.all_versions.len - 1;744 const latest_index = metadata.all_versions.len - 1;
745 log.warn("zig cannot build new glibc version {}; providing instead {}", .{745 log.warn("zig cannot build new glibc version {f}; providing instead {f}", .{
746 target_version, metadata.all_versions[latest_index],746 target_version, metadata.all_versions[latest_index],
747 });747 });
748 break :blk latest_index;748 break :blk latest_index;
src/libs/netbsd.zig+2-2
...@@ -442,13 +442,13 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) anye...@@ -442,13 +442,13 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) anye
442 .lt => continue,442 .lt => continue,
443 .gt => {443 .gt => {
444 // TODO Expose via compile error mechanism instead of log.444 // TODO Expose via compile error mechanism instead of log.
445 log.warn("invalid target NetBSD libc version: {}", .{target_version});445 log.warn("invalid target NetBSD libc version: {f}", .{target_version});
446 return error.InvalidTargetLibCVersion;446 return error.InvalidTargetLibCVersion;
447 },447 },
448 }448 }
449 } else blk: {449 } else blk: {
450 const latest_index = metadata.all_versions.len - 1;450 const latest_index = metadata.all_versions.len - 1;
451 log.warn("zig cannot build new NetBSD libc version {}; providing instead {}", .{451 log.warn("zig cannot build new NetBSD libc version {f}; providing instead {f}", .{
452 target_version, metadata.all_versions[latest_index],452 target_version, metadata.all_versions[latest_index],
453 });453 });
454 break :blk latest_index;454 break :blk latest_index;
src/link/Lld.zig+1-1
...@@ -294,7 +294,7 @@ fn linkAsArchive(lld: *Lld, arena: Allocator) !void {...@@ -294,7 +294,7 @@ fn linkAsArchive(lld: *Lld, arena: Allocator) !void {
294 break :p try comp.resolveEmitPathFlush(arena, .temp, base.zcu_object_basename.?);294 break :p try comp.resolveEmitPathFlush(arena, .temp, base.zcu_object_basename.?);
295 } else null;295 } else null;
296296
297 log.debug("zcu_obj_path={?}", .{zcu_obj_path});297 log.debug("zcu_obj_path={?f}", .{zcu_obj_path});
298298
299 const compiler_rt_path: ?Cache.Path = if (comp.compiler_rt_strat == .obj)299 const compiler_rt_path: ?Cache.Path = if (comp.compiler_rt_strat == .obj)
300 comp.compiler_rt_obj.?.full_object_path300 comp.compiler_rt_obj.?.full_object_path
src/translate_c.zig+3-3
...@@ -3327,7 +3327,7 @@ fn transConstantExpr(c: *Context, scope: *Scope, expr: *const clang.Expr, used:...@@ -3327,7 +3327,7 @@ fn transConstantExpr(c: *Context, scope: *Scope, expr: *const clang.Expr, used:
3327 return maybeSuppressResult(c, used, as_node);3327 return maybeSuppressResult(c, used, as_node);
3328 },3328 },
3329 else => |kind| {3329 else => |kind| {
3330 return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "unsupported constant expression kind '{f}'", .{kind});3330 return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "unsupported constant expression kind '{}'", .{kind});
3331 },3331 },
3332 }3332 }
3333}3333}
...@@ -5884,9 +5884,9 @@ fn escapeUnprintables(ctx: *Context, m: *MacroCtx) ![]const u8 {...@@ -5884,9 +5884,9 @@ fn escapeUnprintables(ctx: *Context, m: *MacroCtx) ![]const u8 {
5884 if (std.unicode.utf8ValidateSlice(zigified)) return zigified;5884 if (std.unicode.utf8ValidateSlice(zigified)) return zigified;
58855885
5886 const formatter = std.ascii.hexEscape(zigified, .lower);5886 const formatter = std.ascii.hexEscape(zigified, .lower);
5887 const encoded_size = @as(usize, @intCast(std.fmt.count("{fs}", .{formatter})));5887 const encoded_size: usize = @intCast(std.fmt.count("{f}", .{formatter}));
5888 const output = try ctx.arena.alloc(u8, encoded_size);5888 const output = try ctx.arena.alloc(u8, encoded_size);
5889 return std.fmt.bufPrint(output, "{fs}", .{formatter}) catch |err| switch (err) {5889 return std.fmt.bufPrint(output, "{f}", .{formatter}) catch |err| switch (err) {
5890 error.NoSpaceLeft => unreachable,5890 error.NoSpaceLeft => unreachable,
5891 else => |e| return e,5891 else => |e| return e,
5892 };5892 };