node_exporter icon indicating copy to clipboard operation
node_exporter copied to clipboard

Release FreeBSD binaries

Open SuperQ opened this issue 5 years ago • 12 comments

We closed https://github.com/prometheus/node_exporter/issues/293 as "good enough", but I would like to consider this again. We now have BuildKite to do FreeBSD native builds.

To improve on the BuildKite config, we should add the pipelines to the repo based on the BuildKite Docs.

Then we can add a release upload step like we have in CircleCI.

/cc @derekmarcotte

SuperQ avatar Feb 11 '19 17:02 SuperQ

Oh interesting.

zachfi avatar Feb 13 '19 05:02 zachfi

Nice, any progress on this one? Would love to have this on Xigmanas (FreeBSD based)

fastlorenzo avatar Sep 01 '20 20:09 fastlorenzo

FYI, I made a fork and tried to build with CircleCI for freebsd/amd64.

If I add freebsd/amd64 in either .promu.yml or .promu-cgo.yml, I receive the following build error:

...
go: downloading golang.org/x/text v0.3.2

# runtime/cgo

gcc_freebsd_amd64.c:7:10: fatal error: sys/signalvar.h: No such file or directory

 #include <sys/signalvar.h>

          ^~~~~~~~~~~~~~~~~

compilation terminated.

!! command failed: build -o .build/freebsd-amd64/node_exporter -ldflags -X github.com/prometheus/common/version.Version=1.0.1 -X github.com/prometheus/common/version.Revision=e3e1945cb79a488c927f107a485ae535f24df222 -X github.com/prometheus/common/version.Branch=master -X github.com/prometheus/common/version.BuildUser=root@3820b9eb4f51 -X github.com/prometheus/common/version.BuildDate=20200901-21:16:57  -extldflags '-static' -a -tags 'netgo static_build' github.com/prometheus/node_exporter: exit status 2

make: *** [Makefile.common:227: common-build] Error 1

!! The base builder docker image exited unexpectedly: exit status 2

Exited with code exit status 1

fastlorenzo avatar Sep 01 '20 21:09 fastlorenzo

Any news on this? Just wondering what my options are.

bgdnlp avatar May 04 '21 19:05 bgdnlp

I think nobody in the prometheus team does much with freebsd, let alone has a vested interested (aka getting paid for). So if people want to see that happen, best option is to submit a PR to add support for that. We will certainly try to help were possible.

discordianfish avatar May 07 '21 08:05 discordianfish

Options are:

  • use the node_exporter in FreeBSD ports/packages
  • build a binary yourself (it's pretty easy, but you need gmake installed)

derekmarcotte avatar May 07 '21 12:05 derekmarcotte

The ports version is a bit out of date and if I get an error while building from source, like the one above, I'm not sure how to solve it. Though this particular one looks like dependency issue. Between those two options maybe I can figure something out. Thank you.

bgdnlp avatar May 07 '21 13:05 bgdnlp

This particular error listed here, is trying to cross-build on linux. linux doesn't have the same C header files nor appropriate build environment, so things like CircleCI and Travis are out.

You need to build on a FreeBSD host directly (unless you can finagle a linux->FreeBSD cross-build environment, which I would not suggest without good familiarity with the matter).

derekmarcotte avatar May 07 '21 15:05 derekmarcotte

Options are:

  • use the node_exporter in FreeBSD ports/packages
  • build a binary yourself (it's pretty easy, but you need gmake installed)

Hello! How to build a node_ exporter 1.4.0 in freebsd10 .

haxhcf avatar Aug 23 '22 03:08 haxhcf

FreeBSD 10.x was end-of-life'd in 2017.

For my money, I'd spin up a 10.x vm (match your version), and get a new copy of the ports tree.

Use ALLOW_UNSUPPORTED_SYSTEM=true in your make.conf.

Also, the new ports tree depends on a flag in /bin/sh that doesn't exist in 10.x, so grab /rescue/sh from 12.3 and overwrite your /bin/sh in the vm.

Do a make package in the new ports tree.

Cross your fingers.

Install freshly minted package on target machine.

derekmarcotte avatar Aug 23 '22 14:08 derekmarcotte

Any progress on this? I tried to compile it myself but encountered a lot of problems, I hope to release the binaries。Greatful!

Lucareful avatar Aug 08 '23 10:08 Lucareful

No, someone needs to fix all the issues you encountered first. Or pay someone to do so.

discordianfish avatar Aug 08 '23 12:08 discordianfish