Skip to content

Version 16 does not compile on FreeBSD

I currently package gitlab version 16.0.0 for FreeBSD and I have problem to package the kubernetes agent. If I build it with:

===>  Building for gitlab-agent-16.0.1
(cd /usr/local/poudriere/ports/gitlab/net/gitlab-agent/work/gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16@v16.0.1;  for t in ./cmd/kas; do  out=$(/usr/bin/basename $(echo ${t} |  /usr/bin/sed -Ee 's/^[^:]*:([^:]+).*$/\1/' -e 's/^\.$/gitlab-agent/'));  pkg=$(echo ${t} |  /usr/bin/sed -Ee 's/^([^:]*).*$/\1/' -e 's/^gitlab-agent$/./');  echo "===>  Building ${out} from ${pkg}";  /usr/bin/env XDG_DATA_HOME=/usr/local/poudriere/ports/gitlab/net/gitlab-agent/work  XDG_CONFIG_HOME=/usr/local/poudriere/ports/gitlab/net/gitlab-agent/work  XDG_CACHE_HOME=/usr/local/poudriere/ports/gitlab/net/gitlab-agent/work/.cache  HOME=/usr/local/poudriere/ports/gitlab/net/gitlab-agent/work PATH=/usr/local/poudriere/ports/gitlab/net/gitlab-agent/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/home/idefix/bin:/usr/home/idefix/.antigen/bundles/robbyrussell/oh-my-zsh/lib:/usr/home/idefix/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/git:/usr/home/idefix/.antigen/bundles/zsh-users/zsh-syntax-highlighting:~/.local/bin PKG_CONFIG_LIBDIR=/usr/local/poudriere/ports/gitlab/net/gitlab-agent/work/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS=""  LDFLAGS=" -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing  "  MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" CGO_ENABLED=1  CGO_CFLAGS="-I/usr/local/include"  CGO_LDFLAGS="-L/usr/local/lib"  GOAMD64=  GOARM=  GOTMPDIR="/usr/local/poudriere/ports/gitlab/net/gitlab-agent/work" GOPATH="/usr/local/poudriere/ports/gitlab/distfiles/go/net_gitlab-agent"  GOBIN="/usr/local/poudriere/ports/gitlab/net/gitlab-agent/work/bin"  GO111MODULE=on  GOFLAGS=-modcacherw  GOSUMDB=sum.golang.org GOMAXPROCS=16 GOPROXY=off /usr/local/bin/go120 build -tags="tracer_static,tracer_static_jaeger"  -ldflags="  -X 'gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/cmd.Version=v16.0.1'  -X 'gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/cmd.Commit='  -X 'gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/cmd.BuildTime=$(date -u "+%Y-%m-%d-%H%M UTC")'" -buildmode=exe -v -trimpath -buildvcs=false -mod=vendor  -o /usr/local/poudriere/ports/gitlab/net/gitlab-agent/work/bin/${out}  ${pkg};  done)

I get the following error:

===>  Building kas from ./cmd/kas
go.opentelemetry.io/otel/sdk/resource
# go.opentelemetry.io/otel/sdk/resource
vendor/go.opentelemetry.io/otel/sdk/resource/host_id_bsd.go:21:15: undefined: execCommand
vendor/go.opentelemetry.io/otel/sdk/resource/host_id_bsd.go:22:15: undefined: readFile
*** Error code 1

It seems to be related to a 3rd party module that cannot be build, maybe you have an idea how to fix this?

Thanks a lot.