grpc / grpc/grpc

[Build] gRPC build errors with zlib v1.3.2

Open
#41,958 5 comments 0 reactions 1 assignee Claimed by @yuanweiz View on GitHub
disposition/never stale
Dominant language
C++
Stars
45.3k
Forks
11.4k
Avg merge
2d 12h
Merged PRs (30d)
47

Description

Zlib seems to officially support 2 build systems: autotools and cmake. A `zconf.h` is generated at build time, through one of the 2 means:
```
# This updates the zconf.h file inplace
./configure
```
or
```
# This adds -I option to $CC which takes priority over the vendored zconf.h
mkdir build
cd build && cmake ..
```

It also venders a zconf.h as a fallback that **usually** works until 1.3.2 where it broke gRPC builds. On unix systems (linux and macos), the fallback header doesn't set `HAS_UNISTD_H` properly therefore doesn't include declaration of io functions such as read(), write() etc.

I looked into our build system and it seems to require a fair bit of work to cleanly fix the issue. A temporary workaround on linux is just `-Wno-implicit-function-declaration`. But the same option doesn't seem to work on darwin.

This affects our objc, python, cmake and bazel builds, MSVC seems unaffected.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.