[CSHARP-4363] Investigate csfle assembly loading failures in .net 6 and alpine env Created: 13/Oct/22  Updated: 21/Apr/23

Status: Blocked
Project: C# Driver
Component/s: Client Side Encryption, Packaging
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Unknown
Reporter: Dmitry Lukyanov (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
is caused by MONGOCRYPT-416 Publish libmongocrypt builds for Alpi... Backlog
Related
related to CSHARP-4889 Support Linux distros using libdl.so.2 Backlog

 Description   

See customer's report for details.

Some initial notes:

  1. We should check whether logic to load external libraries (ie DllImport attribute) correctly work with .net6 and possibly with particular linux distributive (alpine ). For example it looks like these lines have started automatically adding additional "lib" prefix to downloaded library name.
  2. The issue in "aspnet:6.0-alpine" image looks different and I would vote that for some reason a driver has no access to library added by our packaging logic.  We should check our packaging logic with docker.


 Comments   
Comment by James Kovacs [ 25/Oct/22 ]

Alpine Linux is built on musl libc rather than GNU C library AKA glibc. MongoDB.Libmongocrypt uses libdl.so (part of glibc) to dynamically load the unmanaged libmongocrypt.so shared library on Linux. libdl.so is not present on Alpine Linux distros and thus dynamic library loading fails.

We are considering supporting Alpine Linux distros. See MONGOCRYPT-416.

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