bazelbuild / bazelbuild/continuous-integration

Update to clang 17 breaks old versions of zlib

Open
#2,269 1 comment 0 reactions 0 assignees View on GitHub
P2
Dominant language
Python
Stars
302
Forks
194
Avg merge
1d 19h
Merged PRs (30d)
41

Description

A number of rulesets in Bazel CI transitively rely on a version of zlib (through protobuf) that fails to compile on clang 17:

```
In file included from thirdparty/zlib/zutil.c:10:
In file included from thirdparty/zlib/gzguts.h:21:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:61:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h:318:7: error: expected identifier or '('
318 | FILE fdopen(int, const char ) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
| ^
thirdparty/zlib/zutil.h:147:33: note: expanded from macro 'fdopen'
147 | # define fdopen(fd,mode) NULL /* No fdopen() */
| ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h:26:16: note: expanded from macro 'NULL'
26 | #define NULL ((void*)0)
| ^
```

https://buildkite.com/bazel/rules-go-golang/builds/7771#01968274-c785-49e4-9142-94f95c68db60

Contributor guide

Open the contributing guide

Research direction

Start with the linked Buildkite failure and inspect thirdparty/zlib/zutil.h, zutil.c, and gzguts.h around the fdopen macro and clang 17 diagnostics. Reproduce the affected rulesets' build, then confirm that the old zlib path compiles successfully under clang 17 without breaking the protobuf dependency.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system, ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.