Misleading build error: Fails to find libbpf, even though it is installed
envgap__bpftrace__bpftrace-4745
01 / FAILURE SIGNATURE
As reported upstream
Libbpf version is too old and does not have libbpf_version.h, which was
Not a benchmark task.
- In a clean container the reported failure did not reproduce, or the known fix did not make the project run.
02 / ENVIRONMENT RECIPE
- Base commit
57c2b586331a9a6d0288f69e14d2b7cfea11bc3b- Manifest
CMakeLists.txt- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
bpftrace/bpftrace #4745 · read the original issue
<!-- Note: bpftrace is under active development and not all distros ship the most recent version yet. Please make sure the bug reproduces on the latest release or master. --> ### What reproduces the bug? Provide code if possible. ```console ❯ cmake -S bpftrace -B build -G Ninja -- The C compiler identification is GNU 15.2.1 -- The CXX compiler identification is GNU 15.2.1 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found ZLIB: /usr/lib/libz.so (found version "1.3.1") -- Found LibBcc: /usr/lib/libbcc.so -- Looking for bcc_usdt_foreach -- Looking for bcc_usdt_foreach - found -- Found LibBpf: /home/arvid/src/aur/bpftrace-git/src/build/libbpf/include CMake Error at cmake/FindLibBpf.cmake:85 (message): Libbpf version is too old and does not have libbpf_version.h, which was introduced in v0.6 Call Stack (most recent call first): CMakeLists.txt:104 (find_package) ``` This is very odd because the directory it mentions doesn't exist: ```console ❯ ls /home/arvid/src/aur/bpftrace-git/src/build/libbpf/include ls: cannot access '/home/arvid/src/aur/bpftrace-git/src/build/libbpf/include': No such file or directory ``` Also libbpf is newer than 0.6 (it is even a git revision!): ```console ❯ pacman -Qi libbpf-git Name : libbpf-git Version : 1.6.2.r25.g3f077472-1 [...] ``` And the mentioned header exists: ```console ❯ pacman -Ql libbpf-git libbpf-git /usr/ libbpf-git /usr/include/ libbpf-git /usr/include/bpf/ libbpf-git /usr/include/bpf/bpf.h libbpf-git /usr/include/bpf/bpf_core_read.h libbpf-git /usr/include/bpf/bpf_endian.h libbpf-git /usr/include/bpf/bpf_helper_defs.h libbpf-git /usr/include/bpf/bpf_helpers.h libbpf-git /usr/include/bpf/bpf_tracing.h libbpf-git /usr/include/bpf/btf.h libbpf-git /usr/include/bpf/libbpf.h libbpf-git /usr/include/bpf/libbpf_common.h libbpf-git /usr/include/bpf/libbpf_legacy.h libbpf-git /usr/include/bpf/libbpf_version.h libbpf-git /usr/include/bpf/skel_internal.h libbpf-git /usr/include/bpf/usdt.bpf.h libbpf-git /usr/lib/ libbpf-git /usr/lib/libbpf.a libbpf-git /usr/lib/libbpf.so libbpf-git /usr/lib/libbpf.so.1 libbpf-git /usr/lib/libbpf.so.1.7.0 libbpf-git /usr/lib/pkgconfig/ libbpf-git /usr/lib/pkgconfig/libbpf.pc libbpf-git /usr/share/ libbpf-git /usr/share/doc/ libbpf-git /usr/share/doc/libbpf/ libbpf-git /usr/share/doc/libbpf/README.md libbpf-git /usr/share/licenses/ libbpf-git /usr/share/licenses/libbpf/ libbpf-git /usr/share/licenses/libbpf/LICENSE.BSD-2-Clause ``` ### `bpftrace --info` output N/A as I can't even build. Git revision 57c2b5863 Last *known* working revision is c47f16f5, I don't know where in between this broke.
04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]