[CDRIVER-3493] libmongocrypt not listed correctly as interface library for mongoc_static Created: 17/Jan/20  Updated: 28/Oct/23  Resolved: 30/Jan/20

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: 1.16.0
Fix Version/s: 1.16.1

Type: Bug Priority: Major - P3
Reporter: Kevin Albertson Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related

 Description   

Currently, building and installing libmongoc results in a cmake targets file (lib/cmake/mongoc-1.0/mongoc-targets.cmake) with these lines:

# Create imported target mongo::mongoc_sharedadd_library(mongo::mongoc_shared SHARED IMPORTED)
set_target_properties(mongo::mongoc_shared PROPERTIES  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/libmongoc-1.0"  INTERFACE_LINK_LIBRARIES "mongo::bson_shared")
# Create imported target mongo::mongoc_static
add_library(mongo::mongoc_static STATIC IMPORTED)
set_target_properties(mongo::mongoc_static PROPERTIES  INTERFACE_COMPILE_DEFINITIONS "MONGOC_STATIC;BSON_STATIC"  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/libmongoc-1.0"  INTERFACE_LINK_LIBRARIES "/usr/lib/libsasl2.dylib;-framework CoreFoundation -framework Security;resolv;/usr/local/lib/libsnappy.dylib;/usr/lib/libz.dylib;/usr/local/lib/libzstd.dylib;/usr/local/Cellar/icu4c/64.2/lib/libicuuc.dylib;mongo::mongocrypt;mongo::bson_static") 

The listing of mongo::mongocrypt is the cmake target name of libmongocrypt. Instead, I believe it should be the path to the libmongocrypt.dylib (or .so/.dll).

As a workaround, consumers can explicitly find_package(mongocrypt) when linking to mongoc_static.



 Comments   
Comment by Githook User [ 03/Feb/20 ]

Author:

{'name': 'Kevin Albertson', 'username': 'kevinAlbs', 'email': 'kevin.albertson@mongodb.com'}

Message: CDRIVER-3493 skip testing with CSE by default

libmongocrypt currently exposes some libbson symbols, causing
symbol conflicts between libmongoc and libmongocrypt. This
will be fixed upstream. Until then, skip building with CSE
unless building libmongocrypt from source.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/f9f64a2e9418517dbd30904b41c04c11ae811788

Comment by Githook User [ 30/Jan/20 ]

Author:

{'username': 'kevinAlbs', 'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com'}

Message: CDRIVER-3493 fix libmongocrypt dep for static
Branch: r1.16
https://github.com/mongodb/mongo-c-driver/commit/39b52481b5c87df23e7d7e03b6088c2d84f70491

Comment by Githook User [ 30/Jan/20 ]

Author:

{'username': 'kevinAlbs', 'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com'}

Message: CDRIVER-3493 fix libmongocrypt dep for static
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/d1a553564e58a08ef573a6d44ecd2ba03b9465b2

Comment by Kevin Albertson [ 30/Jan/20 ]

Great, thank you! I also see my new patch builds that require 1.0.1 passing.

Comment by John Chen (Inactive) [ 30/Jan/20 ]

Hi kevin.albertson, libmongocrypt-dev has been updated to 1.0.1-0 on our Ubuntu 1604 and 1804 boxes.

Generated at Wed Feb 07 21:18:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.