[MONGOCRYPT-497] os_dll.c fails to compile in Cygwin environments Created: 14/Nov/22  Updated: 10/Apr/23

Status: Backlog
Project: Libmongocrypt
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Jeremy Mikola Assignee: Colby Pike
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to MONGOCRYPT-470 Build fails on FreeBSD. Error: Don't ... Closed

 Description   

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).


Generated at Thu Feb 08 09:08:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.