cilium / tetragon

eBPF-based Security Observability and Runtime Enforcement
https://tetragon.io
Apache License 2.0
3.63k stars 360 forks source link

Can't build image with `make image` on Ubuntu-like system #1606

Open inliquid opened 1 year ago

inliquid commented 1 year ago

What happened?

At some point I needed to build an image and it failed.

System is Mint 20.3 Una (based on Ubuntu 20.04 Focal).

Tetragon Version

Most recent code from main. I tried different tags, but all failed.

Kernel Version

$ uname -a
Linux mint-vm 5.4.0-164-generic #181-Ubuntu SMP Fri Sep 1 13:41:22 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Kubernetes Version

No response

Bugtool

No response

Relevant log output

$ make image
docker build -t "cilium/tetragon:latest" --target release --build-arg TETRAGON_VERSION=v1.0.0-pre.1-1-gbdebfece .
[+] Building 228.5s (33/36)                                                                                                                                          docker:default
 => [internal] load build definition from Dockerfile                                                                                                                           0.0s
 => => transferring dockerfile: 5.88kB                                                                                                                                         0.0s
 => [internal] load .dockerignore                                                                                                                                              0.0s
 => => transferring context: 580B                                                                                                                                              0.0s
 => [internal] load metadata for docker.io/library/alpine:3.18.4@sha256:eece025e432126ce23f223450a0326fbebde39cdf496a85d8c016293fc851978                                       2.2s
 => [internal] load metadata for docker.io/library/golang:1.21.3-alpine@sha256:926f7f7e1ab8509b4e91d5ec6d5916ebb45155b0c8920291ba9f361d65385806                                1.9s
 => [internal] load metadata for quay.io/cilium/clang:aeaada5cf60efe8d0e772d032fe3cc2bc613739c@sha256:b440ae7b3591a80ffef8120b2ac99e802bbd31dee10f5f15a48566832ae0866f         0.0s
 => [internal] load metadata for docker.io/library/golang:1.21.3@sha256:24a09375a6216764a3eda6a25490a88ac178b5fcb9511d59d0da5ebf9e496474                                       1.9s
 => [auth] library/golang:pull token for registry-1.docker.io                                                                                                                  0.0s
 => [auth] library/alpine:pull token for registry-1.docker.io                                                                                                                  0.0s
 => [tetragon-builder 1/6] FROM docker.io/library/golang:1.21.3@sha256:24a09375a6216764a3eda6a25490a88ac178b5fcb9511d59d0da5ebf9e496474                                        0.0s
 => CACHED [base-build 1/7] FROM docker.io/library/alpine:3.18.4@sha256:eece025e432126ce23f223450a0326fbebde39cdf496a85d8c016293fc851978                                       0.0s
 => [bpf-builder 1/5] FROM quay.io/cilium/clang:aeaada5cf60efe8d0e772d032fe3cc2bc613739c@sha256:b440ae7b3591a80ffef8120b2ac99e802bbd31dee10f5f15a48566832ae0866f               0.0s
 => CACHED [gops 1/2] FROM docker.io/library/golang:1.21.3-alpine@sha256:926f7f7e1ab8509b4e91d5ec6d5916ebb45155b0c8920291ba9f361d65385806                                      0.0s
 => CACHED [tetragon-builder 2/6] WORKDIR /go/src/github.com/cilium/tetragon                                                                                                   0.0s
 => [internal] load build context                                                                                                                                              0.3s
 => => transferring context: 1.50MB                                                                                                                                            0.3s
 => [base-build 2/7] RUN apk add iproute2                                                                                                                                     74.2s
 => CACHED [bpftool-builder 2/7] WORKDIR /bpftool                                                                                                                              0.0s
 => CACHED [bpftool-builder 3/7] RUN if [ amd64 != amd64 ];     then apt-get update && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu jammy main restricted universe  0.0s
 => [tetragon-builder 3/6] RUN apt-get update                                                                                                                                 17.7s
 => CACHED [bpf-builder 2/5] WORKDIR /go/src/github.com/cilium/tetragon                                                                                                        0.0s
 => [bpftool-builder 4/7] RUN apt-get update                                                                                                                                   7.6s
 => [bpf-builder 3/5] RUN apt-get update && apt-get install -y linux-libc-dev                                                                                                 67.3s
 => CANCELED [gops 2/2] RUN apk add --no-cache binutils git  && git clone https://github.com/google/gops /go/src/github.com/google/gops  && cd /go/src/github.com/google/go  226.2s
 => [bpftool-builder 5/7] RUN if [ amd64 != amd64 ];     then apt-get install -y curl git llvm gcc pkg-config zlib1g-dev libelf-dev libelf-dev:arm64 libcap-dev:arm64 crossb  50.4s
 => [tetragon-builder 4/6] RUN if [ amd64 != amd64 ];     then apt-get install -y libelf-dev zlib1g-dev crossbuild-essential-amd64;     else apt-get install -y libelf-dev zl  5.5s
 => [tetragon-builder 5/6] COPY . ./                                                                                                                                           3.1s
 => [tetragon-builder 6/6] RUN if [ amd64 != amd64 ];     then make tetragon-image LOCAL_CLANG=1 VERSION=v1.0.0-pre.1-1-gbdebfece TARGET_ARCH=amd64 CC=aarch64-linux-gnu-gcc  29.7s
 => [bpftool-builder 6/7] RUN git clone --recurse-submodules https://github.com/libbpf/bpftool.git . && git checkout b01941c8f7890489f09713348a7d89567538504b                163.0s
 => [bpf-builder 4/5] COPY . ./                                                                                                                                                3.7s
 => [bpf-builder 5/5] RUN make tetragon-bpf LOCAL_CLANG=1 TARGET_ARCH=amd64                                                                                                    8.4s
 => [base-build 3/7] RUN mkdir /var/lib/tetragon/ &&     mkdir -p /etc/tetragon/tetragon.conf.d/ &&     mkdir -p /etc/tetragon/tetragon.tp.d/ &&     apk add --no-cache --up  94.5s
 => [base-build 4/7] COPY --from=tetragon-builder /go/src/github.com/cilium/tetragon/tetragon /usr/bin/                                                                        0.1s
 => [base-build 5/7] COPY --from=tetragon-builder /go/src/github.com/cilium/tetragon/tetra /usr/bin/                                                                           0.1s
 => ERROR [bpftool-builder 7/7] RUN if [ amd64 != amd64 ];     then make -C src EXTRA_CFLAGS=--static CC=aarch64-linux-gnu-gcc -j $(nproc) && aarch64-linux-gnu-strip src/bpf  5.0s
------
 > [bpftool-builder 7/7] RUN if [ amd64 != amd64 ];     then make -C src EXTRA_CFLAGS=--static CC=aarch64-linux-gnu-gcc -j $(nproc) && aarch64-linux-gnu-strip src/bpftool;     else make -C src EXTRA_CFLAGS=--static -j $(nproc) && strip src/bpftool; fi:
