Rename libmongocrypt mlib path to avoid header conflicts with libmongoc

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Critical - P2
    • 1.16.0, 1.15.2
    • Affects Version/s: None
    • Component/s: C library
    • None
    • Not Needed
    • 🔵 Done
    • None
    • None
    • None
    • None
    • None
    • None

      While MONGOCRYPT-843 addresses an incompatibility with building libmongocrypt against libbson 2.x, it does not address a lower level conflict between the "mlib" headers in both libraries. In particular, between src/common/src/mlib/str.h in libmongoc 2.1.0 (introduced in e388c29 for CDRIVER-5983) and
      src/mlib/str.h (introduced in b132482 for libmongocrypt 1.3.1).

      This was discovered while attempting to bump PHPC's libmongoc dependency from 2.0.0 to 2.1.0 (PHPC-2611). Although MONGOCRYPT-843 addresses libmongocrypt's build failure (by introducing a new CMake target), this only so happens to work because libbson does not include "mlib/str.h". PHPC encountered this precisely because libmongoc, libbson, and libmongocrypt are all compiled statically into the PHP extension and shuffling include paths for different source files (which is admittedly difficult to achieve with PHP's build system) will not entirely avoid a conflict.

      This can be fixed by renaming the "mlib" directory in libmongocrypt to "mc-mlib". Additionally, we may want to spawn a separate ticket to rename libmongoc's directory to "mcd-mlib" (a new CDRIVER ticket can be spawned if necessary).

            Assignee:
            Roberto Sanchez
            Reporter:
            Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: