Skip to content

Commit 5d076d2

Browse files
committed
build.zig: don't completely fail if git describe --tags fails
But also, inherit stderr so we can actually see why.
1 parent 96d850a commit 5d076d2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

build.zig

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -287,13 +287,11 @@ fn generateHeaders(b: *std.Build) std.Build.LazyPath {
287287
const version: []const u8 = b.runAllowFail(
288288
&.{ "git", "describe", "--tags" },
289289
&git_exit,
290-
.Ignore,
291-
) catch |err| switch (err) {
292-
error.InvalidExe => version: {
293-
std.log.warn("git not found; leaving version blank", .{});
294-
break :version "";
295-
},
296-
else => std.debug.panic("failed to spawn git: {s}", .{@errorName(err)}),
290+
.Inherit,
291+
) catch |err| v: {
292+
std.log.warn("failed to run git: {s}", .{@errorName(err)});
293+
std.log.warn("using blank version string", .{});
294+
break :v "";
297295
};
298296
const is_canary = b.option(bool, "canary", "Whether this is a canary build of SAR; default true") orelse true;
299297
const demo_sign_pubkey = b.option([]const u8, "demo-sign-pubkey", "The public key to use for demo signing.") orelse "";

0 commit comments

Comments
 (0)