0.413 make: Entering directory '/bpftool/src'
0.859 ...                        libbfd: [ OFF ]
0.860 ...               clang-bpf-co-re: [ on  ]
0.860 ...                          llvm: [ OFF ]
0.861 ...                        libcap: [ on  ]
0.866   MKDIR    /bpftool/src/libbpf/
0.866   MKDIR    /bpftool/src/libbpf/include/bpf
0.867   MKDIR    /bpftool/src/bootstrap/libbpf/include/bpf
0.867   MKDIR    /bpftool/src/bootstrap/
0.867   MKDIR    /bpftool/src/bootstrap/libbpf/
0.872   INSTALL  /bpftool/src/bootstrap/libbpf/include/bpf/hashmap.h
0.872   INSTALL  /bpftool/src/bootstrap/libbpf/include/bpf/relo_core.h
0.872   INSTALL  /bpftool/src/bootstrap/libbpf/include/bpf/libbpf_internal.h
0.873   INSTALL  /bpftool/src/libbpf/include/bpf/hashmap.h
0.874 make[1]: Entering directory '/bpftool/libbpf/src'
0.874 make[1]: Entering directory '/bpftool/libbpf/src'
0.874   INSTALL  /bpftool/src/libbpf/include/bpf/nlattr.h
0.875   INSTALL  /bpftool/src/libbpf/include/bpf/relo_core.h
0.876   INSTALL  /bpftool/src/libbpf/include/bpf/libbpf_internal.h
0.886   MKDIR    /bpftool/src/libbpf/staticobjs
0.886   MKDIR    /bpftool/src/bootstrap/libbpf/staticobjs
0.887   INSTALL  bpf.h libbpf.h btf.h libbpf_common.h libbpf_legacy.h bpf_helpers.h bpf_helper_defs.h bpf_tracing.h bpf_endian.h bpf_core_read.h skel_internal.h libbpf_version.h usdt.bpf.h
0.887   INSTALL  bpf.h libbpf.h btf.h libbpf_common.h libbpf_legacy.h bpf_helpers.h bpf_helper_defs.h bpf_tracing.h bpf_endian.h bpf_core_read.h skel_internal.h libbpf_version.h usdt.bpf.h
0.888   CC       /bpftool/src/bootstrap/libbpf/staticobjs/bpf.o
0.888   CC       /bpftool/src/bootstrap/libbpf/staticobjs/btf.o
0.888   CC       /bpftool/src/libbpf/staticobjs/bpf.o
0.888   CC       /bpftool/src/bootstrap/libbpf/staticobjs/libbpf.o
0.889   CC       /bpftool/src/libbpf/staticobjs/btf.o
0.889   CC       /bpftool/src/libbpf/staticobjs/libbpf.o
0.895   CC       /bpftool/src/libbpf/staticobjs/libbpf_errno.o
0.895   CC       /bpftool/src/bootstrap/libbpf/staticobjs/libbpf_errno.o
0.972   CC       /bpftool/src/bootstrap/libbpf/staticobjs/netlink.o
0.980   CC       /bpftool/src/libbpf/staticobjs/netlink.o
1.296   CC       /bpftool/src/bootstrap/libbpf/staticobjs/nlattr.o
1.303   CC       /bpftool/src/libbpf/staticobjs/nlattr.o
1.379   CC       /bpftool/src/libbpf/staticobjs/str_error.o
1.402   CC       /bpftool/src/bootstrap/libbpf/staticobjs/str_error.o
1.405   CC       /bpftool/src/libbpf/staticobjs/libbpf_probes.o
1.409   CC       /bpftool/src/bootstrap/libbpf/staticobjs/libbpf_probes.o
1.451   CC       /bpftool/src/libbpf/staticobjs/bpf_prog_linfo.o
1.463   CC       /bpftool/src/bootstrap/libbpf/staticobjs/bpf_prog_linfo.o
1.499   CC       /bpftool/src/libbpf/staticobjs/btf_dump.o
1.556   CC       /bpftool/src/bootstrap/libbpf/staticobjs/btf_dump.o
1.570   CC       /bpftool/src/libbpf/staticobjs/hashmap.o
1.608   CC       /bpftool/src/bootstrap/libbpf/staticobjs/hashmap.o
1.809   CC       /bpftool/src/bootstrap/libbpf/staticobjs/ringbuf.o
1.809   CC       /bpftool/src/libbpf/staticobjs/ringbuf.o
1.875   CC       /bpftool/src/libbpf/staticobjs/strset.o
1.908   CC       /bpftool/src/bootstrap/libbpf/staticobjs/strset.o
1.930   CC       /bpftool/src/libbpf/staticobjs/linker.o
1.947   CC       /bpftool/src/bootstrap/libbpf/staticobjs/linker.o
1.973   CC       /bpftool/src/libbpf/staticobjs/gen_loader.o
1.977   CC       /bpftool/src/bootstrap/libbpf/staticobjs/gen_loader.o
2.001   CC       /bpftool/src/libbpf/staticobjs/relo_core.o
2.056   CC       /bpftool/src/bootstrap/libbpf/staticobjs/relo_core.o
2.223   CC       /bpftool/src/libbpf/staticobjs/usdt.o
2.223   CC       /bpftool/src/bootstrap/libbpf/staticobjs/usdt.o
2.273   CC       /bpftool/src/bootstrap/libbpf/staticobjs/zip.o
2.322   CC       /bpftool/src/bootstrap/libbpf/staticobjs/elf.o
2.398   CC       /bpftool/src/libbpf/staticobjs/zip.o
2.430   CC       /bpftool/src/libbpf/staticobjs/elf.o
3.324   AR       /bpftool/src/libbpf/libbpf.a
3.372   AR       /bpftool/src/bootstrap/libbpf/libbpf.a
3.585 make[1]: Leaving directory '/bpftool/libbpf/src'
3.585 make[1]: Leaving directory '/bpftool/libbpf/src'
3.589   CC       btf.o
3.590   CC       btf_dumper.o
3.590   CC       cfg.o
3.590   CC       cgroup.o
3.591   CC       common.o
3.591   CC       feature.o
3.593   CC       gen.o
3.594   CC       iter.o
3.711   CC       json_writer.o
3.753   CC       link.o
3.771   CC       main.o
3.779   CC       map.o
3.821   CC       map_perf_ring.o
3.832   CC       net.o
3.836   CC       netlink_dumper.o
3.855   CC       perf.o
3.883   CC       /bpftool/src/bootstrap/main.o
3.891   CC       /bpftool/src/bootstrap/common.o
3.915   CC       /bpftool/src/bootstrap/json_writer.o
3.937   CC       /bpftool/src/bootstrap/gen.o
3.943   CC       /bpftool/src/bootstrap/btf.o
3.995   CC       /bpftool/src/bootstrap/xlated_dumper.o
4.023   CC       /bpftool/src/bootstrap/btf_dumper.o
4.052   CC       /bpftool/src/bootstrap/disasm.o
4.059   CC       struct_ops.o
4.099   CC       tracelog.o
4.146   CC       xlated_dumper.o
4.155   CC       disasm.o
4.340   LINK     /bpftool/src/bootstrap/bpftool
4.480   GEN      vmlinux.h
4.676   CLANG    pid_iter.bpf.o
4.676   CLANG    profiler.bpf.o
4.919 skeleton/pid_iter.bpf.c:35:10: error: incomplete definition of type 'struct bpf_link'
4.919                 return BPF_CORE_READ((struct bpf_link *)ent, id);
4.919                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.919 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:443:2: note: expanded from macro 'BPF_CORE_READ'
4.919         ___type((src), a, ##__VA_ARGS__) __r;                               \
4.919         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.919 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:314:29: note: expanded from macro '___type'
4.919 #define ___type(...) typeof(___arrow(__VA_ARGS__))
4.919                             ^~~~~~~~~~~~~~~~~~~~~
4.919 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:312:23: note: expanded from macro '___arrow'
4.919 #define ___arrow(...) ___apply(___arrow, ___narg(__VA_ARGS__))(__VA_ARGS__)
4.919                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.919 note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
4.919 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:263:25: note: expanded from macro '___concat'
4.919 #define ___concat(a, b) a ## b
4.919                         ^
4.919 <scratch space>:16:1: note: expanded from here
4.919 ___arrow2
4.919 ^
4.919 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:303:26: note: expanded from macro '___arrow2'
4.919 #define ___arrow2(a, b) a->b
4.919                         ~^
4.919 skeleton/pid_iter.bpf.c:35:32: note: forward declaration of 'struct bpf_link'
4.919                 return BPF_CORE_READ((struct bpf_link *)ent, id);
4.919                                              ^
4.919 skeleton/pid_iter.bpf.c:35:10: error: incomplete definition of type 'struct bpf_link'
4.919                 return BPF_CORE_READ((struct bpf_link *)ent, id);
4.919                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.919 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:444:2: note: expanded from macro 'BPF_CORE_READ'
4.919         BPF_CORE_READ_INTO(&__r, (src), a, ##__VA_ARGS__);                  \
4.919         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.919 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:351:2: note: expanded from macro 'BPF_CORE_READ_INTO'
4.919         ___core_read(bpf_core_read, bpf_core_read,                          \
4.919         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.919 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:342:2: note: expanded from macro '___core_read'
4.919         ___apply(___core_read, ___empty(__VA_ARGS__))(fn, fn_ptr, dst,      \
4.919         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.919 note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
4.919 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:336:2: note: expanded from macro '___core_read0'
4.919         ___read(fn, dst, ___type(src), src, a);
4.919         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.919 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:317:59: note: expanded from macro '___read'
4.919         read_fn((void *)(dst), sizeof(*(dst)), &((src_type)(src))->accessor)
4.919         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
4.919 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:246:79: note: expanded from macro 'bpf_core_read'
4.919         bpf_probe_read_kernel(dst, sz, (const void *)__builtin_preserve_access_index(src))
4.919                                                                                      ^~~
4.919 skeleton/pid_iter.bpf.c:35:32: note: forward declaration of 'struct bpf_link'
4.919                 return BPF_CORE_READ((struct bpf_link *)ent, id);
4.919                                              ^
4.919 skeleton/pid_iter.bpf.c:35:10: error: returning 'void' from a function with incompatible result type '__u32' (aka 'unsigned int')
4.919                 return BPF_CORE_READ((struct bpf_link *)ent, id);
4.919                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.919 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:442:36: note: expanded from macro 'BPF_CORE_READ'
4.919 #define BPF_CORE_READ(src, a, ...) ({                                       \
4.919                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.919 skeleton/pid_iter.bpf.c:42:36: warning: declaration of 'struct bpf_link' will not be visible outside of this function [-Wvisibility]
4.919 static __u64 get_bpf_cookie(struct bpf_link *link)
4.919                                    ^
4.920 skeleton/pid_iter.bpf.c:47:14: error: incomplete definition of type 'struct bpf_perf_link'
4.920         perf_link = container_of(link, struct bpf_perf_link, link);
4.920                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.920 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_helpers.h:93:22: note: expanded from macro 'container_of'
4.920                 ((type *)(__mptr - offsetof(type, member)));    \
4.920                                    ^~~~~~~~~~~~~~~~~~~~~~
4.921 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_helpers.h:86:60: note: expanded from macro 'offsetof'
4.921 #define offsetof(type, member)  ((unsigned long)&((type *)0)->member)
4.921                                                  ~~~~~~~~~~~^
4.921 skeleton/pid_iter.bpf.c:44:9: note: forward declaration of 'struct bpf_perf_link'
4.921         struct bpf_perf_link *perf_link;
4.921                ^
4.921 skeleton/pid_iter.bpf.c:48:10: error: incomplete definition of type 'struct bpf_perf_link'
4.921         event = BPF_CORE_READ(perf_link, perf_file, private_data);
4.921                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.921 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:443:2: note: expanded from macro 'BPF_CORE_READ'
4.921         ___type((src), a, ##__VA_ARGS__) __r;                               \
4.921         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.921 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:314:29: note: expanded from macro '___type'
4.921 #define ___type(...) typeof(___arrow(__VA_ARGS__))
4.921                             ^~~~~~~~~~~~~~~~~~~~~
4.921 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:312:23: note: expanded from macro '___arrow'
4.921 #define ___arrow(...) ___apply(___arrow, ___narg(__VA_ARGS__))(__VA_ARGS__)
4.921                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.921 note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
4.921 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:263:25: note: expanded from macro '___concat'
4.921 #define ___concat(a, b) a ## b
4.921                         ^
4.921 <scratch space>:19:1: note: expanded from here
4.921 ___arrow3
4.921 ^
4.921 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:304:29: note: expanded from macro '___arrow3'
4.921 #define ___arrow3(a, b, c) a->b->c
4.921                            ~^
4.921 skeleton/pid_iter.bpf.c:44:9: note: forward declaration of 'struct bpf_perf_link'
4.921         struct bpf_perf_link *perf_link;
4.921                ^
4.921 skeleton/pid_iter.bpf.c:48:10: error: incomplete definition of type 'struct bpf_perf_link'
4.921         event = BPF_CORE_READ(perf_link, perf_file, private_data);
4.921                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.921 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:444:2: note: expanded from macro 'BPF_CORE_READ'
4.921         BPF_CORE_READ_INTO(&__r, (src), a, ##__VA_ARGS__);                  \
4.921         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.921 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:351:2: note: expanded from macro 'BPF_CORE_READ_INTO'
4.921         ___core_read(bpf_core_read, bpf_core_read,                          \
4.921         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.921 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:342:2: note: expanded from macro '___core_read'
4.921         ___apply(___core_read, ___empty(__VA_ARGS__))(fn, fn_ptr, dst,      \
4.921         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.921 note: (skipping 9 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
4.921 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:320:33: note: expanded from macro '___rd_first'
4.921 #define ___rd_first(fn, src, a) ___read(fn, &__t, ___type(src), src, a);
4.921                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.921 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:317:59: note: expanded from macro '___read'
4.921         read_fn((void *)(dst), sizeof(*(dst)), &((src_type)(src))->accessor)
4.921         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
4.921 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:246:79: note: expanded from macro 'bpf_core_read'
4.921         bpf_probe_read_kernel(dst, sz, (const void *)__builtin_preserve_access_index(src))
4.921                                                                                      ^~~
4.921 skeleton/pid_iter.bpf.c:44:9: note: forward declaration of 'struct bpf_perf_link'
4.921         struct bpf_perf_link *perf_link;
4.921                ^
4.922 skeleton/pid_iter.bpf.c:48:10: error: incomplete definition of type 'struct bpf_perf_link'
4.922         event = BPF_CORE_READ(perf_link, perf_file, private_data);
4.922                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.922 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:444:2: note: expanded from macro 'BPF_CORE_READ'
4.922         BPF_CORE_READ_INTO(&__r, (src), a, ##__VA_ARGS__);                  \
4.922         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.922 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:351:2: note: expanded from macro 'BPF_CORE_READ_INTO'
4.922         ___core_read(bpf_core_read, bpf_core_read,                          \
4.922         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.922 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:342:2: note: expanded from macro '___core_read'
4.922         ___apply(___core_read, ___empty(__VA_ARGS__))(fn, fn_ptr, dst,      \
4.922         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.922 note: (skipping 9 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
4.922 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:303:26: note: expanded from macro '___arrow2'
4.922 #define ___arrow2(a, b) a->b
4.922                          ^
4.922 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:317:44: note: expanded from macro '___read'
4.922         read_fn((void *)(dst), sizeof(*(dst)), &((src_type)(src))->accessor)
4.922         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
4.922 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:246:79: note: expanded from macro 'bpf_core_read'
4.922         bpf_probe_read_kernel(dst, sz, (const void *)__builtin_preserve_access_index(src))
4.922                                                                                      ^~~
4.922 skeleton/pid_iter.bpf.c:44:9: note: forward declaration of 'struct bpf_perf_link'
4.922         struct bpf_perf_link *perf_link;
4.922                ^
4.922 skeleton/pid_iter.bpf.c:48:8: warning: incompatible integer to pointer conversion assigning to 'struct perf_event *' from 'long' [-Wint-conversion]
4.922         event = BPF_CORE_READ(perf_link, perf_file, private_data);
4.922               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.923 skeleton/pid_iter.bpf.c:49:30: error: no member named 'bpf_cookie' in 'struct perf_event'
4.923         return BPF_CORE_READ(event, bpf_cookie);
4.923                ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
4.923 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:443:17: note: expanded from macro 'BPF_CORE_READ'
4.923         ___type((src), a, ##__VA_ARGS__) __r;                               \
4.923         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
4.923 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:314:38: note: expanded from macro '___type'
4.923 #define ___type(...) typeof(___arrow(__VA_ARGS__))
4.923                             ~~~~~~~~~^~~~~~~~~~~~
4.923 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:312:64: note: expanded from macro '___arrow'
4.923 #define ___arrow(...) ___apply(___arrow, ___narg(__VA_ARGS__))(__VA_ARGS__)
4.923                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
4.923 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:303:28: note: expanded from macro '___arrow2'
4.923 #define ___arrow2(a, b) a->b
4.923                         ~  ^
4.923 skeleton/pid_iter.bpf.c:49:30: error: no member named 'bpf_cookie' in 'struct perf_event'
4.923         return BPF_CORE_READ(event, bpf_cookie);
4.923                ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
4.923 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:444:34: note: expanded from macro 'BPF_CORE_READ'
4.923         BPF_CORE_READ_INTO(&__r, (src), a, ##__VA_ARGS__);                  \
4.923         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
4.923 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:352:20: note: expanded from macro 'BPF_CORE_READ_INTO'
4.923                      dst, (src), a, ##__VA_ARGS__)                          \
4.923                      ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
4.923 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:343:18: note: expanded from macro '___core_read'
4.923                                                       src, a, ##__VA_ARGS__)
4.923                                                       ~~~~~^~~~~~~~~~~~~~~~~
4.923 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:336:38: note: expanded from macro '___core_read0'
4.923         ___read(fn, dst, ___type(src), src, a);
4.923         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
4.923 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:317:61: note: expanded from macro '___read'
4.923         read_fn((void *)(dst), sizeof(*(dst)), &((src_type)(src))->accessor)
4.923         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
4.923 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:246:79: note: expanded from macro 'bpf_core_read'
4.923         bpf_probe_read_kernel(dst, sz, (const void *)__builtin_preserve_access_index(src))
4.923                                                                                      ^~~
4.923 skeleton/pid_iter.bpf.c:49:9: error: returning 'void' from a function with incompatible result type '__u64' (aka 'unsigned long long')
4.924         return BPF_CORE_READ(event, bpf_cookie);
4.924                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.924 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:442:36: note: expanded from macro 'BPF_CORE_READ'
4.924 #define BPF_CORE_READ(src, a, ...) ({                                       \
4.924                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.924 skeleton/pid_iter.bpf.c:53:17: warning: declaration of 'struct bpf_iter__task_file' will not be visible outside of this function [-Wvisibility]
4.924 int iter(struct bpf_iter__task_file *ctx)
4.924                 ^
4.925 skeleton/pid_iter.bpf.c:55:25: error: incomplete definition of type 'struct bpf_iter__task_file'
4.925         struct file *file = ctx->file;
4.925                             ~~~^
4.925 skeleton/pid_iter.bpf.c:53:17: note: forward declaration of 'struct bpf_iter__task_file'
4.925 int iter(struct bpf_iter__task_file *ctx)
4.925                 ^
4.925 skeleton/pid_iter.bpf.c:56:32: error: incomplete definition of type 'struct bpf_iter__task_file'
4.925         struct task_struct *task = ctx->task;
4.925                                    ~~~^
4.925 skeleton/pid_iter.bpf.c:53:17: note: forward declaration of 'struct bpf_iter__task_file'
4.925 int iter(struct bpf_iter__task_file *ctx)
4.925                 ^
4.925 skeleton/pid_iter.bpf.c:90:7: error: incomplete definition of type 'struct bpf_link'
4.925                 if (BPF_CORE_READ(link, type) == BPF_LINK_TYPE_PERF_EVENT) {
4.925                     ^~~~~~~~~~~~~~~~~~~~~~~~~
4.925 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:443:2: note: expanded from macro 'BPF_CORE_READ'
4.925         ___type((src), a, ##__VA_ARGS__) __r;                               \
4.925         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.925 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:314:29: note: expanded from macro '___type'
4.925 #define ___type(...) typeof(___arrow(__VA_ARGS__))
4.925                             ^~~~~~~~~~~~~~~~~~~~~
4.925 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:312:23: note: expanded from macro '___arrow'
4.925 #define ___arrow(...) ___apply(___arrow, ___narg(__VA_ARGS__))(__VA_ARGS__)
4.925                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.925 note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
4.925 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:263:25: note: expanded from macro '___concat'
4.925 #define ___concat(a, b) a ## b
4.925                         ^
4.925 <scratch space>:36:1: note: expanded from here
4.925 ___arrow2
4.925 ^
4.925 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:303:26: note: expanded from macro '___arrow2'
4.925 #define ___arrow2(a, b) a->b
4.925                         ~^
4.925 skeleton/pid_iter.bpf.c:88:10: note: forward declaration of 'struct bpf_link'
4.925                 struct bpf_link *link = (struct bpf_link *) file->private_data;
4.925                        ^
4.925 skeleton/pid_iter.bpf.c:90:7: error: incomplete definition of type 'struct bpf_link'
4.926                 if (BPF_CORE_READ(link, type) == BPF_LINK_TYPE_PERF_EVENT) {
4.926                     ^~~~~~~~~~~~~~~~~~~~~~~~~
4.926 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:444:2: note: expanded from macro 'BPF_CORE_READ'
4.926         BPF_CORE_READ_INTO(&__r, (src), a, ##__VA_ARGS__);                  \
4.926         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.926 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:351:2: note: expanded from macro 'BPF_CORE_READ_INTO'
4.926         ___core_read(bpf_core_read, bpf_core_read,                          \
4.926         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.926 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:342:2: note: expanded from macro '___core_read'
4.926         ___apply(___core_read, ___empty(__VA_ARGS__))(fn, fn_ptr, dst,      \
4.926         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.926 note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
4.926 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:336:2: note: expanded from macro '___core_read0'
4.926         ___read(fn, dst, ___type(src), src, a);
4.926         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.926 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:317:59: note: expanded from macro '___read'
4.926         read_fn((void *)(dst), sizeof(*(dst)), &((src_type)(src))->accessor)
4.926         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
4.926 /bpftool/src/bootstrap/libbpf/include/bpf/bpf_core_read.h:246:79: note: expanded from macro 'bpf_core_read'
4.926         bpf_probe_read_kernel(dst, sz, (const void *)__builtin_preserve_access_index(src))
4.926                                                                                      ^~~
4.926 skeleton/pid_iter.bpf.c:88:10: note: forward declaration of 'struct bpf_link'
4.926                 struct bpf_link *link = (struct bpf_link *) file->private_data;
4.926                        ^
4.933 skeleton/pid_iter.bpf.c:90:36: error: use of undeclared identifier 'BPF_LINK_TYPE_PERF_EVENT'
4.933                 if (BPF_CORE_READ(link, type) == BPF_LINK_TYPE_PERF_EVENT) {
4.933                                                  ^
4.933 skeleton/pid_iter.bpf.c:92:34: warning: incompatible pointer types passing 'struct bpf_link *' to parameter of type 'struct bpf_link *' [-Wincompatible-pointer-types]
4.933                         e.bpf_cookie = get_bpf_cookie(link);
4.933                                                       ^~~~
4.934 skeleton/pid_iter.bpf.c:42:46: note: passing argument to parameter 'link' here
4.934 static __u64 get_bpf_cookie(struct bpf_link *link)
4.934                                              ^
4.934 skeleton/pid_iter.bpf.c:98:19: error: incomplete definition of type 'struct bpf_iter__task_file'
4.934         bpf_seq_write(ctx->meta->seq, &e, sizeof(e));
4.934                       ~~~^
4.934 skeleton/pid_iter.bpf.c:53:17: note: forward declaration of 'struct bpf_iter__task_file'
4.934 int iter(struct bpf_iter__task_file *ctx)
4.934                 ^
4.934 4 warnings and 16 errors generated.
4.941 make: *** [Makefile:204: pid_iter.bpf.o] Error 1
4.942 make: *** Waiting for unfinished jobs....
4.984 make: Leaving directory '/bpftool/src'
------
Dockerfile:67
--------------------
  66 |     RUN git clone --recurse-submodules https://github.com/libbpf/bpftool.git . && git checkout ${BPFTOOL_REV}
  67 | >>> RUN if [ $BUILDARCH != $TARGETARCH ]; \
  68 | >>>     then make -C src EXTRA_CFLAGS=--static CC=aarch64-linux-gnu-gcc -j $(nproc) && aarch64-linux-gnu-strip src/bpftool; \
  69 | >>>     else make -C src EXTRA_CFLAGS=--static -j $(nproc) && strip src/bpftool; fi
  70 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c if [ $BUILDARCH != $TARGETARCH ];     then make -C src EXTRA_CFLAGS=--static CC=aarch64-linux-gnu-gcc -j $(nproc) && aarch64-linux-gnu-strip src/bpftool;     else make -C src EXTRA_CFLAGS=--static -j $(nproc) && strip src/bpftool; fi" did not complete successfully: exit code: 2


### Anything else?

_No response_
mtardy commented 1 year ago

Just for the context, it follows a discussion we had here https://github.com/cilium/tetragon/issues/1595#issuecomment-1766187127.

I'll try to reproduce that but really I don't get it since the whole point of using Docker is to have a reproducible environment and here everything should be built inside quay.io/cilium/clang:aeaada5cf60efe8d0e772d032fe3cc2bc613739c@sha256:b440ae7b3591a80ffef8120b2ac99e802bbd31dee10f5f15a48566832ae0866f at a fixed bpftool commit b01941c8f7890489f09713348a7d89567538504b.

mtardy commented 11 months ago

I can't reproduce this, is this still an issue for you? I was thinking maybe it was the apt-get source manipulation but you seem to compile on amd64 for amd64 so...

If you don't mind just skip bpftool compilation and download the precompiled static version using:

- docker build -t "cilium/tetragon:latest" --target release --build-arg TETRAGON_VERSION=$(make version)
+ docker build -t "cilium/tetragon:latest" --build-arg TETRAGON_VERSION=$(make version)

Feel free to reopen this issue if you still have the issue, I'm curious to debug this but for now I can't really investigate more 🤔.

inliquid commented 11 months ago

Hi @mtardy thanks, this command works:

docker build -t "cilium/tetragon:latest" --build-arg TETRAGON_VERSION=$(make version)

However make image still generates lots of compile errors thus preventing it from being built as suggested by Makefile scenario.

I think that problem still persists and needs to be addressed. So either Makefile should exclude compilation of bpftool, or compilation process should be fixed, or the source of the issue identified. May I kindly ask to reopen the issue?

mtardy commented 11 months ago

Hi @mtardy thanks, this command works:


docker build -t "cilium/tetragon:latest" --build-arg TETRAGON_VERSION=$(make version)

However make image still generates lots of compile errors thus preventing it from being built as suggested by Makefile scenario.

I think that problem still persists and needs to be addressed. So either Makefile should exclude compilation of bpftool, or compilation process should be fixed, or the source of the issue identified. May I kindly ask to reopen the issue?

Yes you can reopen but I don't understand how to reproduce your issue so I cannot really help you for now :(

inliquid commented 11 months ago

Maybe I can collect more info to help investigate it, just let me know what else needed.

mtardy commented 11 months ago

Maybe I can collect more info to help investigate it, just let me know what else needed.

Can you reproduce this on a system I can quickly spin a VM in a cloud provider for example?

HandyDaddy commented 10 months ago

Change in Dockerfile ENV BPFTOOL_REV "b01941c8f7890489f09713348a7d89567538504b" -> ENV BPFTOOL_REV "8485b9fba9b3bb3bd311b00632d2d22c0eee2e13" It's working for me

mtardy commented 10 months ago

Change in Dockerfile ENV BPFTOOL_REV "b01941c8f7890489f09713348a7d89567538504b" -> ENV BPFTOOL_REV "8485b9fba9b3bb3bd311b00632d2d22c0eee2e13" It's working for me

is it failing for you with the other REV? on which distrib are you running?

HandyDaddy commented 10 months ago

Change in Dockerfile ENV BPFTOOL_REV "b01941c8f7890489f09713348a7d89567538504b" -> ENV BPFTOOL_REV "8485b9fba9b3bb3bd311b00632d2d22c0eee2e13" It's working for me

is it failing for you with the other REV? on which distrib are you running?

yes, it is falling on the other Rev. I use fedora. discussion of this problem: https://github.com/libbpf/bpftool/issues/17

sadath-12 commented 9 months ago

@inliquid is it solved ? @mtardy please have a look at this too . I am also not able to build images in wsl2 given I graduated from https://github.com/cilium/cilium/issues/29302 --

sadath@sadath:~/go/src/tetragon$ make image image-operator

Cannot load builder desktop-linux: protocol not available
docker build -t "cilium/tetragon:latest" --target release --build-arg TETRAGON_VERSION=9fd23842 --platform=linux/amd64 .
[+] Building 288.3s (33/36)
 => [internal] load build definition from Dockerfile                                                               0.1s
 => => transferring dockerfile: 5.70kB                                                                             0.0s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 580B                                                                                  0.0s
 => [internal] load metadata for docker.io/library/alpine:3.19.0@sha256:51b67269f354137895d43f3b3d810bfacd3945438  3.5s
 => [internal] load metadata for docker.io/library/golang:1.21.5-alpine@sha256:4db4aac30880b978cae5445dd4a7062152  3.5s
 => [internal] load metadata for quay.io/cilium/clang:aeaada5cf60efe8d0e772d032fe3cc2bc613739c@sha256:b440ae7b359  0.0s
 => [internal] load metadata for docker.io/library/golang:1.21.5@sha256:672a2286da3ee7a854c3e0a56e0838918d0dbb1c1  3.5s
 => [auth] library/golang:pull token for registry-1.docker.io                                                      0.0s
 => [auth] library/alpine:pull token for registry-1.docker.io                                                      0.0s
 => [internal] load build context                                                                                  4.7s
 => => transferring context: 173.32MB                                                                              4.3s
 => [base-build 1/9] FROM docker.io/library/alpine:3.19.0@sha256:51b67269f354137895d43f3b3d810bfacd3945438e94dc5a  0.0s
 => [gops 1/2] FROM docker.io/library/golang:1.21.5-alpine@sha256:4db4aac30880b978cae5445dd4a706215249ad4f43d28bd  0.0s
 => [tetragon-builder 1/4] FROM docker.io/library/golang:1.21.5@sha256:672a2286da3ee7a854c3e0a56e0838918d0dbb1c18  0.0s
 => [bpftool-builder 1/7] FROM quay.io/cilium/clang:aeaada5cf60efe8d0e772d032fe3cc2bc613739c@sha256:b440ae7b3591a  0.0s
 => CACHED [bpftool-builder 2/7] WORKDIR /bpftool                                                                  0.0s
 => CACHED [bpftool-builder 3/7] RUN if [ amd64 != amd64 ];     then apt-get update && echo "deb [arch=amd64] htt  0.0s
 => CACHED [bpftool-builder 4/7] RUN apt-get update                                                                0.0s
 => ERROR [bpftool-builder 5/7] RUN if [ amd64 != amd64 ];     then apt-get install -y curl git llvm gcc pkg-co  284.7s
 => CACHED [tetragon-builder 2/4] WORKDIR /go/src/github.com/cilium/tetragon                                       0.0s
 => CACHED [bpf-builder 2/5] WORKDIR /go/src/github.com/cilium/tetragon                                            0.0s
 => CACHED [bpf-builder 3/5] RUN apt-get update && apt-get install -y linux-libc-dev                               0.0s
 => [bpf-builder 4/5] COPY . ./                                                                                    4.0s
 => [tetragon-builder 3/4] COPY . .                                                                                4.0s
 => [tetragon-builder 4/4] RUN make VERSION=9fd23842 TARGET_ARCH=amd64 tetragon tetra tetragon-oci-hook tetrago  149.6s
 => [bpf-builder 5/5] RUN make tetragon-bpf LOCAL_CLANG=1 TARGET_ARCH=amd64                                       38.8s
 => CACHED [gops 2/2] RUN apk add --no-cache git  && git clone --depth 1 --branch v0.3.28 https://github.com/goog  0.0s
 => CACHED [base-build 2/9] RUN apk add iproute2                                                                   0.0s
 => CACHED [base-build 3/9] RUN mkdir /var/lib/tetragon/ &&     mkdir -p /etc/tetragon/tetragon.conf.d/ &&     mk  0.0s
 => [base-build 4/9] COPY --from=tetragon-builder /go/src/github.com/cilium/tetragon/tetragon /usr/bin/            0.2s
 => [base-build 5/9] COPY --from=tetragon-builder /go/src/github.com/cilium/tetragon/tetra /usr/bin/               0.2s
 => [base-build 6/9] COPY --from=tetragon-builder /go/src/github.com/cilium/tetragon/contrib/rthooks/tetragon-oci  0.1s
 => [base-build 7/9] COPY --from=tetragon-builder /go/src/github.com/cilium/tetragon/contrib/rthooks/tetragon-oci  0.1s
 => [base-build 8/9] COPY --from=gops /gops/gops /usr/bin/                                                         0.1s
 => [base-build 9/9] COPY --from=bpf-builder /go/src/github.com/cilium/tetragon/bpf/objs/*.o /var/lib/tetragon/    0.2s
------
 > [bpftool-builder 5/7] RUN if [ amd64 != amd64 ];     then apt-get install -y curl git llvm gcc pkg-config zlib1g-dev libelf-dev libelf-dev:arm64 libcap-dev:arm64 crossbuild-essential-amd64;     else apt-get install -y curl git llvm gcc pkg-config zlib1g-dev libelf-dev libcap-dev; fi:
#33 0.784 Reading package lists...
#33 2.822 Building dependency tree...
#33 3.287 Reading state information...
#33 3.819 The following additional packages will be installed:
#33 3.819   bzip2 ca-certificates cpp cpp-11 gcc-11 gcc-11-base gcc-12-base git-man less
#33 3.819   lib32gcc-s1 lib32stdc++6 libasan6 libatomic1 libbrotli1 libcap2 libcbor0.8
#33 3.819   libcc1-0 libcurl3-gnutls libcurl4 libdpkg-perl libelf1 liberror-perl
#33 3.819   libexpat1 libfido2-1 libfile-fcntllock-perl libgcc-11-dev libgcc-s1
#33 3.819   libgdbm-compat4 libgdbm6 libglib2.0-0 libglib2.0-data libgomp1 libisl23
#33 3.819   libitm1 libldap-2.5-0 libldap-common liblocale-gettext-perl liblsan0 libmpc3
#33 3.819   libmpfr6 libnghttp2-14 libobjc-11-dev libobjc4 libperl5.34 libpsl5
#33 3.819   libquadmath0 librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db
#33 3.819   libssh-4 libstdc++-11-dev libstdc++6 libtsan0 libubsan1 libx11-6 libx11-data
#33 3.819   libxau6 libxcb1 libxdmcp6 libxext6 libxmuu1 llvm-runtime netbase
#33 3.819   openssh-client openssl patch perl perl-base perl-modules-5.34 publicsuffix
#33 3.819   shared-mime-info xauth xdg-user-dirs xz-utils
#33 3.819 Suggested packages:
#33 3.819   bzip2-doc cpp-doc gcc-11-locales gcc-multilib manpages-dev autoconf automake
#33 3.819   libtool flex bison gdb gcc-doc gcc-11-multilib gcc-11-doc gettext-base
#33 3.819   git-daemon-run | git-daemon-sysvinit git-doc git-email git-gui gitk gitweb
#33 3.819   git-cvs git-mediawiki git-svn debian-keyring gnupg bzr gdbm-l10n
#33 3.819   libsasl2-modules-gssapi-mit | libsasl2-modules-gssapi-heimdal
#33 3.819   libsasl2-modules-ldap libsasl2-modules-otp libsasl2-modules-sql
#33 3.819   libstdc++-11-doc keychain libpam-ssh monkeysphere ssh-askpass ed
#33 3.819   diffutils-doc perl-doc libterm-readline-gnu-perl
#33 3.819   | libterm-readline-perl-perl libtap-harness-archive-perl dpkg-dev
#33 4.132 The following NEW packages will be installed:
#33 4.132   bzip2 ca-certificates cpp cpp-11 curl gcc gcc-11 git git-man less libbrotli1
#33 4.133   libcap-dev libcbor0.8 libcc1-0 libcurl3-gnutls libcurl4 libdpkg-perl
#33 4.133   libelf-dev libelf1 liberror-perl libexpat1 libfido2-1 libfile-fcntllock-perl
#33 4.133   libgdbm-compat4 libgdbm6 libglib2.0-0 libglib2.0-data libisl23 libldap-2.5-0
#33 4.133   libldap-common liblocale-gettext-perl libmpc3 libmpfr6 libnghttp2-14
#33 4.133   libperl5.34 libpsl5 librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db
#33 4.134   libssh-4 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxmuu1
#33 4.136   llvm llvm-runtime netbase openssh-client openssl patch perl
#33 4.136   perl-modules-5.34 pkg-config publicsuffix shared-mime-info xauth
#33 4.136   xdg-user-dirs xz-utils zlib1g-dev
#33 4.136 The following packages will be upgraded:
#33 4.142   gcc-11-base gcc-12-base lib32gcc-s1 lib32stdc++6 libasan6 libatomic1 libcap2
#33 4.142   libgcc-11-dev libgcc-s1 libgomp1 libitm1 liblsan0 libobjc-11-dev libobjc4
#33 4.142   libquadmath0 libstdc++-11-dev libstdc++6 libtsan0 libubsan1 perl-base
#33 4.803 20 upgraded, 63 newly installed, 0 to remove and 41 not upgraded.
#33 4.803 Need to get 68.1 MB of archives.
#33 4.803 After this operation, 184 MB of additional disk space will be used.
#33 4.803 Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 perl-base amd64 5.34.0-3ubuntu1.3 [1762 kB]
#33 11.63 Get:2 http://archive.ubuntu.com/ubuntu jammy/main amd64 liblocale-gettext-perl amd64 1.07-4build3 [17.1 kB]
#33 12.76 Get:3 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 perl-modules-5.34 all 5.34.0-3ubuntu1.3 [2976 kB]
#33 18.42 Get:4 http://archive.ubuntu.com/ubuntu jammy/main amd64 libgdbm6 amd64 1.23-1 [33.9 kB]
#33 19.32 Get:5 http://archive.ubuntu.com/ubuntu jammy/main amd64 libgdbm-compat4 amd64 1.23-1 [6606 B]
#33 19.83 Get:6 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libperl5.34 amd64 5.34.0-3ubuntu1.3 [4820 kB]
#33 37.74 Get:7 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 perl amd64 5.34.0-3ubuntu1.3 [232 kB]
#33 39.36 Get:8 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 lib32gcc-s1 amd64 12.3.0-1ubuntu1~22.04 [63.9 kB]
#33 40.51 Get:9 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libubsan1 amd64 12.3.0-1ubuntu1~22.04 [976 kB]
#33 45.93 Get:10 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gcc-12-base amd64 12.3.0-1ubuntu1~22.04 [20.1 kB]
#33 47.09 Get:11 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libstdc++6 amd64 12.3.0-1ubuntu1~22.04 [699 kB]
#33 50.91 Get:12 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libquadmath0 amd64 12.3.0-1ubuntu1~22.04 [154 kB]
#33 53.78 Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 libobjc4 amd64 12.3.0-1ubuntu1~22.04 [48.6 kB]
#33 55.29 Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 liblsan0 amd64 12.3.0-1ubuntu1~22.04 [1069 kB]
#33 59.27 Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libitm1 amd64 12.3.0-1ubuntu1~22.04 [30.2 kB]
#33 61.70 Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libgomp1 amd64 12.3.0-1ubuntu1~22.04 [126 kB]
#33 63.03 Get:17 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libatomic1 amd64 12.3.0-1ubuntu1~22.04 [10.4 kB]
#33 64.27 Get:18 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 lib32stdc++6 amd64 12.3.0-1ubuntu1~22.04 [740 kB]
#33 67.10 Get:19 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libgcc-s1 amd64 12.3.0-1ubuntu1~22.04 [53.9 kB]
#33 68.17 Get:20 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libcap2 amd64 1:2.44-1ubuntu0.22.04.1 [18.3 kB]
#33 68.98 Get:21 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 openssl amd64 3.0.2-0ubuntu1.12 [1182 kB]
#33 74.74 Get:22 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 ca-certificates all 20230311ubuntu0.22.04.1 [155 kB]
#33 76.37 Get:23 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 less amd64 590-1ubuntu0.22.04.1 [143 kB]
#33 77.99 Get:24 http://archive.ubuntu.com/ubuntu jammy/main amd64 libelf1 amd64 0.186-1build1 [51.0 kB]
#33 79.22 Get:25 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libexpat1 amd64 2.4.7-1ubuntu0.2 [91.0 kB]
#33 80.51 Get:26 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libglib2.0-0 amd64 2.72.4-0ubuntu2.2 [1463 kB]
#33 87.51 Get:27 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libglib2.0-data all 2.72.4-0ubuntu2.2 [4612 B]
#33 88.27 Get:28 http://archive.ubuntu.com/ubuntu jammy/main amd64 netbase all 6.3 [12.9 kB]
#33 88.74 Get:29 http://archive.ubuntu.com/ubuntu jammy/main amd64 shared-mime-info amd64 2.1-2 [454 kB]
#33 91.39 Get:30 http://archive.ubuntu.com/ubuntu jammy/main amd64 xdg-user-dirs amd64 0.17-2ubuntu4 [53.9 kB]
#33 92.48 Get:31 http://archive.ubuntu.com/ubuntu jammy/main amd64 libcbor0.8 amd64 0.8.0-2ubuntu1 [24.6 kB]
#33 93.96 Get:32 http://archive.ubuntu.com/ubuntu jammy/main amd64 libfido2-1 amd64 1.10.0-1 [82.8 kB]
#33 95.36 Get:33 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libnghttp2-14 amd64 1.43.0-1ubuntu0.1 [76.7 kB]
#33 96.45 Get:34 http://archive.ubuntu.com/ubuntu jammy/main amd64 libpsl5 amd64 0.21.0-1.2build2 [58.4 kB]
#33 97.86 Get:35 http://archive.ubuntu.com/ubuntu jammy/main amd64 libxau6 amd64 1:1.0.9-1build5 [7634 B]
#33 99.44 Get:36 http://archive.ubuntu.com/ubuntu jammy/main amd64 libxdmcp6 amd64 1:1.1.3-0ubuntu5 [10.9 kB]
#33 99.91 Get:37 http://archive.ubuntu.com/ubuntu jammy/main amd64 libxcb1 amd64 1.14-3ubuntu3 [49.0 kB]
#33 101.2 Get:38 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libx11-data all 2:1.7.5-1ubuntu0.3 [120 kB]
#33 103.0 Get:39 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libx11-6 amd64 2:1.7.5-1ubuntu0.3 [667 kB]
#33 105.1 Get:40 http://archive.ubuntu.com/ubuntu jammy/main amd64 libxext6 amd64 2:1.3.4-1build1 [31.8 kB]
#33 106.1 Get:41 http://archive.ubuntu.com/ubuntu jammy/main amd64 libxmuu1 amd64 2:1.1.3-3 [10.2 kB]
#33 106.6 Ign:42 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 openssh-client amd64 1:8.9p1-3ubuntu0.5
#33 107.1 Get:43 http://archive.ubuntu.com/ubuntu jammy/main amd64 publicsuffix all 20211207.1025-1 [129 kB]
#33 107.8 Err:42 http://security.ubuntu.com/ubuntu jammy-updates/main amd64 openssh-client amd64 1:8.9p1-3ubuntu0.5
#33 107.8   404  Not Found [IP: 185.125.190.36 80]
#33 109.5 Get:44 http://archive.ubuntu.com/ubuntu jammy/main amd64 xauth amd64 1:1.1-1build2 [27.5 kB]
#33 110.3 Get:45 http://archive.ubuntu.com/ubuntu jammy/main amd64 xz-utils amd64 5.2.5-2ubuntu1 [84.8 kB]
#33 111.6 Get:46 http://archive.ubuntu.com/ubuntu jammy/main amd64 bzip2 amd64 1.0.8-5build1 [34.8 kB]
#33 112.4 Get:47 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libasan6 amd64 11.4.0-1ubuntu1~22.04 [2282 kB]
#33 119.3 Get:48 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 libobjc-11-dev amd64 11.4.0-1ubuntu1~22.04 [196 kB]
#33 121.9 Get:49 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libstdc++-11-dev amd64 11.4.0-1ubuntu1~22.04 [2101 kB]
#33 132.0 Get:50 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libgcc-11-dev amd64 11.4.0-1ubuntu1~22.04 [2517 kB]
#33 144.3 Get:51 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libtsan0 amd64 11.4.0-1ubuntu1~22.04 [2260 kB]
#33 149.5 Get:52 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gcc-11-base amd64 11.4.0-1ubuntu1~22.04 [20.2 kB]
#33 150.5 Get:53 http://archive.ubuntu.com/ubuntu jammy/main amd64 libisl23 amd64 0.24-2build1 [727 kB]
#33 153.4 Get:54 http://archive.ubuntu.com/ubuntu jammy/main amd64 libmpfr6 amd64 4.1.0-3build3 [1425 kB]
#33 166.5 Get:55 http://archive.ubuntu.com/ubuntu jammy/main amd64 libmpc3 amd64 1.2.1-2build1 [46.9 kB]
#33 168.0 Get:56 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 cpp-11 amd64 11.4.0-1ubuntu1~22.04 [10.0 MB]
#33 182.0 Get:57 http://archive.ubuntu.com/ubuntu jammy/main amd64 cpp amd64 4:11.2.0-1ubuntu1 [27.7 kB]
#33 183.4 Get:58 http://archive.ubuntu.com/ubuntu jammy/main amd64 libbrotli1 amd64 1.0.9-2build6 [315 kB]
#33 186.4 Get:59 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libsasl2-modules-db amd64 2.1.27+dfsg2-3ubuntu1.2 [20.5 kB]
#33 187.5 Get:60 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libsasl2-2 amd64 2.1.27+dfsg2-3ubuntu1.2 [53.8 kB]
#33 189.2 Get:61 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libldap-2.5-0 amd64 2.5.16+dfsg-0ubuntu0.22.04.1 [183 kB]
#33 199.8 Get:62 http://archive.ubuntu.com/ubuntu jammy/main amd64 librtmp1 amd64 2.4+20151223.gitfa8646d.1-2build4 [58.2 kB]
#33 210.8 Get:63 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libssh-4 amd64 0.9.6-2ubuntu0.22.04.2 [186 kB]
#33 212.9 Get:64 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libcurl4 amd64 7.81.0-1ubuntu1.15 [289 kB]
#33 214.9 Get:65 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 curl amd64 7.81.0-1ubuntu1.15 [194 kB]
#33 217.2 Get:66 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libcc1-0 amd64 12.3.0-1ubuntu1~22.04 [48.3 kB]
#33 218.9 Get:67 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 gcc-11 amd64 11.4.0-1ubuntu1~22.04 [20.1 MB]
#33 248.6 Get:68 http://archive.ubuntu.com/ubuntu jammy/main amd64 gcc amd64 4:11.2.0-1ubuntu1 [5112 B]
#33 249.8 Get:69 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libcurl3-gnutls amd64 7.81.0-1ubuntu1.15 [284 kB]
#33 251.2 Get:70 http://archive.ubuntu.com/ubuntu jammy/main amd64 liberror-perl all 0.17029-1 [26.5 kB]
#33 252.1 Get:71 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 git-man all 1:2.34.1-1ubuntu1.10 [954 kB]
#33 257.0 Get:72 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 git amd64 1:2.34.1-1ubuntu1.10 [3166 kB]
#33 270.5 Get:73 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libcap-dev amd64 1:2.44-1ubuntu0.22.04.1 [39.4 kB]
#33 271.4 Get:74 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libdpkg-perl all 1.21.1ubuntu2.2 [237 kB]
#33 272.8 Get:75 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 zlib1g-dev amd64 1:1.2.11.dfsg-2ubuntu9.2 [164 kB]
#33 274.2 Get:76 http://archive.ubuntu.com/ubuntu jammy/main amd64 libelf-dev amd64 0.186-1build1 [64.4 kB]
#33 275.4 Get:77 http://archive.ubuntu.com/ubuntu jammy/main amd64 libfile-fcntllock-perl amd64 0.22-3build7 [33.9 kB]
#33 276.4 Get:78 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libldap-common all 2.5.16+dfsg-0ubuntu0.22.04.1 [15.8 kB]
#33 277.1 Get:79 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libsasl2-modules amd64 2.1.27+dfsg2-3ubuntu1.2 [68.8 kB]
#33 278.0 Get:80 http://archive.ubuntu.com/ubuntu jammy/universe amd64 llvm-runtime amd64 1:14.0-55~exp2 [3204 B]
#33 278.5 Get:81 http://archive.ubuntu.com/ubuntu jammy/universe amd64 llvm amd64 1:14.0-55~exp2 [3758 B]
#33 279.0 Get:82 http://archive.ubuntu.com/ubuntu jammy/main amd64 patch amd64 2.7.6-7build2 [109 kB]
#33 282.0 Get:83 http://archive.ubuntu.com/ubuntu jammy/main amd64 pkg-config amd64 0.29.2-1ubuntu3 [48.2 kB]
#33 284.6 Fetched 67.2 MB in 4min 40s (240 kB/s)
#33 284.6 E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openssh/openssh-client_8.9p1-3ubuntu0.5_amd64.deb  404  Not Found [IP: 185.125.190.36 80]
#33 284.6 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
------
executor failed running [/bin/sh -c if [ $BUILDARCH != $TARGETARCH ];     then apt-get install -y curl git llvm gcc pkg-config zlib1g-dev libelf-dev libelf-dev:arm64 libcap-dev:arm64 crossbuild-essential-$TARGETARCH;     else apt-get install -y curl git llvm gcc pkg-config zlib1g-dev libelf-dev libcap-dev; fi]: exit code: 100
make: *** [Makefile:284: image] Error 1
inliquid commented 9 months ago

@sadath-12 no I'm still observing it with latest tetragon code (from the main branch). For WSL2 you would also probably need to compile bpftool from source. I tried it few times, but found that hyper-v based VM is more convenient when working with tetragon installations.

sadath-12 commented 9 months ago

I would try compiling the bpftool from source . any instructions @inliquid ? since I'm not super familiar with those internal things and might not to do it efficiently by myself

mtardy commented 9 months ago

Hey @inliquid I could reproduce on 5.10, will try to fix this :)

inliquid commented 9 months ago

The problem is still here: изображение

mtardy commented 9 months ago

The problem is still here: изображение

Have you tried with latest main? Can you please give me your exact kernel version? In the meantime, I propose you to build images without compiling bfptool, so just use the same command as make image but without target=release

mtardy commented 9 months ago

I have an idea in mind to avoid this issue in the future: maintain a bpftool docker image that I can reuse because we'll see issues like this happen in the future since bpftool depends on the kernel it runs regardless of Docker.

inliquid commented 9 months ago

Have you tried with latest main? Can you please give me your exact kernel version? In the meantime, I propose you to build images without compiling bfptool, so just use the same command as make image but without target=release

  1. This is from latest main
  2. $ uname -a
    Linux mint-vm 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
  3. This is result of running make image without target=release
mtardy commented 9 months ago

Ok thanks! Let's see with the same kernel version.

3. This is result of running make image without target=release

I don't understand as this seems impossible as without --target release you don't build bpftool so you can't have bpftool building errors.

This is what you can use to build Tetragon:

docker build -t "cilium/tetragon:latest" --build-arg TETRAGON_VERSION=$(make version)
inliquid commented 9 months ago

I don't understand as this seems impossible as without --target release you don't build bpftool so you can't have bpftool building errors.

I must have misunderstood, I meant that there wasn't any other parameter given to make, but apparently --target=release been passed to docker build:

$ make image
docker build -t "cilium/tetragon:latest" --target release --build-arg TETRAGON_VERSION=v1.1.0-pre.0-321-g95974f4b --platform=linux/amd64 .