curiosity-ai / rocksdb-sharp

.net bindings for the rocksdb by facebook
BSD 2-Clause "Simplified" License
155 stars 38 forks source link

AOT Support for .NET 9.0 #52

Open Spacefish opened 6 months ago

Spacefish commented 6 months ago

So i tried to use RocksDbSharp in a AoT published project today and it didn´t work.

Looked at the code, and yes makes sense, as it emits the IL to call into the native shared objects during runtime, so that won´t work :)

.NET 9.0 we will have AssemblyBuilder.DefinePersistedAssembly see https://github.com/dotnet/runtime/pull/97177
AssemblyBuilder.Save(...) see https://github.com/dotnet/runtime/issues/97015 and https://github.com/dotnet/runtime/issues/92975

So maybe with .NET 9.0 the wrapper arround the native shared object can be pre-generated into IL during build-time and AOT should work?