Skip to content
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

[.NET 10] investigate how to ship fewer copies of Mono.Android.dll #9606

Open
jonathanpeppers opened this issue Dec 9, 2024 · 2 comments
Open
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects. enhancement Proposed change to current functionality.
Milestone

Comments

@jonathanpeppers
Copy link
Member

Android framework version

Other

Affected platform version

.NET 10

Description

Right now we have this many Mono.Android.dll

  • ref pack, reference assembly for Mono.Android.dll
  • android-arm Mono.Android.dll
  • android-arm64 Mono.Android.dll
  • android-x86 Mono.Android.dll
  • android-x64 Mono.Android.dll

Where the last four are identical, because it's managed code and not tied to a RID at all. Ideally, we could reduce this to 1 ref assembly and 1 runtime assembly.

This is going to get even worse if we support multiple runtimes in the future: NativeAOT, etc.

Steps to Reproduce

  1. dotnet workload install android
  2. Look at the Mono.Android.dll files on disk.

Did you find any workaround?

n/a

Relevant log output

@jonathanpeppers jonathanpeppers added Area: App+Library Build Issues when building Library projects or Application projects. enhancement Proposed change to current functionality. labels Dec 9, 2024
@jonathanpeppers jonathanpeppers added this to the .NET 10 milestone Dec 9, 2024
@dotnet-policy-service dotnet-policy-service bot added the needs-triage Issues that need to be assigned. label Dec 9, 2024
@jpobst jpobst removed the needs-triage Issues that need to be assigned. label Dec 9, 2024
@jpobst jpobst changed the title [.NET 10] investigate how to ship less copies of Mono.Android.dll [.NET 10] investigate how to ship fewer copies of Mono.Android.dll Dec 11, 2024
@jpobst
Copy link
Contributor

jpobst commented Dec 11, 2024

This is going to get even worse if we support multiple runtimes in the future: NativeAOT, etc.

Also with Google now releasing APIs twice a year, it's going to get worse due to supporting multiple API Levels per .NET version.

@jonpryor
Copy link
Member

I thought I had asked/commented somewhere, "Is there a reason for us to have per-RID binaries?" Alas, I can't find me actually asking that, but it's still pertinent.

After some discussions with Peppers, we thought of a reason to have per-RID binaries: ReadyToRun places native code within the assembly, and we may want to provide ReadyToRun images within Java.Interop.dll and Mono.Android.dll to assist app startup times even in Debug configurations.

Meaning we probably will want per-RID copies of assemblies.

What needs exploration is whether each separate supported runtime will require different per-RID assemblies. If we assume builds of Mono.Android.dll for android-arm, android-arm64, android-x86, android-x64, and that each such build contains a ReadyToRun image, can that same binary assembly used by all of MonoVM, CoreCLR, and NativeAOT? If yes, then we can continue to ship 5 copies, and not (4 {RIDs} * 3 {runtimes})+1 = 13 copies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: App+Library Build Issues when building Library projects or Application projects. enhancement Proposed change to current functionality.
Projects
None yet
Development

No branches or pull requests

4 participants