Open carlosperate opened 11 months ago
I'm facing this as well, not sure what the reason is, since zlib is present in the third_party sources.
I even tried with disabling zlib in protobuf, just to see what would happen, and it failed to even compile zlib itself!
[258/375] Building C object third_party/zlib/CMakeFiles/minigzip.dir/test/minigzip.o
FAILED: third_party/zlib/CMakeFiles/minigzip.dir/test/minigzip.o
/dev/bin/x86_64-conda_cos6-linux-gnu-cc -DUSE_RE2 -D_LARGEFILE64_SOURCE=1 -D_LIBCXXABI_FUNC_VIS="" -I/dev/bloaty/re2 -I/dev/bloaty/capstone/include -I/dev/bloaty/build/third_party/zlib -I/dev/bloaty -isystem /dev/bloaty/protobuf/src -O2 -g -DNDEBUG -MD -MT third_party/zlib/CMakeFiles/minigzip.dir/test/minigzip.o -MF third_party/zlib/CMakeFiles/minigzip.dir/test/minigzip.o.d -o third_party/zlib/CMakeFiles/minigzip.dir/test/minigzip.o -c /dev/bloaty/zlib/test/minigzip.c
/dev/bloaty/zlib/test/minigzip.c:18:10: fatal error: zlib.h: No such file or directory
#include "zlib.h"
^~~~~~~~
compilation terminated.
[259/375] Building C object third_party/zlib/CMakeFiles/example.dir/test/example.o
FAILED: third_party/zlib/CMakeFiles/example.dir/test/example.o
/dev/bin/x86_64-conda_cos6-linux-gnu-cc -DUSE_RE2 -D_LARGEFILE64_SOURCE=1 -D_LIBCXXABI_FUNC_VIS="" -I/dev/bloaty/re2 -I/dev/bloaty/capstone/include -I/dev/bloaty/build/third_party/zlib -I/dev/bloaty -isystem /dev/bloaty/protobuf/src -O2 -g -DNDEBUG -MD -MT third_party/zlib/CMakeFiles/example.dir/test/example.o -MF third_party/zlib/CMakeFiles/example.dir/test/example.o.d -o third_party/zlib/CMakeFiles/example.dir/test/example.o -c /dev/bloaty/zlib/test/example.c
/dev/bloaty/zlib/test/example.c:8:10: fatal error: zlib.h: No such file or directory
#include "zlib.h"
^~~~~~~~
compilation terminated.
[275/375] Building CXX object third_party/protobuf/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/js/js_generator.cc.o
ninja: build stopped: subcommand failed
Builds fine when
libz-dev
is installed in Ubuntu 22.04, but without it, it tries to use the local submodule sources and fails to findzlib.h
.To replicate, the simplest method might be to use docker:
If
libz-dev
is added to theapt-get install
line, it builds correctly using the system zlib.