-
Notifications
You must be signed in to change notification settings - Fork 556
Hook up more integrations to NativeAOT with Android RIDs #10402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…s correct on the android RIDs.
… to be built in a way that NativeAOT can call
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
os-bridge.cc | ||
runtime-util.cc | ||
typemap.cc | ||
xamarin_getifaddrs.cc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will produce conflict with #10385. Not a big deal, just wanted to avoid dragging unused code into newly supported runtimes.
|
||
<!-- The list of hacks below should go away when we have NativeAOT.android-* packs --> | ||
<!-- HACK: we are android-arm64, so this is required for the right path(s) to be found --> | ||
<_OriginalRuntimeIdentifier>$(RuntimeIdentifier)</_OriginalRuntimeIdentifier> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some usages of _OriginalRuntimeIdentifier
below that need to be updated.
@@ -122,16 +110,13 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. | |||
<ResolvedFileToPublish Include="$(_NdkSysrootDir)libc++_shared.so" RuntimeIdentifier="$(_OriginalRuntimeIdentifier)" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line and the one above need to use RuntimeIdentifier
instead of _OriginalRuntimeIdentifier
.
I'll need to dig a bit deeper but the
...and even if it tried to link to the native library we are still missing some bits:
UPD: Nvm, I was missing |
...in.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets
Outdated
Show resolved
Hide resolved
src/Microsoft.Android.Runtime.NativeAOT/Android.Runtime.NativeAOT/JavaInteropRuntime.cs
Show resolved
Hide resolved
I have a heavily hacked up build locally that was able to pass startup of our app: ![]() Aside from all the comments above and solving general linking breakage / undefined symbols, we will need to embrace GCUserPeerable because NativeAOT builds use different interop generation mode (XAJavaInterop1 vs JavaInterop1). The garbage collection part seems to work but for some reason it's triggered way too often to the point of feeling like running all the time. It will need to be investigated, the startup takes literally minute[s] because of all the triggered collections. (UPD: |
Here's a rough commit with the changes I have locally to get this working: filipnavara@4a59c50 It still needs a lot of cleanup. We also need updated runtime packs to get it working end-to-end. |
@jkoritzinsky FYI the latest Maestro bump, it seems like we need to make changes like: This allows the NativeAOT runtime packs (with proper Android RIDs!) to work. Do we need to add the two Android RIDs to this line: That made things work for me locally, but CI is ongoing. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
…tnet-android into naot-android-rid
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
I'm looking at the NAOT failures and it looks like it can't find the native files in the package even though they are present in the NativeAOT runtime package. I did notice that the runtime package is built with a |
I tried to push a change (says I can't push to |
You should be able to push to my fork (I have the "allow edits by maintainers" checkbox checked), weird. Thanks for looking into this for me. |
Try hooking up the Android crypto stack, GC integration, and logging to NativeAOT correctly.
cc: @filipnavara @jtschuster