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

Build errors compiling PHP driver with bundled libmongocrypt 1.3.1 on Windows

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 1.3.2
    • Affects Version/s: 1.3.1
    • Component/s: None
    • Labels:
      None

      I observed several build errors (see: AppVeyor task log) compiling PHPC with bundled libmongocrypt 1.3.1. An abridged log is below:

      C:\projects\mongodb\src\libmongocrypt\src\mlib/thread.h(81): error C2440: 'function': cannot convert from 'BOOL (__cdecl *)(INIT_ONCE *,void *,void *)' to 'PINIT_ONCE_FN' (compiling source file C:\projects\mongodb\src\libmongocrypt\src\mongocrypt-util.c)
      C:\projects\mongodb\src\libmongocrypt\src\mlib/thread.h(81): warning C4024: 'InitOnceExecuteOnce': different types for formal and actual parameter 2 (compiling source file C:\projects\mongodb\src\libmongocrypt\src\mongocrypt-util.c)
      C:\projects\mongodb\src\libmongocrypt\src\mlib/thread.h(81): error C2440: 'function': cannot convert from 'BOOL (__cdecl *)(INIT_ONCE *,void *,void *)' to 'PINIT_ONCE_FN' (compiling source file C:\projects\mongodb\src\libmongocrypt\src\mongocrypt.c)
      C:\projects\mongodb\src\libmongocrypt\src\mlib/thread.h(81): warning C4024: 'InitOnceExecuteOnce': different types for formal and actual parameter 2 (compiling source file C:\projects\mongodb\src\libmongocrypt\src\mongocrypt.c)
      C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(103): warning C4005: 'AF_IPX': macro redefinition (compiling source file C:\projects\mongodb\src\libmongocrypt\src\mongocrypt.c)
      C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\winsock.h(457): note: see previous definition of 'AF_IPX' (compiling source file C:\projects\mongodb\src\libmongocrypt\src\mongocrypt.c)
      C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(147): warning C4005: 'AF_MAX': macro redefinition (compiling source file C:\projects\mongodb\src\libmongocrypt\src\mongocrypt.c)
      C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\winsock.h(476): note: see previous definition of 'AF_MAX' (compiling source file C:\projects\mongodb\src\libmongocrypt\src\mongocrypt.c)
      C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(187): warning C4005: 'SO_DONTLINGER': macro redefinition (compiling source file C:\projects\mongodb\src\libmongocrypt\src\mongocrypt.c)
      C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\winsock.h(399): note: see previous definition of 'SO_DONTLINGER' (compiling source file C:\projects\mongodb\src\libmongocrypt\src\mongocrypt.c)
      C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(240): error C2011: 'sockaddr': 'struct' type redefinition (compiling source file C:\projects\mongodb\src\libmongocrypt\src\mongocrypt.c)
      C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\winsock.h(482): note: see declaration of 'sockaddr' (compiling source file C:\projects\mongodb\src\libmongocrypt\src\mongocrypt.c)
      C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(442): error C2059: syntax error: 'constant' (compiling source file C:\projects\mongodb\src\libmongocrypt\src\mongocrypt.c)
      

      The errors in mlib/thread.h stand out, but there are also many errors/warnings due to redefined macros and symbols. It's not clear to me if the issue is caused by our build environment or libmongocrypt directly, but I'll note that previous builds of libmongocrypt 1.3.0 had no issues (see: task log). The current errors appear throughout our CI matrix, which includes VS16 (PHP 8.0+) and VS15 (PHP 7.x).

            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:
              Resolved: