From bc370573a8b8b9dd2ec15623efd98d445220a568 Mon Sep 17 00:00:00 2001 From: Ben Buhse Date: Wed, 25 Feb 2026 16:12:44 -0600 Subject: [PATCH] Return an error if b.findProgram errors instead of just skipping --- build.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build.zig b/build.zig index 103fd7d..470f99e 100644 --- a/build.zig +++ b/build.zig @@ -5,7 +5,7 @@ const std = @import("std"); const Scanner = @import("wayland").Scanner; -pub fn build(b: *std.Build) void { +pub fn build(b: *std.Build) !void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); @@ -17,7 +17,10 @@ pub fn build(b: *std.Build) void { "Set to true to build man pages. Requires scdoc. Defaults to true if scdoc is found.", ) orelse scdoc_found: { // Default to true if scdoc is available; else false. - _ = b.findProgram(&.{"scdoc"}, &.{}) catch break :scdoc_found false; + _ = b.findProgram(&.{"scdoc"}, &.{}) catch |err| switch (err) { + error.FileNotFound => break :scdoc_found false, + else => return err, + }; break :scdoc_found true; };