Skip to content

build: Alpine builds broken by mongodb 2.3.2 upstream regression #41

@KingPin

Description

@KingPin

Summary

All Alpine matrix combinations (v1 and v2) currently fail at the install-php-extensions mongodb step because of an upstream regression in mongodb 2.3.2 (released 2026-05-21). Debian (bookworm / trixie) builds are unaffected.

There is no fix on our side — we're tracking the upstream issue and will close this once a fixed release is published and our Alpine matrix goes green again.

Upstream

Symptom

On every alpine matrix combination, install-php-extensions mongodb fails compiling libmongoc:

mongoc-client.c:461:7: error: implicit declaration of function 'res_ninit'; did you mean 'res_init'?
mongoc-client.c:465:14: error: implicit declaration of function 'res_nsearch'; did you mean 'res_search'?
mongoc-client.c:539:4: error: implicit declaration of function 'res_nclose'
make: *** [Makefile:466: src/libmongoc/src/libmongoc/src/mongoc/mongoc-client.lo] Error 1

Why only Alpine

glibc (Debian) exposes res_ninit / res_nsearch / res_nclose via _DEFAULT_SOURCE. musl (Alpine) does not provide them at all.

Root cause (per upstream)

mongodb 2.3.2 ships a stale mongoc-config.h baked on a glibc system with MONGOC_HAVE_RES_NSEARCH=1 hardcoded. The new PHP_MONGODB_ADD_BUILD_INCLUDE macro in config.m4 doesn't point at the build dir where config.status regenerates the header for the current platform, so the compiler falls back to the source-tree copy and tries to call resolver functions that don't exist on musl.

Resolution path

  1. Wait for upstream to publish a fixed mongodb release (≥ 2.3.3).
  2. Re-run the Docker CI workflow (push/workflow_dispatch/weekly schedule will all work).
  3. If the Alpine matrix goes green, close this issue.
  4. If it doesn't, reopen Release 2.3.2 breaks pecl install in docker (zstd.h not found) mongodb/mongo-php-driver#2020 (or file a follow-up) and update this issue with the new upstream link.

Workaround (only if Alpine builds must ship before upstream fix)

Pin the extension in both Dockerfiles:

  • Dockerfile.v1mongodbmongodb-2.3.1
  • Dockerfile.v2mongodbmongodb-2.3.1

Not currently applied — we're waiting on upstream rather than carrying a local pin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdependenciesPull requests that update a dependency file

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions