Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-2270

Define constants for POSIX features and extensions used by libmongoc 1.24

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • 1.16.2
    • Affects Version/s: 1.16.0
    • Component/s: None
    • Labels:
      None

      In 6a7a2ba (PR: mongodb/mongo-php-driver#1388), we added C99 as a build requirement. This was done in tandem with mongodb/mongo-c-driver#1067 for CDRIVER-4136 and libmongoc 1.24.0; however, we missed defining other necessary definitions from that PR.

      Previously, mongodb/mongo-c-driver#920 for CDRIVER-4249 in libmongoc 1.21.0 warranted defining _DEFAULT_SOURCE for compiling our bundled sources. This was done in ab44b0c for PHPC-1647 (unrelated issue that coincidentally bumped to libmongoc 1.24-dev).

      Most recently, the strerror_r changes in CDRIVER-4679 for libmongoc 1.25.0 and 1.24.3 will introduce a build failure if _XOPEN_SOURCE is not >= 700 and _GNU_SOURCE is not defined. Without changes to PHPC, this means the driver will no longer compile with libmongoc 1.24.3 on PHP 8.1 and earlier. PHP 8.2+ defines _GNU_SOURCE by default (see: php/php-src#8807).

      To properly address this, PHPC should define explicitly opt into the various extensions mentioned in mongodb/mongo-c-driver#1067 and ensure those definitions are also used in our existing Autotools detection logic (e.g. strnlen in FindDependencies.m4).

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: