blackbox_exporter icon indicating copy to clipboard operation
blackbox_exporter copied to clipboard

cannot build on s390x

Open tseeling opened this issue 3 years ago • 1 comments

Trying to build current release on s390x, Redhat 7.x flavour. Simple problem during make: exec: "s390x-linux-gnu-gcc": executable file not found in $PATH Solved by creating a shortcut and setting PATH accordingly (requires Redhat SCL gcc 8):

$ cat ~/bin/s390x-linux-gnu-gcc
#!/bin/bash

source /opt/rh/devtoolset-8/enable
/opt/rh/devtoolset-8/root/usr/bin/gcc "${@}"
$ uname -a
Linux myhostname 3.10.0-1127.el7.s390x #1 SMP Tue Feb 18 16:39:30 EST 2020 s390x s390x s390x GNU/Linux

blackbox_exporter version: output of blackbox_exporter --version

make does not complete.

What did you do that produced an error?

go get
make

What did you expect to see?

Completed the make

What did you see instead?

GO111MODULE=on go test   ./...
ok      github.com/prometheus/blackbox_exporter 0.009s
ok      github.com/prometheus/blackbox_exporter/config  0.012s
2021/09/20 18:21:30 http: TLS handshake error from 127.0.0.1:33820: remote error: tls: bad certificate
--- FAIL: TestRedirectToTLSHostWorks (10.00s)
    http_test.go:1141: Redirect test failed unexpectedly
level=info msg="Resolving target address" ip_protocol=ip4
level=info msg="Resolving target address" ip_protocol=ip6
level=info msg="Resolved target address" ip=2a00:my:ip:v6::200e
level=info msg="Resolving target address" ip_protocol=ip4
level=error msg="Resolution with IP protocol failed" err="address ipv6.google.com: no suitable address found"
level=info msg="Resolving target address" ip_protocol=ip4
level=info msg="Resolving target address" ip_protocol=ip6
level=error msg="Resolution with IP protocol failed" err="lookup does-not-exist.example.com on 10.61.my.ip:53: no such host"
FAIL
FAIL    github.com/prometheus/blackbox_exporter/prober  13.313s
FAIL
make: *** [Makefile.common:172: common-test] Error 1

tseeling avatar Sep 20 '21 16:09 tseeling

I could circumvent the error by only using "-short" tests in Makefile.common, but this is an ugly hack.

  mkdir -p "${GOPATH}/bin"
  cd "${builddir}"
  go get
  sed -i -e 's!\$(test-flags)!-short!' Makefile.common
  make

tseeling avatar Sep 21 '21 10:09 tseeling