prometheus-client-c
prometheus-client-c copied to clipboard
Build fails under Arch Linux (undefined: io.Discard)
I got the following error when trying to build the library:
$ make
...
Step 1/4 : FROM ubuntu:18.04
...
Processing triggers for mime-support (3.60ubuntu1) ...
+ rm -f /usr/bin/gcc
+ ln -s /usr/bin/gcc-10 /usr/bin/gcc
+ curl -sL https://github.com/Kitware/CMake/releases/download/v3.14.5/cmake-3.14.5-Linux-x86_64.tar.gz
+ tar xzf - -C /opt
+ cp /opt/cmake-3.14.5-Linux-x86_64/bin/ccmake /opt/cmake-3.14.5-Linux-x86_64/bin/cmake /opt/cmake-3.14.5-Linux-x86_64/bin/cmake-gui /opt/cmake-3.14.5-Linux-x86_64/bin/cpack /opt/cmake-3.14.5-Linux-x86_64/bin/ctest /usr/local/bin/
+ cp -R /opt/cmake-3.14.5-Linux-x86_64/share/cmake-3.14 /usr/local/share/
+ curl -sL https://dl.google.com/go/go1.13.1.linux-amd64.tar.gz
+ tar xzf - -C /usr/local
+ mkdir -p /gopath/{src,bin}
+ printf export GOPATH=/gopath\nexport PATH=$PATH:/usr/local/go/bin:/gopath/bin\n
+ printf #!/usr/bin/env bash\nsource /root/.bash_profile\nexec /bin/bash $@\n
+ chmod +x /entrypoint
+ GOPATH=/gopath /usr/local/go/bin/go get github.com/prometheus/prom2json
# github.com/prometheus/common/expfmt
gopath/src/github.com/prometheus/common/expfmt/decode.go:89:34: cannot use v (type *io_prometheus_client.MetricFamily) as type protoreflect.ProtoMessage in argument to pbutil.ReadDelimited:
*io_prometheus_client.MetricFamily does not implement protoreflect.ProtoMessage (missing ProtoReflect method)
gopath/src/github.com/prometheus/common/expfmt/encode.go:120:36: cannot use v (type *io_prometheus_client.MetricFamily) as type protoreflect.ProtoMessage in argument to pbutil.WriteDelimited:
*io_prometheus_client.MetricFamily does not implement protoreflect.ProtoMessage (missing ProtoReflect method)
gopath/src/github.com/prometheus/common/expfmt/text_create.go:46:27: undefined: io.Discard
The command '/bin/sh -c set -x && apt-get update && apt-get install -y apt-utils software-properties-common clang-format && add-apt-repository ppa:ubuntu-toolchain-r/test && apt-get update -y && apt-get install -y curl tar build-essential git pkg-config gdb valgrind gcc-10 libmicrohttpd-dev doxygen graphviz && rm -f /usr/bin/gcc && ln -s /usr/bin/gcc-10 /usr/bin/gcc && curl -sL https://github.com/Kitware/CMake/releases/download/v3.14.5/cmake-3.14.5-Linux-x86_64.tar.gz | tar xzf - -C /opt && cp /opt/cmake-3.14.5-Linux-x86_64/bin/* /usr/local/bin/ && cp -R /opt/cmake-3.14.5-Linux-x86_64/share/cmake-3.14 /usr/local/share/ && curl -sL https://dl.google.com/go/go1.13.1.linux-amd64.tar.gz 2> /dev/null | tar xzf - -C /usr/local && mkdir -p /gopath/{src,bin} && printf 'export GOPATH=/gopath\nexport PATH=$PATH:/usr/local/go/bin:/gopath/bin\n' > /root/.bash_profile && printf '#!/usr/bin/env bash\nsource /root/.bash_profile\nexec /bin/bash $@\n' > /entrypoint && chmod +x /entrypoint && GOPATH=/gopath /usr/local/go/bin/go get github.com/prometheus/prom2json && GOPATH=/gopath /usr/local/go/bin/go install github.com/prometheus/prom2json/cmd/prom2json && GOPATH=/gopath /usr/local/go/bin/go get github.com/git-chglog/git-chglog && GOPATH=/gopath /usr/local/go/bin/go install github.com/git-chglog/git-chglog/cmd/git-chglog && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 2
make[1]: *** [Makefile:2: docker] Error 2
make[1]: Leaving directory '/home/mutex/dist/src/odyssey/include/prometheus-client-c/docker'
ERROR: Docker Build Failure
make: *** [Makefile:26: clean] Error 2
I'm building from master branch, commit hash = c57034d196582d99267d027abb52a05a55dc07f6. Myabe go version iw wrong or am I missed something?