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
commit d749c8cd87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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})