diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-04-12 23:21:04 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-04-13 05:14:08 -0700 |
| commit | a59ad719d2b838846ffd5ea77e06322b5427b4e5 (patch) | |
| tree | cb608287a42dadcb889ed5c4f25147c45719583e /lib/std/Build/Step/ConfigHeader.zig | |
| parent | 54d1a529f652cf79bf9edc95463380c5c853e4db (diff) | |
| download | zig-a59ad719d2b838846ffd5ea77e06322b5427b4e5.tar.gz zig-a59ad719d2b838846ffd5ea77e06322b5427b4e5.zip | |
std.Build.Step.ConfigHeader: better error message
Diffstat (limited to 'lib/std/Build/Step/ConfigHeader.zig')
| -rw-r--r-- | lib/std/Build/Step/ConfigHeader.zig | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/std/Build/Step/ConfigHeader.zig b/lib/std/Build/Step/ConfigHeader.zig index d774994872..2aa40175fb 100644 --- a/lib/std/Build/Step/ConfigHeader.zig +++ b/lib/std/Build/Step/ConfigHeader.zig @@ -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| { |
