Differences when using `make` V `port test`

Jev Bjorsell jev at ecadlabs.com
Thu Sep 22 21:49:32 UTC 2016


Hi All,

Noob porter here. :)

I created a port for prometheus, and opened a ticket here:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212468

On the advice of Kubilay, I ran `port test`, and this leads me to my
question;

When running `port test` the build binaries are not found, (logs below),
but when doing a simple `make install` everything works fine, and I can see
the binaries in the work/ directory also.
I suspect that the pormetheus build process is doing something a little
magic, but I'm lookin to understand why the build behaves differently under
`port test` compared to a straight `make`.

Logs from both `port test` and `make` follow.

Thanks,
Jev


output from `port test`

 jev at futz  /usr/ports/net-mgmt/prometheus  port test
===> Using ports tree /usr/ports
===> Validating port with portlint
WARN: Makefile: [43]: whitespace before end of line.
0 fatal errors and 1 warning found.
===> flags: PREFIX=/tmp/prometheus-1.1.3 NO_DEPENDS=yes
PKG_DBDIR=/tmp/pkg_db.bZyp4Q3g PORTSDIR=/usr/ports --
===> Cleaning workspace before port test
===>  Cleaning for prometheus-1.1.3
===>  License APACHE20 accepted by the user
===> Fetching all distfiles required by prometheus-1.1.3 for building
===>  Extracting for prometheus-1.1.3
=> SHA256 Checksum OK for prometheus-prometheus-v1.1.3_GH0.tar.gz.
===>  Patching for prometheus-1.1.3
===>  Applying FreeBSD patches for prometheus-1.1.3
===>  Configuring for prometheus-1.1.3
===>  Building for prometheus-1.1.3
(cd /usr/ports.svn/net-mgmt/prometheus/work/src/
github.com/prometheus/prometheus ; /usr/bin/env
GOPATH="/usr/ports.svn/net-mgmt/prometheus/work:/usr/local/share/go"
 CGO_CFLAGS="-I/usr/local/include"  CGO_LDFLAGS="-L/usr/local/lib"
 GOBIN="" PREFIX=/usr/ports.svn/net-mgmt/prometheus/work/src/
github.com/prometheus/prometheus gmake build)
gmake[1]: Entering directory
'/usr/ports.svn/net-mgmt/prometheus/work/prometheus-1.1.3'
>> building binaries
Using config file: /usr/ports.svn/net-mgmt/prometheus/work/src/
github.com/prometheus/prometheus/.promu.yml
 >   prometheus
+ go build -a -tags netgo -ldflags "-X
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/version.Version=1.1.3
-X
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/version.Revision=
-X
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/version.Branch=
-X
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/version.BuildUser=jev at futz
-X
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/version.BuildDate=20160922-21:22:42
 -extldflags "-static"" -o /tmp/prometheus-1.1.3/prometheus
github.com/prometheus/prometheus/cmd/prometheus
 >   promtool
+ go build -a -tags netgo -ldflags "-X
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/version.Version=1.1.3
-X
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/version.Revision=
-X
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/version.Branch=
-X
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/version.BuildUser=jev at futz
-X
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/version.BuildDate=20160922-21:22:42
 -extldflags "-static"" -o /tmp/prometheus-1.1.3/promtool
github.com/prometheus/prometheus/cmd/promtool
gmake[1]: Leaving directory
'/usr/ports.svn/net-mgmt/prometheus/work/prometheus-1.1.3'
===>  Staging for prometheus-1.1.3
===>   Generating temporary packing list
===> Creating groups.
===> Creating users
install   -m 555
/usr/ports.svn/net-mgmt/prometheus/work/prometheus-1.1.3/promtool
/usr/ports.svn/net-mgmt/prometheus/work/stage/tmp/prometheus-1.1.3/bin
install: /usr/ports.svn/net-mgmt/prometheus/work/prometheus-1.1.3/promtool:
No such file or directory
*** Error code 71

Stop.
make: stopped in /usr/ports.svn/net-mgmt/prometheus
===> Error running make stage
===> Cleaning up
 ✘ jev at futz  /usr/ports/net-mgmt/prometheus 



