New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version info is not compiled into binary #24
Comments
Verified that it works if adding the ldflags. Then the question is how to do this in a reasonable way - the commandline becomes long enough that it is not something you'd want to write yourself. The first solution that comes to mind is using promu, since that is used to build a lot of other things in the Prometheus ecosystem. Sadly, the windows support isn't that good. I've put a few hours on trying to fix it, but it is not all that simple (dependent libraries that basically only work on linux). Another common approach is having a Makefile, but since this is quite a Windows oriented repo, I'm unsure if it is a good idea. I've had quite bad experiences with make on Windows, at least. Third option is to just write some simple build script. @martinlindhe Any strong opinions in this? |
Something might be missing, but the prometheus hookup is this stuff: https://github.com/martinlindhe/wmi_exporter/blob/master/exporter.go#L109
Personally I'm a Makefile lover, so that works for me. (using http://scoop.sh, which packages http://www.equation.com/servlet/equation.cmd?fa=make myself) Also, option 3: write a build script works for me. Assuming it must be written in powershell. |
The magic is supposed to happen here: https://github.com/prometheus/common/blob/master/version/info.go#L27. Building with After messing about with it a bit more, I think |
I did a bit of testing to set everything directly in the AppVeyor config, which was not a pleasurable experience. I'll do a bit more hacking on promu and see if that is feasible |
Had a look too If one add a VERSION containing
then run $ promu build -v . edit the output command, which fails silently and remove the
|
Also @carlpett reported issue upstream: prometheus/promu#44 |
The problem as far as I understand is the |
Yep. working on a patch for promu that removes much of dependency of go-shell. |
Regarding output, the -v switch to promu should enable verbose output. |
Ah, you too? :) I'm probably not going to have time to do any more work on my patch until the weekend anyway, though, so if you're on it that is great! |
Related: #32 |
Sorry if i caused extra work, I should have asked for your progress before starting on this. |
No worries, and great work! |
Created a final pr #35 to make use of the version info by using promu in appveyor.yml |
Noticed that version info is not compiled into the binary, so log lines don't show much. I'm guessing we're not doing all the things that is expected from prometheus/common? Since most prometheus tools use promu, maybe there is some magic there? For instance, the promu.yml file adds some ldflags: https://github.com/prometheus/promu/blob/master/.promu.yml
The text was updated successfully, but these errors were encountered: