[Bazel CI] Android Firebase Cloud Messaging fails on macOS arm64: zlib zutil.c does not compile with Xcode 26.6 (Bazel 7.2.0rc1)

Open
#722 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
android, c, macos

Research direction

Start with the failing target in android/firebase-cloud-messaging and reproduce with the listed steps on macOS arm64 using Bazel 7.2.0rc1. Read external/zlib/zutil.h around line 140, where fdopen is defined as a macro, alongside external/zlib/BUILD.bazel; compare with the macOS arm64 change in #716. Done means bazel build //app:app succeeds under Xcode 26.6 without breaking other zlib users.

Written by the indexing model from the issue text.

Description

CI: https://buildkite.com/bazel/bazel-bazel-examples/builds/5640#01a21001-b43b-4d66-8a31-d33936c497f1

Platform: macOS arm64

Failing tasks:

  • android (Android Firebase Cloud Messaging)

Logs:

(01:02:19) ERROR: .../external/zlib/BUILD.bazel:31:11: Compiling zutil.c [for tool] failed: (Exit 1): cc_wrapper.sh failed: error executing CppCompile command (from target @@zlib//:zlib)
In file included from external/zlib/zutil.c:10:
In file included from external/zlib/gzguts.h:21:
In file included from /Applications/Xcode26.6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:61:
/Applications/Xcode26.6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h:322:7: error: expected identifier or '('
  322 | FILE    *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
external/zlib/zutil.h:140:33: note: expanded from macro 'fdopen'
  140 | #        define fdopen(fd,mode) NULL /* No fdopen() */
(01:02:20) ERROR: Build did NOT complete successfully

Culprit: This task runs on macos_arm64 since #716. There the job uses Xcode 26.6, and the zlib version this example pulls in defines fdopen as a macro, which breaks the SDK's _stdio.h.

Steps:

git clone https://github.com/bazelbuild/examples.git
git reset c511c5d8659148c4d6ef715f24864c90cc25a6ab --hard
export USE_BAZEL_VERSION=7.2.0rc1
cd android/firebase-cloud-messaging
bazel build //app:app

CC Greenteam @meteorcloudy

Dominant language
Starlark
Stars
958
Forks
582
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bazelbuild/examples

All issues in bazelbuild/examples

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.