From b33b086506ee4c5abf5f3b9ce9f9b86d6ba388c2 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Wed, 23 Dec 2020 16:36:02 +0100 Subject: [PATCH] prometheus: gross hack to fix linker flags for versioning info Apparently the handling of `buildFlagsArray` in `buildGo*` is blatantly broken since it doesn't quote flags specified as list elements properly. Because of that, the `-ldflags` are not interpreted properly and `prometheus --version` doesn't output anything useful. By specifying flags in both `buildFlags` and `buildFlagsArray` the issue gets fixed since both variables are passed to `go install`. --- pkgs/servers/monitoring/prometheus/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/monitoring/prometheus/default.nix b/pkgs/servers/monitoring/prometheus/default.nix index b0de5b271d44..2852fb2afc29 100644 --- a/pkgs/servers/monitoring/prometheus/default.nix +++ b/pkgs/servers/monitoring/prometheus/default.nix @@ -44,10 +44,10 @@ in buildGoPackage rec { ln -s ${webui} web/ui/static/react ''; + buildFlags = "-tags=builtinassets"; buildFlagsArray = let t = "${goPackagePath}/vendor/github.com/prometheus/common/version"; in [ - "-tags=builtinassets" '' -ldflags= -X ${t}.Version=${version}