Fix MongoDB.Driver.Encryption Native Library Packaging to Use Standard RID Paths

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Dotnet Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      The MongoDB.Driver.Encryption NuGet package uses non-standard runtime identifier (RID) paths for native libraries, causing build/publish failures when customers using .NET6+ specify target platforms. This violates .NET packaging conventions and the .NET SDK cannot determine which variant matches the target RID. As such, all variants of a platform (e.g. linux) attempt to copy to the same output location resulting in NETSDK1152 error or wrong native library at runtime. Customers building/publishing for specific platforms on earlier versions of .NET don't get errors but the native library copied to the output directory where their app binaries are might not be the correct one.

      Current Structure:
      MongoDB.Driver.Encryption/
      └── runtimes/
          ├── linux/
          │   └── native/
          │       ├── x64/
          │       │   └── libmongocrypt.so
          │       ├── arm64/
          │       │   └── libmongocrypt.so
          │       └── alpine/
          │           └── libmongocrypt.so
          ├── win/
          │   └── native/
          │       └── mongocrypt.dll
          └── osx/
              └── native/
                  └── libmongocrypt.dylib
      Desired Structure:
       MongoDB.Driver.Encryption/
      └── runtimes/
          ├── linux-x64/
          │   └── native/
          │       └── libmongocrypt.so
          ├── linux-arm64/
          │   └── native/
          │       └── libmongocrypt.so
          ├── linux-musl-arm64/
          │   └── native/
          │       └── libmongocrypt.so
          ├── win-x64/
          │   └── native/
          │       └── mongocrypt.dll
          └── osx-x64/
              └── native/
                  └── libmongocrypt.dylib

       

       

              Assignee:
              Adelin Mbida Owona
              Reporter:
              Adelin Mbida Owona
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: