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

Build fails on FreeBSD. Error: Don't know how to get the module path on this platform

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 1.7.0, 1.6.2, 1.7.0-alpha0
    • Affects Version/s: 1.5.0, 1.6.0
    • Component/s: None
    • Labels:
      None

      Build for version 1.5.0 (tested 1.6.0 too, and other version might be affected to) fails on FreeBSD with following message.

      ...
      [ 22%] Building C object CMakeFiles/mongocrypt.dir/src/mongocrypt-opts.c.o
      [ 22%] Building C object CMakeFiles/mongocrypt.dir/src/mongocrypt-status.c.o
      [ 22%] Building C object CMakeFiles/mongocrypt.dir/src/mongocrypt-traverse-util.c.o
      [ 22%] Building C object CMakeFiles/mongocrypt.dir/src/mongocrypt-util.c.o
      /path/to/dir/mongo/libmongocrypt/src/mongocrypt-util.c:93:2: error: "Don't know how to get the module path on this platform"
      #error "Don't know how to get the module path on this platform"
       ^
      1 error generated.
      *** Error code 1Stop.
      make[2]: stopped in /path/to/dir/mongo/libmongocrypt/cmake-build
      *** Error code 1Stop.
      make[1]: stopped in /path/to/dir/mongo/libmongocrypt/cmake-build
      *** Error code 1Stop.
      make: stopped in /path/to/dir/mongo/libmongocrypt/cmake-build 

       

      Fixing the issue with the following patch revealed an other issue, which i managed to solve in the same way. I know this patch is not suited for a release, but maybe it helps to get it fixed.

      --- a/src/mongocrypt-util.c
      +++ b/src/mongocrypt-util.c
      @@ -78,7 +78,7 @@ current_module_path ()
             }
             free (path);
          }
      -#elif defined(_GNU_SOURCE) || defined(_DARWIN_C_SOURCE)
      +#elif 1 || defined(_GNU_SOURCE) || defined(_DARWIN_C_SOURCE)
          // Darwin/BSD/glibc define extensions for finding dynamic library info from
          // the address of a symbol.
          Dl_info info;
      --- a/src/os_posix/os_dll.c
      +++ b/src/os_posix/os_dll.c
      @@ -105,7 +105,7 @@ mcr_dll_path (mcr_dll dll)
             .error_string = mstr_copy_cstr ("Handle not found in loaded modules")};
       }-#elif defined(__linux__)
      +#elif 1 || defined(__linux__) #include <link.h> 

       

      make test ran fine with this patch, but the following got skipped:

      The following tests did not run:
            7 - test_kms_azure_online (Skipped)
            8 - test_kms_gcp_online (Skipped) 

            Assignee:
            colby.pike@mongodb.com Colby Pike
            Reporter:
            github-3d528b@mgws.ch MGlaus N/A
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: