build.zig:172:50: error: expected type '[]const u8', found 'Build.LazyPath'
options.addOption([]const u8, "git_version", git_version);
There is another way to do it, get the git command to output to a file and then @embedFile to get the string value, but I think my current approach is cleaner.
We do std.mem.trimRight(u8, b.run(&.{ "git", "rev-parse", "--verify", "HEAD" }), "\n") which means git rev-parse is run on every configure, which is not great in theory, but ok in practice.
The neat way to do this is to depend on ./git/logs/HEAD:
Otherwise, I don’t think there’s an automatic way to do what you want to do here, but it is possible by writing your own Options step.