diff --git a/nix/tools/utils.nix b/nix/tools/utils.nix index cab5d30809..486a035dc9 100644 --- a/nix/tools/utils.nix +++ b/nix/tools/utils.nix @@ -48,14 +48,14 @@ let # paths don't like slashes in them dropSlashes = builtins.replaceStrings [ "/" ] [ "_" ]; - # if version doesn't match this it's probably a commit - versionRegex = "^v?[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+(-[[:alnum:].]+)?$"; + # if version doesn't match this it's probably a commit, it's lax semver + versionRegex = "^v?[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+[[:alnum:]_.-]*$"; sanitizeVersion = version: if (builtins.match versionRegex version) != null # Geth forces a 'v' prefix for all versions then lib.removePrefix "v" (dropSlashes version) # reduce metrics cardinality in Prometheus - else "develop"; + else lib.traceValFn (v: "WARNING: Marking build version as 'develop'!") "develop"; in { inherit sanitizeVersion