Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions beacon_chain/buildinfo.nim
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ proc gitFolderExists(path: string): bool {.compileTime.} =
false

const
compileYear = CompileDate[0 ..< 4] # YYYY-MM-DD (UTC)
copyrights* =
"Copyright (c) 2019-" & compileYear & " Status Research & Development GmbH"
compileYear* = CompileDate[0 ..< 4] # YYYY-MM-DD (UTC)

GitRevisionOverride {.strdefine.} = ""

Expand All @@ -40,8 +38,7 @@ template generateGitRevision*(repoPath: string): untyped =
when GitRevisionOverride.len > 0:
static:
doAssert(
GitRevisionOverride.len == 8,
"GitRevisionOverride must consist of 8 characters",
GitRevisionOverride.len == 8, "GitRevisionOverride must consist of 8 characters"
)
doAssert(
GitRevisionOverride.allIt(it in HexDigits),
Expand All @@ -53,9 +50,7 @@ template generateGitRevision*(repoPath: string): untyped =
if gitFolderExists(repoPath):
# only using git if the parent dir is a git repo.
strip(
staticExec(
"git -C " & strutils.escape(repoPath) & " rev-parse --short=8 HEAD"
)
staticExec("git -C " & strutils.escape(repoPath) & " rev-parse --short=8 HEAD")
)
else:
# otherwise we use revision number given by build system.
Expand All @@ -81,5 +76,6 @@ func nimBanner*(): string =

when not defined(nimscript):
import metrics
declareGauge nimVersionGauge, "Nim version info", ["version", "nim_commit"], name = "nim_version"
nimVersionGauge.set(1, labelValues=[NimVersion, getNimGitHash()])
declareGauge nimVersionGauge,
"Nim version info", ["version", "nim_commit"], name = "nim_version"
nimVersionGauge.set(1, labelValues = [NimVersion, getNimGitHash()])
Loading
Loading