Bug 225430 - net-mgmt/prometheus: Fix build info
Summary: net-mgmt/prometheus: Fix build info
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Brad Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-24 15:14 UTC by David O'Rourke
Modified: 2018-02-01 22:00 UTC (History)
2 users (show)

See Also:
ports: maintainer-feedback+


Attachments
net-mgmt/prometheus: build info fix (1.31 KB, patch)
2018-01-24 15:14 UTC, David O'Rourke
no flags Details | Diff
net-mgmt/prometheus: build info fix (1.25 KB, patch)
2018-01-24 15:40 UTC, David O'Rourke
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David O'Rourke 2018-01-24 15:14:43 UTC
Created attachment 190031 [details]
net-mgmt/prometheus: build info fix

This patch fixes the build info found under `prometheus --version` and under /status on a running instance.

Before:

$ prometheus --version
prometheus, version  (branch: , revision: )
  build user:
  build date:
  go version:       go1.9.2

After:

prometheus, version 1.8.2 (branch: release-1.8, revision: 0)
  build user:       dor
  build date:       20180824-15:08:26
  go version:       go1.9.2
Comment 1 jevonearth 2018-01-24 15:26:41 UTC
I David,

I'm all for this patch, but I was told not to do this at build time because it makes problems for re-producible builds. It has my approval, but check that it is copacetic with reproducible builds.

Here's a link to my past exchange on the matter: https://lists.freebsd.org/pipermail/freebsd-ports/2017-March/107833.html
Comment 2 David O'Rourke 2018-01-24 15:40:09 UTC
Created attachment 190034 [details]
net-mgmt/prometheus: build info fix

How about this version?

This patch gets rid of the BuildDate, because that's tricky and it's correct that forking to get it isn't great.

For the BuildUser, I've put it behind a `BUILD_USER?=` variable which defaults to `${USER}`. This allows the user to specify it when they build the package if they happen to be building as a user that differs from the upstream build user.

The Version, Revision, and Branch variables are hopefully not an issue, as they're based on other settings within the Makefile.
Comment 3 jevonearth 2018-01-24 15:41:14 UTC
LGTM!
Comment 4 commit-hook freebsd_committer freebsd_triage 2018-02-01 21:54:53 UTC
A commit references this bug:

Author: brd
Date: Thu Feb  1 21:54:26 UTC 2018
New revision: 460640
URL: https://svnweb.freebsd.org/changeset/ports/460640

Log:
  net-mgmt/prometheus: Fix build info

  PR:		225430
  Submitted by:	David O'Rourke <dor.bsd@xm0.uk>
  Approved by:	ports@ecadlabs.com (maintainer)

Changes:
  head/net-mgmt/prometheus/Makefile
Comment 5 Brad Davis freebsd_committer freebsd_triage 2018-02-01 22:00:21 UTC
Committed with a couple of small changes, like bumping PORTREVISION.

Thanks!