Uploaded image for project: 'Libmongocrypt'
  1. Libmongocrypt
  2. MONGOCRYPT-497

os_dll.c fails to compile in Cygwin environments

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      A user in mongodb/mongo-php-driver#1381 reported the following build error when compiling PHPC with bundled libmongocrypt under Cygwin:

      /cygdrive/d/workspace/php-src/ext/mongodb/src/libmongocrypt/src/os_posix/os_dll.c:130:2: error: #error "Don't know how to do mcr_dll_path() on this platform"
        130 | #error "Don't know how to do mcr_dll_path() on this platform"
            |  ^~~~~
      

      This appears to be caused by libmongoc depending on `_WIN32` to Cygwin not defining `_WIN32`, which seems intentional per the following discussions:

      I don't think the Linux implementation for mcr_dll_path() would work as dlinfo() is not available on Cygwin. Perhaps the _WIN32 check in os_posix/os_dll.c and os_win/os_dll.c could be amended to also consider __CYGWIN__ (per https://sourceforge.net/p/predef/wiki/OperatingSystems/). That would ensure that the Windows-specific implementations of the mcr_dll functions get compiled and used (assuming those APIs work fine under Cygwin).

            Assignee:
            colby.pike@mongodb.com Colby Pike
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: