aboutsummaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-12-18 14:43:07 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-12-19 00:54:48 -0800
commitf545fc28b35b454b2b0167ede45aeacc0cd93387 (patch)
tree4c71ae6e0cc5ffa16c2eb14a9f8c166524c2bf06 /build.zig
parent90a19f74116eb09e4711d845d08c011cb62b8cbf (diff)
downloadzig-f545fc28b35b454b2b0167ede45aeacc0cd93387.tar.gz
zig-f545fc28b35b454b2b0167ede45aeacc0cd93387.zip
build: pass --abbrev to git rather than relying on global config
For computing the zig version number, pass --abbrev=9 rather than requiring the user to set their git configuration in order to make zig versions match the standard.
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig9
1 files changed, 8 insertions, 1 deletions
diff --git a/build.zig b/build.zig
index 19721764f3..11b3006039 100644
--- a/build.zig
+++ b/build.zig
@@ -263,7 +263,14 @@ pub fn build(b: *std.Build) !void {
var code: u8 = undefined;
const git_describe_untrimmed = b.runAllowFail(&[_][]const u8{
- "git", "-C", b.build_root.path orelse ".", "describe", "--match", "*.*.*", "--tags",
+ "git",
+ "-C",
+ b.build_root.path orelse ".",
+ "describe",
+ "--match",
+ "*.*.*",
+ "--tags",
+ "--abbrev=9",
}, &code, .Ignore) catch {
break :v version_string;
};