Skip to content

[workload] Add Microsoft.Android.Runtimes framework #10038

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

Merged
merged 11 commits into from
Apr 23, 2025
Merged

Conversation

pjcollins
Copy link
Member

@pjcollins pjcollins commented Apr 15, 2025

Context: dotnet/sdk#24077

A new "architecture-less" runtime pack has been added to distribute
Mono.Android.dll and other assemblies that are not architecture specific.

To support this, a new Microsoft.Android.Runtimes FrameworkReference
has been added to include our architecture specific runtime packs. The
existing Microsoft.Android FrameworkReference has been updated to
bring in the new runtime pack instead.

Shipping only one copy of Mono.Android.dll should cut down our workload
size by nearly 100MB compressed, and even more on disk.

With the size reductions the CoreCLR and NativeAOT runtime packs will
now be installed by the workload by default to avoid the need to
configure custom feeds to get these packs.

A new "architecture-less" runtime pack has been added to distribute
Mono.Android.dll and other assets that are not architecture specific.

To support this, a new `Microsoft.Android.Runtimes` FrameworkReference
has been added to include our architecture specific runtime packs. The
existing `Microsoft.Android` FrameworkReference will bring in the new
runtime pack.
@pjcollins
Copy link
Member Author

@jonathanpeppers I haven't yet sorted out why PackageNamingPolicy("LowercaseMD5") is now failing, but I think this is ready for some early feedback/review whenever you have some time, thanks!

@pjcollins
Copy link
Member Author

Assuming the latest tests look good I think this should mostly be good to go

@pjcollins pjcollins marked this pull request as ready for review April 22, 2025 19:22
@pjcollins pjcollins requested a review from dellis1972 as a code owner April 22, 2025 19:22
@pjcollins
Copy link
Member Author

Rough workload pack compressed size change summary with changes to ship only one Mono.Android.dll:

  • New managed runtime pack added: 9MB
  • Four CoreCLR runtime packs: 38MB -> 4MB
  • Four Mono runtime packs: 44MB -> 12MB
  • Four NativeAOT runtime packs: 36MB -> 1.5MB

Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

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

With the size saving, could we just put the NativeAOT/CoreCLR packs in the workload:

"packs": [
"Microsoft.Android.Sdk.net10",
"Microsoft.Android.Sdk.net9",
"Microsoft.Android.Ref.36",
"Microsoft.Android.Runtime.36.android",
"Microsoft.Android.Runtime.Mono.36.android-arm",
"Microsoft.Android.Runtime.Mono.36.android-arm64",
"Microsoft.Android.Runtime.Mono.36.android-x86",
"Microsoft.Android.Runtime.Mono.36.android-x64",
"Microsoft.Android.Templates"
],

These were restoring on the first build, but if they are so small now let's just install them to avoid messing with feeds for nightly builds?

Otherwise, this looks good to me, can it be taken out of draft? 😄

@pjcollins
Copy link
Member Author

One other thing worth noting for our future selves, when .NET 11 comes around I think we'll need to update this section to also include this new Microsoft.Android.Runtimes fx:

<ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'android' and $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '9.0')) ">
<KnownFrameworkReference
Update="Microsoft.Android"
LatestRuntimeFrameworkVersion="@NET_PREVIOUS_VERSION@"
TargetingPackVersion="@NET_PREVIOUS_VERSION@"
/>
</ItemGroup>

@pjcollins pjcollins merged commit 893a981 into main Apr 23, 2025
59 checks passed
@pjcollins pjcollins deleted the dev/pjc/noabifx branch April 23, 2025 16:30
@github-actions github-actions bot locked and limited conversation to collaborators May 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants