Skip to content

Enable CoreCLR runtime pack for android-arm (armeabi-v7a)#11172

Open
simonrozsival wants to merge 3 commits intomainfrom
dev/simonrozsival/coreclr-android-arm
Open

Enable CoreCLR runtime pack for android-arm (armeabi-v7a)#11172
simonrozsival wants to merge 3 commits intomainfrom
dev/simonrozsival/coreclr-android-arm

Conversation

@simonrozsival
Copy link
Copy Markdown
Member

Note

This PR was AI/Copilot-generated.

Summary

Enable the CoreCLR runtime flavor for the armeabi-v7a (android-arm) ABI, following the same pattern as android-arm64 and android-x64.

Changes

build-tools/scripts/Ndk.projitems.in

  • Set SupportCoreCLR=True for armeabi-v7a (was False)
  • Add ApiLevelNonMono metadata (referencing the new AndroidNdkApiLevelNonMono_Arm property)
  • Add AndroidNdkApiLevelNonMono_Arm property with @NDK_ARMEABI_V7_API_NON_MONO@ placeholder

build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs

  • Add @NDK_ARMEABI_V7_API_NON_MONO@NdkMinimumNonMonoAPI placeholder replacement

WorkloadManifest.in.json

  • Add Microsoft.Android.Runtime.CoreCLR.36.1.android-arm to the workload packs list and pack definitions

Dependencies

Enable the CoreCLR runtime flavor for the armeabi-v7a ABI, following the
same pattern as android-arm64 and android-x64.

Changes:
- Set SupportCoreCLR=True for armeabi-v7a in Ndk.projitems.in
- Add ApiLevelNonMono metadata and corresponding property/placeholder
- Add Microsoft.Android.Runtime.CoreCLR.36.1.android-arm to workload manifest

Depends on dotnet/runtime#127225 and dotnet/runtime#126838 (API level 24).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@simonrozsival simonrozsival added Area: CoreCLR Issues that only occur when using CoreCLR. copilot `copilot-cli` or other AIs were used to author this labels Apr 21, 2026
@simonrozsival simonrozsival marked this pull request as ready for review April 28, 2026 08:11
Copilot AI review requested due to automatic review settings April 28, 2026 08:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables CoreCLR runtime-pack support metadata for the android-arm (armeabi-v7a) ABI so the Android workload can include a CoreCLR pack for that RID, matching existing arm64/x64 patterns.

Changes:

  • Add Microsoft.Android.Runtime.CoreCLR.36.1.android-arm to the Android workload manifest packs list and pack definitions.
  • Update Ndk.projitems.in to mark armeabi-v7a as SupportCoreCLR=True and add an ApiLevelNonMono value for that ABI.
  • Extend xaprepare placeholder generation to replace the new @NDK_ARMEABI_V7_API_NON_MONO@ placeholder.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json Adds the CoreCLR android-arm runtime pack to the workload manifest.
build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs Adds placeholder substitution for the new arm32 non-mono NDK API placeholder used by generated projitems.
build-tools/scripts/Ndk.projitems.in Marks armeabi-v7a as CoreCLR-supported and introduces an arm32 non-mono API-level property/metadata.

<AndroidRID>android-arm</AndroidRID>
<SupportMonoVM>True</SupportMonoVM>
<SupportCoreCLR>False</SupportCoreCLR>
<SupportCoreCLR>True</SupportCoreCLR>
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting True for armeabi-v7a makes the build/packs treat android-arm CoreCLR as supported, but the rest of the repo is not wired up for it yet: src/native/native-clr.csproj still restricts AndroidSupportedTargetJitAbis to arm64-v8a:x86_64, src/native/CMakePresets.json.in has no coreclr-* presets for armeabi-v7a, and the CoreCLR/NonMono min-API mapping in XABuildConfig.ArchToApiLevelNonMono has no AndroidTargetArch.Arm entry (MonoAndroidHelper.GetMinimumApiLevel will throw for CoreCLR+Arm). Either keep SupportCoreCLR=false for armeabi-v7a for now, or add the missing native presets/build support and the ArchToApiLevelNonMono entry so CoreCLR android-arm builds are actually possible.

Suggested change
<SupportCoreCLR>True</SupportCoreCLR>
<SupportCoreCLR>False</SupportCoreCLR>

Copilot uses AI. Check for mistakes.
Comment on lines 10 to 17
"Microsoft.Android.Runtime.36.1.android",
"Microsoft.Android.Runtime.Mono.36.1.android-arm",
"Microsoft.Android.Runtime.Mono.36.1.android-arm64",
"Microsoft.Android.Runtime.Mono.36.1.android-x86",
"Microsoft.Android.Runtime.Mono.36.1.android-x64",
"Microsoft.Android.Runtime.CoreCLR.36.1.android-arm",
"Microsoft.Android.Runtime.CoreCLR.36.1.android-arm64",
"Microsoft.Android.Runtime.CoreCLR.36.1.android-x64",
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workload manifest now declares Microsoft.Android.Runtime.CoreCLR.36.1.android-arm as part of the android workload. With the current repo state, CoreCLR native runtime builds/packs are only produced for arm64/x86_64 (see src/native/native-clr.csproj and CMake presets), so this entry is likely to make workload install/pack creation fail or produce an incomplete runtime pack for android-arm. Please ensure the CoreCLR android-arm runtime pack is actually generated and published by the build (native runtime build + runtime pack creation) before listing it here, or gate the manifest entry until those pieces are in place.

Copilot uses AI. Check for mistakes.
@simonrozsival
Copy link
Copy Markdown
Member Author

@copilot address the review and make sure the rest of the repo is ready for armeabi-v7a support

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 28, 2026

@copilot address the review and make sure the rest of the repo is ready for armeabi-v7a support

Wired up the remaining pieces in 84c9882:

  • src/native/CMakePresets.json.in: added nonmono-common-armeabi-v7a and coreclr-default-{debug,release}-armeabi-v7a presets so --preset coreclr-default-*-armeabi-v7a resolves during _ConfigureRuntimes.
  • build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs: added @NDK_ARMEABI_V7_NONMONO_API_NET@ (CMakePresets) and @NDK_ARMEABI_V7_NONMONO_API@ (XABuildConfig) placeholder substitutions, both mapping to BuildAndroidPlatforms.NdkMinimumNonMonoAPI.
  • build-tools/scripts/XABuildConfig.cs.in: added AndroidTargetArch.Arm to ArchToApiLevelNonMono so MonoAndroidHelper.GetMinimumApiLevel no longer throws for CoreCLR + Arm.
  • src/native/native-clr.csproj: added armeabi-v7a to AndroidSupportedTargetJitAbis so the CoreCLR native runtime is actually built and packaged for that ABI. AOT abis are left as arm64:x86_64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: CoreCLR Issues that only occur when using CoreCLR. copilot `copilot-cli` or other AIs were used to author this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants