tetragon icon indicating copy to clipboard operation
tetragon copied to clipboard

error trying to build tetragon locally on fedora 42

Open 0xMALVEE opened this issue 7 months ago • 2 comments

malvee@fedora:~/code/tetragon$ make
docker rm tetragon-clang || true
Error response from daemon: No such container: tetragon-clang
docker run -v /home/malvee/code/tetragon:/tetragon:Z -u $(id -u) -e BPF_TARGET_ARCH=x86 --name tetragon-clang quay.io/cilium/clang:b97f5b3d5c38da62fb009f21a53cd42aefd54a2f@sha256:e1c8ed0acd2e24ed05377f2861d8174af28e09bef3bbc79649c8eba165207df0 make -C /tetragon/bpf -j16 
make: Entering directory '/tetragon/bpf'
make: Nothing to be done for 'all'.
make: Leaving directory '/tetragon/bpf'
docker rm tetragon-clang
tetragon-clang
CGO_ENABLED=0 GOARCH=amd64 go build -ldflags "-X 'github.com/cilium/tetragon/pkg/version.Version=v1.5.0-pre.0-196-g87e0f9fe5' -s -w" -mod=vendor ./cmd/tetragon/
CGO_ENABLED=0 GOARCH=amd64 go build -ldflags "-X 'github.com/cilium/tetragon/pkg/version.Version=v1.5.0-pre.0-196-g87e0f9fe5' -s -w" -mod=vendor ./cmd/tetra/
echo "$(./tetragon --generate-docs)" > docs/data/tetragon_flags.yaml
mkdir -p go-tests
for pkg in $(go list "./..."); do \
	localpkg=$(echo $pkg | sed -e 's:github.com/cilium/tetragon/::'); \
	localtestfile=$(echo $localpkg | sed -e 's:/:.:g'); \
	numtests=$(ls -l ./$localpkg/*_test.go 2> /dev/null | wc -l); \
	if [ $numtests -le 0 ]; then \
		continue; \
	fi; \
	echo -c ./$localpkg -o go-tests/$localtestfile; \
done | GOMAXPROCS=1 xargs -P 16 -L 1 go test -gcflags=
?   	github.com/cilium/tetragon/pkg/errmetrics	[no test files]
?   	github.com/cilium/tetragon/pkg/manager	[no test files]
make -C "contrib/tester-progs"
make[1]: Entering directory '/home/malvee/code/tetragon/contrib/tester-progs'
gcc -Wall sigkill-unprivileged-user-ns-tester.c -o sigkill-unprivileged-user-ns-tester -lcap
sigkill-unprivileged-user-ns-tester.c: In function ‘main’:
sigkill-unprivileged-user-ns-tester.c:252:15: error: too many arguments to function ‘check_cap’; expected 0, have 1
  252 |         cap = check_cap(CAP_SYS_ADMIN);
      |               ^~~~~~~~~ ~~~~~~~~~~~~~
sigkill-unprivileged-user-ns-tester.c:89:5: note: declared here
   89 | int check_cap()
      |     ^~~~~~~~~
sigkill-unprivileged-user-ns-tester.c:265:23: error: too many arguments to function ‘check_cap’; expected 0, have 1
  265 |                 cap = check_cap(CAP_SYS_ADMIN);
      |                       ^~~~~~~~~ ~~~~~~~~~~~~~
sigkill-unprivileged-user-ns-tester.c:89:5: note: declared here
   89 | int check_cap()
      |     ^~~~~~~~~
make[1]: *** [Makefile:57: sigkill-unprivileged-user-ns-tester] Error 1
make[1]: Leaving directory '/home/malvee/code/tetragon/contrib/tester-progs'
make: *** [Makefile:270: tester-progs] Error 2

0xMALVEE avatar May 01 '25 04:05 0xMALVEE

hum, not sure how it got compiled in the first place.. will check, maybe quick fix in here https://github.com/cilium/tetragon/pull/3688

olsajiri avatar May 01 '25 12:05 olsajiri

You need to install the appropriate libraries to compile the test programs (tester-progs). In this case it should be libcap-dev. We should probably add a way to build these programs via a container. Maybe we could also remove this target from the default build as well.

kkourt avatar May 15 '25 06:05 kkourt

Let's close this issue as installing the dev libraries should fix this!

mtardy avatar Jul 15 '25 16:07 mtardy