Tinkoff / libvirt-exporter

Prometheus metrics exporter for libvirt.
Apache License 2.0
105 stars 46 forks source link

Can`t compile #13

Closed cccdemon closed 3 years ago

cccdemon commented 3 years ago

Compiled via: build_static.sh Branch: Master (fresh pull) OS: Alpine 3.8 (within docker) HOST: MacOS BigSur

Testtrun (without strip) on ArchLinux & Ubuntu 20.04 (segfault)

make[1]: Entering directory '/tmp/libvirt-3.8.0/po'
if test "libvirt" = "gettext-tools"; then \
  ../build-aux/install-sh -c -d /usr/local/share/gettext/po; \
  for file in Makefile.in.in remove-potcdate.sin quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot   Makevars.template; do \
    /usr/bin/install -c -m 644 ./$file \
            /usr/local/share/gettext/po/$file; \
  done; \
  for file in Makevars; do \
    rm -f /usr/local/share/gettext/po/$file; \
  done; \
else \
  : ; \
fi
make[1]: Leaving directory '/tmp/libvirt-3.8.0/po'
Making install in examples
make[1]: Entering directory '/tmp/libvirt-3.8.0/examples'
make[2]: Entering directory '/tmp/libvirt-3.8.0/examples'
make[2]: Nothing to be done for 'install-exec-am'.
../build-aux/install-sh -c -d ""/usr/local/etc/libvirt/nwfilter""
for f in ./xml/nwfilter/no-other-rarp-traffic.xml ./xml/nwfilter/qemu-announce-self-rarp.xml ./xml/nwfilter/allow-dhcp-server.xml ./xml/nwfilter/no-mac-broadcast.xml ./xml/nwfilter/allow-incoming-ipv4.xml ./xml/nwfilter/no-other-l2-traffic.xml ./xml/nwfilter/allow-ipv4.xml ./xml/nwfilter/no-arp-mac-spoofing.xml ./xml/nwfilter/allow-arp.xml ./xml/nwfilter/no-arp-ip-spoofing.xml ./xml/nwfilter/clean-traffic.xml ./xml/nwfilter/no-arp-spoofing.xml ./xml/nwfilter/allow-dhcp.xml ./xml/nwfilter/no-mac-spoofing.xml ./xml/nwfilter/no-ip-spoofing.xml ./xml/nwfilter/no-ip-multicast.xml ./xml/nwfilter/qemu-announce-self.xml; do \
    /usr/bin/install -c -m 644 $f ""/usr/local/etc/libvirt/nwfilter""; \
done
make[2]: Leaving directory '/tmp/libvirt-3.8.0/examples'
make[1]: Leaving directory '/tmp/libvirt-3.8.0/examples'
+ sed -i 's/^Libs:.*/& -lnl -ltirpc -lxml2/' /usr/local/lib/pkgconfig/libvirt.pc
+ cd /libvirt-exporter
+ export 'GOPATH=/gopath'
+ mkdir -p /gopath/
+ ln -s /libvirt-exporter/vendor /gopath/src
+ mkdir -p /gopath/src/github.com/AlexZzz
+ ln -s /libvirt-exporter /gopath/src/github.com/AlexZzz/libvirt-exporter
+ go build --ldflags '-extldflags "-static"' -o libvirt-exporter
go build _/libvirt-exporter: build output "libvirt-exporter" already exists and is not an object file
cccdemon commented 3 years ago
➜  AlexZzz_libvirt-exporter git:(master) ✗ ls -lrt
total 152
-rw-r--r--  1 torsten  staff  11357 18 Mär 08:27 LICENSE
-rw-r--r--  1 torsten  staff   3924 18 Mär 08:27 README.md
-rwxr-xr-x  1 torsten  staff    447 18 Mär 08:27 buildindocker.sh
drwxr-xr-x@ 3 torsten  staff     96 18 Mär 08:27 libvirtSchema
-rw-r--r--  1 torsten  staff    981 19 Mär 16:37 Dockerbuildimage
-rw-r--r--  1 torsten  staff   1464 19 Mär 16:37 Dockerfile
-rw-r--r--  1 torsten  staff    484 19 Mär 16:37 go.mod
-rw-r--r--  1 torsten  staff   7603 19 Mär 16:37 go.sum
-rw-r--r--  1 torsten  staff  26822 19 Mär 16:37 libvirt_exporter.go
-rw-r--r--  1 torsten  staff   1507 19 Mär 16:37 CHANGELOG.md
-rwxr-xr-x  1 torsten  staff   1354 19 Mär 16:37 build_static.sh
drwxr-xr-x@ 3 torsten  staff     96 19 Mär 16:38 libvirt-patches
drwxr-xr-x@ 6 torsten  staff    192 22 Mär 08:58 vendor
lrwxr-xr-x  1 torsten  staff     17 22 Mär 09:25 libvirt-exporter -> /libvirt-exporter
cccdemon commented 3 years ago

Well i`ve tried the same branch (master) on one of my cenos7 servers and it works. This seems to be an docker/macOs issue then o0

Will close this