output from just make;

 jev at futz  /usr/ports/net-mgmt/prometheus  sudo make
===>  License APACHE20 accepted by the user
===>   prometheus-1.1.3 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by prometheus-1.1.3 for building
===>  Extracting for prometheus-1.1.3
=> SHA256 Checksum OK for prometheus-prometheus-v1.1.3_GH0.tar.gz.
===>  Patching for prometheus-1.1.3
===>  Applying FreeBSD patches for prometheus-1.1.3
===>   prometheus-1.1.3 depends on file: /usr/local/bin/go - found
===>   prometheus-1.1.3 depends on executable: gmake - found
===>  Configuring for prometheus-1.1.3
===>  Building for prometheus-1.1.3
(cd /usr/ports.svn/net-mgmt/prometheus/work/src/
github.com/prometheus/prometheus ; /usr/bin/env
GOPATH="/usr/ports.svn/net-mgmt/prometheus/work:/usr/local/share/go"
 CGO_CFLAGS="-I/usr/local/include"  CGO_LDFLAGS="-L/usr/local/lib"
 GOBIN="" PREFIX=/usr/ports.svn/net-mgmt/prometheus/work/src/
github.com/prometheus/prometheus gmake build)
gmake[1]: Entering directory
'/usr/ports.svn/net-mgmt/prometheus/work/prometheus-1.1.3'
>> building binaries
Using config file: /usr/ports.svn/net-mgmt/prometheus/work/src/
github.com/prometheus/prometheus/.promu.yml
 >   prometheus
+ go build -a -tags netgo -ldflags "-X
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/version.Version=1.1.3
-X
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/version.Revision=
-X
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/version.Branch=
-X
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/version.BuildUser=root at futz
-X
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/version.BuildDate=20160922-21:38:29
 -extldflags "-static"" -o /usr/ports.svn/net-mgmt/prometheus/work/src/
github.com/prometheus/prometheus/prometheus
github.com/prometheus/prometheus/cmd/prometheus
 >   promtool
+ go build -a -tags netgo -ldflags "-X
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/version.Version=1.1.3
-X
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/version.Revision=
-X
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/version.Branch=
-X
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/version.BuildUser=root at futz
-X
github.com/prometheus/prometheus/vendor/github.com/prometheus/common/version.BuildDate=20160922-21:38:29
 -extldflags "-static"" -o /usr/ports.svn/net-mgmt/prometheus/work/src/
github.com/prometheus/prometheus/promtool
github.com/prometheus/prometheus/cmd/promtool
gmake[1]: Leaving directory
'/usr/ports.svn/net-mgmt/prometheus/work/prometheus-1.1.3'
===>  Staging for prometheus-1.1.3
===>   Generating temporary packing list
===> Creating groups.
===> Creating users
install   -m 555
/usr/ports.svn/net-mgmt/prometheus/work/prometheus-1.1.3/promtool
/usr/ports.svn/net-mgmt/prometheus/work/stage/usr/local/bin
install   -m 555
/usr/ports.svn/net-mgmt/prometheus/work/prometheus-1.1.3/prometheus
/usr/ports.svn/net-mgmt/prometheus/work/stage/usr/local/bin
install  -m 0644
/usr/ports.svn/net-mgmt/prometheus/work/prometheus-1.1.3/documentation/examples/prometheus.yml
/usr/ports.svn/net-mgmt/prometheus/work/stage/usr/local/etc
====> Compressing man pages (compress-man)
===> Staging rc.d startup script(s)
====> Running Q/A tests (stage-qa)
 jev at futz  /usr/ports/net-mgmt/prometheus  ls -al
work/prometheus-1.1.3/{promtool,prometheus}
-rwxr-xr-x  1 root  wheel  24839631 Sep 22 21:39
work/prometheus-1.1.3/prometheus
-rwxr-xr-x  1 root  wheel  10068258 Sep 22 21:40
work/prometheus-1.1.3/promtool
 jev at futz  /usr/ports/net-mgmt/prometheus 


More information about the freebsd-ports mailing list