Support injecting NativeAOT-compiled DLLs (.NET 8) #13
Labels
area: analyzers
Issues related to the diagnostic analyzers and source generators.
area: build
Issues related to the build system.
area: documentation
Issues related to the documentation.
area: hosting
Issues related to the hosting model.
area: infrastructure
Issues related to infrastructure (GitHub, CI, etc).
area: injection
Issues related to the assembly injection APIs.
area: samples
Issues related to the sample projects.
state: approved
Enhancements and tasks that have been approved.
Milestone
In theory, Ruptura + NativeAOT is a match made in heaven. We could just inject a NativeAOT-compiled DLL and directly invoke an entry point method in it, skipping
ruptura-<arch>.dll
and all the ceremony around .NET hosting entirely.For this to work, the source generator would need to export a function that we can invoke to pass in these parameters:
ruptura/src/module/main.h
Lines 3 to 12 in adc65b4
That function would then do all the initialization that the native module currently does (e.g. calling
InjectedProgramContext.Initialize()
), and then call the user'sIInjectedProgram.RunAsync()
implementation.NativeAOT does come with a number of disadvantages that are inherent to that model of compilation: Very limited reflection, no dynamic code generation, forced IL trimming, and more. This means that any NativeAOT support would exist alongside our current hosting model so that users can choose the approach that makes the most sense for them.
The text was updated successfully, but these errors were encountered: