compiler/commands: make gitHash settable at compile-time. (#14654)

This is useful for building nightlies, since we will be building from a
generated source archive and git metadata is lost there.
This commit is contained in:
alaviss
2020-06-14 04:22:55 -05:00
committed by GitHub
parent 4e3edf5836
commit d749c8cd87

View File

@@ -98,7 +98,7 @@ proc writeVersionInfo(conf: ConfigRef; pass: TCmdLinePass) =
CPU[conf.target.hostCPU].name, CompileDate]),
{msgStdout})
const gitHash = gorge("git log -n 1 --format=%H").strip
const gitHash {.strdefine.} = gorge("git log -n 1 --format=%H").strip
when gitHash.len == 40:
msgWriteln(conf, "git hash: " & gitHash, {msgStdout})