Skip to content

Commit 7950f46

Browse files
committed
build: Don't check parent directories for git tag
Sometimes zls 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 zls, and not of a parent directory.
1 parent fedbf31 commit 7950f46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

build.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ fn getVersion(b: *Build) std.SemanticVersion {
322322
if (zls_version.pre == null and zls_version.build == null) return zls_version;
323323

324324
const argv: []const []const u8 = &.{
325-
"git", "-C", b.pathFromRoot("."), "describe", "--match", "*.*.*", "--tags",
325+
"git", "-C", b.pathFromRoot("."), "--git-dir", ".git", "describe", "--match", "*.*.*", "--tags",
326326
};
327327
var code: u8 = undefined;
328328
const git_describe_untrimmed = b.runAllowFail(argv, &code, .Ignore) catch |err| {

0 commit comments

Comments
 (0)