Skip to content

Commit a59ad71

Browse files
committed
std.Build.Step.ConfigHeader: better error message
1 parent 54d1a52 commit a59ad71

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/std/Build/Step/ConfigHeader.zig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,11 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {
193193
.autoconf => |file_source| {
194194
try output.appendSlice(c_generated_line);
195195
const src_path = file_source.getPath(b);
196-
const contents = try std.fs.cwd().readFileAlloc(arena, src_path, self.max_bytes);
196+
const contents = std.fs.cwd().readFileAlloc(arena, src_path, self.max_bytes) catch |err| {
197+
return step.fail("unable to read autoconf input file '{s}': {s}", .{
198+
src_path, @errorName(err),
199+
});
200+
};
197201
try render_autoconf(step, contents, &output, self.values, src_path);
198202
},
199203
.cmake => |file_source| {

0 commit comments

Comments
 (0)