From 21620f3c652bc874776acc7251f05b25d2838019 Mon Sep 17 00:00:00 2001 From: LN Liberda Date: Fri, 7 Mar 2025 18:20:46 +0100 Subject: [PATCH] build: Don't check parent directories for git tag Sometimes Zig is built not from a git repository (e.g. from tarball), but inside another git repository (e.g. distro package repository). Make sure that the version check tries to parse a tag of Zig, and not of a parent directory. --- build.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.zig b/build.zig index 9a52a35275..c8056295e9 100644 --- a/build.zig +++ b/build.zig @@ -259,6 +259,8 @@ pub fn build(b: *std.Build) !void { "git", "-C", b.build_root.path orelse ".", + "--git-dir", + ".git", "describe", "--match", "*.*.*",