[CSHARP-4016] Update libmongocrypt C# bindings for macOS m1 Created: 18/Jan/22 Updated: 28/Oct/23 Resolved: 31/Aug/22 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.17.0 |
| Type: | Task | Priority: | Unknown |
| Reporter: | Kevin Albertson | Assignee: | James Kovacs |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||
| Description |
|
Background
Scope |
| Comments |
| Comment by James Kovacs [ 31/Aug/22 ] |
|
2.17.0 shipped libmongocrypt as a universal binary with both x64 and arm64 code forks. Testing on Apple M1 indicates that this was sufficient and no additional changes are required to make MongoDB.Libmongocrypt work on Apple M1. |
| Comment by James Kovacs [ 16/Mar/22 ] |
|
Hi, vah@oveo.io, We were blocked on NOTE: .NET only supports M1 natively starting with .NET 6. If you are still building on .NET 5 or earlier, your .NET applications will run through Rosetta 2 and the x64 libmongocrypt.dylib will be cross-compiled automatically. Even if you are using .NET 6, you can target x64 and run through Rosetta 2 until we package libmongocrypt.dylib Universal binary with M1 support. Sincerely, |
| Comment by Vadim Hatsura [ 16/Mar/22 ] |
|
Hey, @James Jovacs
Do you know what is the blocker for this task? |
| Comment by James Kovacs [ 24/Jan/22 ] |
|
On the M1, Intel applications - including .NET 5 and earlier - are cross-compiled through Rosetta2 which converts Intel machine code to ARM machine code. (The M1 - just like the A-series for iPhones and iPads - is a custom ARM processor.) .NET 6 supports the M1 and will run it natively without cross compilation through Rosetta2. On OSX, we use dylib for compression and CSFLE. dylib is Apple’s version of DLLs (Windows) or .so (Linux). A dylib can contain machine code for multiple platforms. Right now our dylib packages only contain x86 and/or x64 code. When we recompile them to support M1, they will also contain ARM32 and/or ARM64 code. It will be a matter of ensuring that all our unmanaged dependencies are re-compiled with ARM support and testing them. The loader in the Darwin kernel should handle all the hard magic of ensuring that the right machine code from the binary is executed. .NET applications will run natively on .NET 6 on the M1, but until we update our compression and CSFLE unmanaged dependencies to support the M1, users will be unable to use those features natively and would have to configure their .NET 6 applications to run through Rosetta2 (but only if they required compression or CSFLE). |