[CDRIVER-3915] Static linking failing Created: 02/Mar/21  Updated: 27/Oct/23  Resolved: 29/Mar/21

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: 1.17.4
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Thijs Cadier Assignee: Clyde Bazile III (Inactive)
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu


Issue Links:
Related
related to CDRIVER-3939 ENABLE_ICU=OFF does not prevent libmo... Closed

 Description   

When statically linking libmongoc into the Rust driver wrapper static linking fails. Multiple references are undefined, such as __res_nsearch.

Build output is here. Cmake options are set here.

It seems like maybe some dependencies other than those mentioned in the installation doc are needed. Am I missing something here?



 Comments   
Comment by Thijs Cadier [ 29/Mar/21 ]

Thanks for the help!

Comment by Clyde Bazile III (Inactive) [ 29/Mar/21 ]

That is unexpected. I created the ticket CDRIVER-3939 to address the issue. Since it appears you have a work around I'll close this ticket but feel free to re-open if your issue persist. Also, you can check our docs on authentication with SCRAM-SHA-256 here for how and when to link against libicu using CMake (including how to disable linking against it entirely).

Comment by Thijs Cadier [ 29/Mar/21 ]

I'm trying to actually disable ICU, so we don't have to install that as a dependency everywhere. It looks like DMONGOC_ENABLE_ICU alone does not prevent the library from linking. Is that expected?

Comment by Thijs Cadier [ 29/Mar/21 ]

I took another stab at this and was able to get to a working build. I had to explicitly link against resolv. Also I had to install libicu-dev and explicitly link against icuuc. Even when turning off icu with the cmake option.

Seems like it would be useful to add both of these to the docs.

Comment by Clyde Bazile III (Inactive) [ 15/Mar/21 ]

There shouldn't be any additional flags required. However, in v1.11, libmongoc added support for non-ASCII passwords using the library libicu as an optional dependency. Could you try explicitly disabling this by adding `-DMONGOC_ENABLE_ICU=OFF` to your list of CMake options?

Comment by Thijs Cadier [ 15/Mar/21 ]

I'm sure it might work on your machine, but in the context of the Rust build there definitively is an issue. See the output here.

I've checked the build environment doc, all these dependencies are present in this build. Also this linked fine in the pre-cmake versions. So something changed and it appears some extra linking flags are needed now?

Comment by Clyde Bazile III (Inactive) [ 15/Mar/21 ]

Hi thijs@appsignal.com,

Thank you for your patience. Unfortunately, this is not an issue I'm able to reproduce locally. The only dependencies libmongoc requires are stated in the build-enviornment section of our docs. Alternatively, you may find it simpler to install libmongoc using a package manager (available on recent versions of Debian and Ubuntu). This will ensure all dependencies are installed automatically.

Comment by Thijs Cadier [ 15/Mar/21 ]

Any updates on this? I'd love to get a fully working release of the Rust driver out there .

Comment by Clyde Bazile III (Inactive) [ 02/Mar/21 ]

Hi Thijs,

Thanks for reporting this issue. We will look into this soon.

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