Skip to content

Commit

Permalink
std.Build.Step.ConfigHeader: better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed Apr 13, 2024
1 parent 54d1a52 commit a59ad71
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/std/Build/Step/ConfigHeader.zig
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,11 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {
.autoconf => |file_source| {
try output.appendSlice(c_generated_line);
const src_path = file_source.getPath(b);
const contents = try std.fs.cwd().readFileAlloc(arena, src_path, self.max_bytes);
const contents = std.fs.cwd().readFileAlloc(arena, src_path, self.max_bytes) catch |err| {
return step.fail("unable to read autoconf input file '{s}': {s}", .{
src_path, @errorName(err),
});
};
try render_autoconf(step, contents, &output, self.values, src_path);
},
.cmake => |file_source| {
Expand Down

0 comments on commit a59ad71

Please sign in to comment.