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`.
commitb33b086506ee4c5abf5f3b9ce9f9b86d6ba388c2
authorMaximilian Bosch <maximilian@mbosch.me>
dateWed 23 Dec 2020, 16:36 (6 years ago)
parent5a26fb3
pkgs/servers/monitoring/prometheus/default.nix+1−1
@@ -44,10 +44,10 @@ in buildGoPackage rec {
4444 ln -s ${webui} web/ui/static/react
4545 '';
4646
47+ buildFlags = "-tags=builtinassets";
4748 buildFlagsArray = let
4849 t = "${goPackagePath}/vendor/github.com/prometheus/common/version";
4950 in [
50− "-tags=builtinassets"
5151 ''
5252 -ldflags=
5353 -X ${t}.Version=${version}