libbpf unusable on edge
Hello,
libbpf has been updated to 0.6.1 ahead of linux-headers again so is unusable right now:
# apk add libbpf-dev linux-headers
# echo '#include <bpf/btf.h>' | gcc -xc -c -o /dev/null -
In file included from <stdin>:1:
/usr/include/bpf/btf.h: In function 'btf_is_mod':
/usr/include/bpf/btf.h:463:24: error: 'BTF_KIND_TYPE_TAG' undeclared (first use in this function); did you mean 'BTF_KIND_TYPEDEF'?
463 | kind == BTF_KIND_TYPE_TAG;
| ^~~~~~~~~~~~~~~~~
| BTF_KIND_TYPEDEF
/usr/include/bpf/btf.h:463:24: note: each undeclared identifier is reported only once for each function it appears in
/usr/include/bpf/btf.h: In function 'btf_is_decl_tag':
/usr/include/bpf/btf.h:493:31: error: 'BTF_KIND_DECL_TAG' undeclared (first use in this function); did you mean 'BTF_KIND_FLOAT'?
493 | return btf_kind(t) == BTF_KIND_DECL_TAG;
| ^~~~~~~~~~~~~~~~~
| BTF_KIND_FLOAT
/usr/include/bpf/btf.h: In function 'btf_is_type_tag':
/usr/include/bpf/btf.h:498:31: error: 'BTF_KIND_TYPE_TAG' undeclared (first use in this function); did you mean 'BTF_KIND_TYPEDEF'?
498 | return btf_kind(t) == BTF_KIND_TYPE_TAG;
| ^~~~~~~~~~~~~~~~~
| BTF_KIND_TYPEDEF
The problem is the same as usual: bpf/btf.h
expects a linux/btf.h
header that's newer than what we actually have.
In particular, a few weeks ago they expected a linux/btf.h that wasn't even merged in mainstream linux for the 0.6.0 release..... I didn't recheck recently, it's possible a linux-header update might fix things, I'll confirm tomorrow.
For reference, what we ended up doing for nixos was to package the linux/btf.h
header present in libbpf source tree instead of the one in linux, see here for details: https://github.com/NixOS/nixpkgs/pull/148535#issuecomment-986012436
I'd think it could make sense to do the same for alpine, do we have a way of checking what alpine packages provide files that include linux/btf.h? Looking at debian code search https://codesearch.debian.net/search?q=linux%2Fbtf.h&literal=1&perpkg=1 the only packages using the files also depend on libbpf so this wouldn't be a problem if we're similar here.