ExportXMLWordPrintableJSON

    • Type: Task
    • Resolution: Won't Fix
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • PHP Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      Problem

      mongodb 1.21.13, the latest release of the 1.21 line, cannot be compiled on PHP 8.6. make fails with 199 errors, the first one being:

      src/phongo_classes.h:27:50: error: use of undeclared identifier 'XtOffsetOf'
      

      PHP 8.6 removed the XtOffsetOf macro, which the 1.x branch uses to declare classes. The 2.x branch uses offsetof instead and builds fine: version 2.5.7 was compiled and loaded with PHP 8.6.0-dev.

      The compatibility declaration is wrong

      The composer.json of the extension, on branch v1.21, declares:

      "php": ">=8.1,<9"
      

      That range includes PHP 8.6, but the code cannot be built on 8.6. This is the constraint PIE uses to decide whether the extension is installable, so it will advertise PHP 8.6 support as soon as PIE itself runs on 8.6.

      The library has the same problem: mongodb/mongodb 1.21 declares "php": "^8.1" and requires "ext-mongodb": "^1.21.0", so it also appears installable on PHP 8.6 while the only extension line it allows cannot be built there.

      The CI matrix of branch v1.21 only tests PHP 8.1 to 8.4, so the gap is not detected.

      Reproduction

      curl -fsSL -o mongodb-1.21.13.tgz https://pecl.php.net/get/mongodb-1.21.13.tgz
      tar xzf mongodb-1.21.13.tgz
      cd mongodb-1.21.13
      phpize
      ./configure --with-php-config=$(which php-config)
      make
      

      Run with PHP 8.6 and its phpize and development headers. Tested on macOS with the Homebrew build of PHP 8.6.0-dev.

      Expected

      • Port the PHP 8.6 fixes to the 1.21 branch, starting with replacing XtOffsetOf with offsetof, then release a 1.21 patch version. Other 8.6 API changes may surface once the first errors are fixed.
      • Or restrict "php": ">=8.1,<9" on the 1.21 branch to the PHP versions the branch actually supports.

            Assignee:
            Jérôme Tamarelle
            Reporter:
            Jérôme Tamarelle
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: