rocksdb-sharp icon indicating copy to clipboard operation
rocksdb-sharp copied to clipboard

AOT Support for .NET 9.0

Open Spacefish opened this issue 1 year ago • 2 comments

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?

Spacefish avatar Jan 26 '24 15:01 Spacefish

That sounds quite interesting - will need some changes on how the library integration works. If you're interested in giving it a try let me know!

theolivenbaum avatar Jul 29 '24 07:07 theolivenbaum