0.28.0: despite cmake showing missing zlib it did not exit with non-zero exit code
- Dominant language
- C
- Stars
- 22.7k
- Forks
- 4.1k
- Avg merge
- 10d 4h
- Merged PRs (30d)
- 3
Description
From cmake ouput:
```console
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Found LibXml2: /usr/lib64/libxml2.so (found version "2.11.5")
-- Found LLVM: /usr/include 17.0.3 (Use LLVM_ROOT envronment variable for another version of LLVM)
-- Found BISON: /usr/bin/bison (found version "3.8.2")
-- Found FLEX: /usr/bin/flex (found version "2.6.4")
-- Found LibElf: /usr/lib64/libelf.so
-- Performing Test ELF_GETSHDRSTRNDX
-- Performing Test ELF_GETSHDRSTRNDX - Success
-- Could NOT find LibDebuginfod (missing: LIBDEBUGINFOD_LIBRARIES LIBDEBUGINFOD_INCLUDE_DIRS)
-- Could NOT find LibLzma (missing: LIBLZMA_LIBRARIES LIBLZMA_INCLUDE_DIRS)
-- Found LuaJIT: /usr/lib64/libluajit-5.1.so;/usr/lib64/libdl.a;/usr/lib64/libm.so
-- Configuring done (2.2s)
-- Generating done (0.1s)
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_Fortran_FLAGS_RELEASE
INCLUDE_INSTALL_DIR
LIB_INSTALL_DIR
LIB_SUFFIX
SHARE_INSTALL_PREFIX
SYSCONF_INSTALL_DIR
-- Build files have been written to: /home/tkloczko/rpmbuild/BUILD/bcc/x86_64-redhat-linux-gnu
```
and as result build failed with:
```console
[ 33%] Building C object src/cc/CMakeFiles/bpf-shared.dir/libbpf/src/str_error.c.o
cd /home/tkloczko/rpmbuild/BUILD/bcc/x86_64-redhat-linux-gnu/src/cc && /usr/bin/gcc -DEXPORT_USDT -Dbpf_shared_EXPORTS -I/usr/include/../tools/clang/include -I/home/tkloczko/rpmbuild/BUILD/
bcc/src -I/home/tkloczko/rpmbuild/BUILD/bcc/x86_64-redhat-linux-gnu/src -I/home/tkloczko/rpmbuild/BUILD/bcc/x86_64-redhat-linux-gnu/src/cc -I/home/tkloczko/rpmbuild/BUILD/bcc/src/cc -I/home
/tkloczko/rpmbuild/BUILD/bcc/x86_64-redhat-linux-gnu/src/cc/frontends/b -I/home/tkloczko/rpmbuild/BUILD/bcc/src/cc/frontends/b -I/home/tkloczko/rpmbuild/BUILD/bcc/src/cc/frontends/clang -I/
home/tkloczko/rpmbuild/BUILD/bcc/src/cc/libbpf/include -I/home/tkloczko/rpmbuild/BUILD/bcc/src/cc/libbpf/include/uapi -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U
_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit
-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-pa
rtition=none -Wall -fPIC -Wno-unused-result -DNDEBUG -fPIC -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -MD -MT src/cc/CMakeFiles/bpf-shared.dir/libbp
f/src/ringbuf.c.o -MF CMakeFiles/bpf-shared.dir/libbpf/src/ringbuf.c.o.d -o CMakeFiles/bpf-shared.dir/libbpf/src/ringbuf.c.o -c /home/tkloczko/rpmbuild/BUILD/bcc/src/cc/libbpf/src/ringbuf.c
/home/tkloczko/rpmbuild/BUILD/bcc/src/cc/libbpf/src/libbpf.c:47:10: fatal error: zlib.h: No such file or directory
47 | #include
| ^~~~~~~~
compilation terminated.
/home/tkloczko/rpmbuild/BUILD/bcc/src/cc/libbpf/src/libbpf.c:47:10: fatal error: zlib.h: No such file or directory
47 | #include
| ^~~~~~~~
compilation terminated.
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by examining the CMake configuration checks that report the missing zlib dependency, then compare them with the build target that includes src/cc/libbpf/src/libbpf.c. Reproduce the configuration without zlib and verify that it exits non-zero before compilation begins.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cmake
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100