Skip to content

Update to clang 17 breaks old versions of zlib #2269

Open

Description

@fmeum

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

Activity

  1. meteorcloudy commented on Apr 30, 2025

    @meteorcloudy
    Member

    Work around

    build:macos --copt=-Dfdopen=fdopen
    build:macos --host_copt=-Dfdopen=fdopen
    

    See bazel-contrib/rules_go#4332

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions