-
Notifications
You must be signed in to change notification settings - Fork 548
Description
From: #17374 (comment):
I know this is still WIP but wanted to draw attention to one thing.
-
With the current setup the bundle still includes all the assemblies, which are not needed with NativeAOT.
As we do not use NativeAOT targets from https://github.com/dotnet/runtime/blob/main/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets we have to manually exclude those files. For reference I achieved this with a custom target:
ivanpovazan@98a8f4e#diff-2e24f1b6f44df7580244d00f106fa1a9e2257536fbca9d7bbdc74571549324a9R1172-R1178
but there is probably a cleaner way of doing it. -
Additionally, once assemblies are removed from the bundle additional changes have to be done in the native part of the runtime as it currently follows codepaths which assume assemblies are present in the bundle causing the app to crash during early startup. To be more specific:
xamarin_bridge_register_product_assemblyhas to be guarded incoreclr-bridge.mfor example: ivanpovazan@98a8f4e#diff-6e15dd2bc3a656eafdaed8fc01cf1bc69efd7acd459e13680956adebf661366fR563-R567- prevent
xamarin_open_and_registerof being called fromxamarin_main:
ivanpovazan@98a8f4e#diff-463ea10e390971f1d926d16f4dd9ed5bbfac4fd81d942b4f17eb0476d1c2d4e6R444-R467