Skip to content

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

Merged
pjcollins merged 11 commits into
mainfrom
dev/pjc/noabifx
Apr 23, 2025
Merged

pjcollins merged 11 commits into
mainfrom
dev/pjc/noabifx

Conversation

@pjcollins

@pjcollins pjcollins commented Apr 15, 2025 •

Copy link
Copy Markdown
Member

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
Copy Markdown
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!

Comment thread build-tools/create-packs/ConfigureLocalWorkload.targets Outdated
@pjcollins

Copy link
Copy Markdown
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
Copy Markdown
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

@jonathanpeppers jonathanpeppers left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
@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