zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit f558c835a41052b7609f0f0b27c5bbc4fe6b024d (tree)
parent 4efeeaac881c5583321e8b385e90f004e99bc3d1
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Tue,  7 Mar 2023 16:59:53 -0700

std.Build.CheckObjectStep: better error message

when reading the file fails

Diffstat:
Mlib/std/Build/CheckObjectStep.zig | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/std/Build/CheckObjectStep.zig b/lib/std/Build/CheckObjectStep.zig @@ -314,14 +314,14 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { const self = @fieldParentPtr(CheckObjectStep, "step", step); const src_path = self.source.getPath(b); - const contents = try fs.cwd().readFileAllocOptions( + const contents = fs.cwd().readFileAllocOptions( gpa, src_path, self.max_bytes, null, @alignOf(u64), null, - ); + ) catch |err| return step.fail("unable to read '{s}': {s}", .{ src_path, @errorName(err) }); const output = switch (self.obj_format) { .macho => try MachODumper.parseAndDump(step, contents, .{