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`.
This commit is contained in:
Maximilian Bosch 2020-12-23 16:36:02 +01:00
parent 5a26fb3c98
commit b33b086506
No known key found for this signature in database
GPG key ID: 091DBF4D1FC46B8E

View file

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