Skip to content

fix(deps): disable Assimp bundled zlib on macOS to fix SDK 15+ build failure#10849

Open
BenJule wants to merge 3 commits into
bambulab:masterfrom
BenJule:fix/10767-assimp-macos-zlib-build
Open

fix(deps): disable Assimp bundled zlib on macOS to fix SDK 15+ build failure#10849
BenJule wants to merge 3 commits into
bambulab:masterfrom
BenJule:fix/10767-assimp-macos-zlib-build

Conversation

@BenJule
Copy link
Copy Markdown

@BenJule BenJule commented May 21, 2026

Problem

Assimp 5.4.3 ships a bundled zlib that defines `#define fdopen(fd,mode) NULL` in `contrib/zlib/zutil.h:147`. On macOS 15+ the SDK's `_stdio.h` declares `fdopen` through `__DARWIN_ALIAS(fdopen)`, which expands through the `NULL` definition and produces a C preprocessor parse error:

```
dep_Assimp/contrib/zlib/zutil.h:147:18: error: expected unqualified-id
#define fdopen(fd,mode) NULL
^
/Applications/Xcode.app/.../MacOSX15.5.sdk/usr/include/_stdio.h:318:47: note: expanded from macro '__DARWIN_ALIAS'
FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(..., __DARWIN_ALIAS(fdopen));
```

This breaks the Build Deps step on both `macos-15 arm64` and `macos-15 x86_64` for any PR that triggers macOS CI.

Fix

Only build the bundled zlib on Windows (where a system zlib is not guaranteed). On macOS and Linux the system zlib is always available, so `-DASSIMP_BUILD_ZLIB=OFF` is safe.

Test plan

  • macOS arm64 CI passes "Build Deps"
  • macOS x86_64 CI passes "Build Deps"
  • Windows build still uses bundled zlib (`WIN32` guard keeps `ON`)

Closes #10851.

BenJule and others added 3 commits May 21, 2026 10:52
The upstream build_all.yml only listed 'main' as a push trigger.
BenJule/BambuStudio uses 'master' as its default branch, so CI never
fired on fork-local pushes. Adding 'master' alongside 'main' makes
the full multi-platform build run when master is updated.
… 15+

Assimp 5.4.3's bundled zlib defines `#define fdopen(fd,mode) NULL` in
contrib/zlib/zutil.h:147. On macOS 15+ the SDK's `_stdio.h` uses
`__DARWIN_ALIAS(fdopen)`, which expands through that macro and causes a
C preprocessor parse error, breaking the "Build Deps" CI step on both
arm64 and x86_64.

Fix: only build the bundled zlib on Windows (where it is needed);
on macOS and Linux use the system-provided zlib instead.

Fixes the CI failures in bambulab#10767.

Co-Authored-By: Abdel Gomez-Perez <nabdel07@icloud.com>
@BenJule BenJule force-pushed the fix/10767-assimp-macos-zlib-build branch from 695a376 to 1f1f814 Compare May 21, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS 15+ build fails in dep_Assimp: fdopen macro conflict with SDK _stdio.h

1 participant