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

[build] runtime "flavors" part 2 #9598

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

jonathanpeppers
Copy link
Member

Context: #9538
Context: #9583

Expanding upon #9538, there are more changes required to support multiple runtime flavors in our build.

  • Remove $(MicrosoftAndroidArmPackDir) and related properties, to rely on a new @(AndroidAbiAndRuntimeFlavor) item group instead.

  • Exclude our Mono-related native libraries from NativeAOT runtime packs.

  • Ensure that our runtime packs copy assemblies (Mono.Android.dll, etc.) to the appropriate NativeAOT-related directories.

  • List our Microsoft.Android.Runtime.NativeAOT.* packs in the WorkloadManifest.json, so that **FromWorkload** can resolve the version number for them. They can still restore via NuGet.

@jonathanpeppers jonathanpeppers force-pushed the dev/peppers/runtime/flavor/part2 branch from 0f0de53 to 3729f16 Compare December 6, 2024 17:11
@jpobst
Copy link
Contributor

jpobst commented Dec 6, 2024

Just a nitpick, but should the runtime be "CoreCLR" instead of "NativeAOT"?

@jonathanpeppers
Copy link
Member Author

Not adding CoreCLR yet, I have NativeAOT's build working (apps don't run) within our targets here:

There are a few hacks, mostly related to forcing the linux-bionic-arm64 RID.

We might be able to merge it next week and then think about getting "hello world" to actually run on NativeAOT.

@jonathanpeppers

This comment was marked as outdated.

Context: #9538
Context: #9583

Expanding upon #9538, there are more changes required to support
multiple runtime flavors in our build.

* Remove `$(MicrosoftAndroidArmPackDir)` and related properties, to
  rely on a new `@(AndroidAbiAndRuntimeFlavor)` item group instead.

* Exclude our Mono-related native libraries from NativeAOT runtime
  packs.

* Ensure that our runtime packs copy assemblies (`Mono.Android.dll`,
  etc.) to the appropriate NativeAOT-related directories.

* List our `Microsoft.Android.Runtime.NativeAOT.*` packs in the
  `WorkloadManifest.json`, so that `**FromWorkload**` can resolve the
  version number for them. They can still restore via NuGet.
@jonathanpeppers jonathanpeppers force-pushed the dev/peppers/runtime/flavor/part2 branch from 3729f16 to c04fdde Compare December 9, 2024 14:40
@jonathanpeppers

This comment was marked as outdated.

@jonathanpeppers jonathanpeppers marked this pull request as ready for review December 9, 2024 15:55
@jonathanpeppers
Copy link
Member Author

The one test failure look ok to ignore:

Mono.Android.NET_Tests, Xamarin.Android.NetTests.AndroidMessageHandlerTests.AndroidHandlerTestBase.Redirect_Without_Protocol_Works / Debug
System.Net.Http.HttpRequestException : Response status code does not indicate success: 502 (Bad Gateway).

Copy link
Contributor

@dellis1972 dellis1972 left a comment

Choose a reason for hiding this comment

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

This looks ok to me.

"Microsoft.Android.Runtime.NativeAOT.35.android-x64": {
"kind": "framework",
"version": "@WORKLOAD_VERSION@"
},
Copy link
Member

Choose a reason for hiding this comment

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

As we continue to expand this list, we probably will want to revisit dotnet/sdk#24077 / dotnet/sdk#24873. For .NET 10, we're very much going to want to come up with a way to cut down on the (now 8, ~soon to be 12?) duplicate versions of Mono.Android.dll (~35 MB each) and friends that we will be shipping.

Copy link
Member

@pjcollins pjcollins left a comment

Choose a reason for hiding this comment

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

Looks good, but we should add a new issue or comment to the relevant backlog for this work to revisit generation of a "rid-less" runtime pack.

@jonathanpeppers
Copy link
Member Author

@jonathanpeppers jonathanpeppers merged commit fc88da7 into main Dec 9, 2024
56 of 58 checks passed
@jonathanpeppers jonathanpeppers deleted the dev/peppers/runtime/flavor/part2 branch December 9, 2024 21:49
grendello added a commit that referenced this pull request Jan 7, 2025
* main: (25 commits)
  [CI] Break "Linux Tests" into 2 parallel jobs. (#9642)
  Fix `WorkloadDependencies.proj` build. (#9648)
  [CI] Set "WearOS Tests" parallelization to 2 agents. (#9639)
  [CI] Break "Package Tests" into 2 parallel jobs. (#9638)
  Bump to DevDiv/android-platform-support@3b4e16f1 (#9632)
  [NativeAOT] improve build logic, part 2 (#9631)
  Bump to dotnet/java-interop@2c06b3c2 (#9633)
  [NativeAOT] improve build logic, part 1 (#9614)
  [build] Generate `WorkloadDependencies.json` (#9613)
  [monodroid] remove `monodroid_get_log_categories()` (#9625)
  [monodroid] remove `_monodroid_get_identity_hash_code` (#9622)
  Bump to dotnet/java-interop@f800ea52 (#9607)
  [XABT] Break BuildApk into individual tasks for each content type. (#9612)
  [Mono.Android] Bind Android API-Baklava DP1 (#9594)
  [Xamarin.Android.Build.Tasks] Extract `BuildArchive` from `BuildApk` (#9556)
  [NativeAOT] MSBuild-related logic to get projects to build (#9583)
  [build] remove remnants of `OpenTK-1.0.dll` (#9610)
  [build] remove `Xamarin.Android.CSharp.targets` (#9609)
  [build] runtime "flavors" part 2 (#9598)
  Bump com.android.tools.build:manifest-merger to 31.7.3 (#9600)
  ...
grendello added a commit that referenced this pull request Jan 7, 2025
* dev/grendel/use-libc++: (25 commits)
  [CI] Break "Linux Tests" into 2 parallel jobs. (#9642)
  Fix `WorkloadDependencies.proj` build. (#9648)
  [CI] Set "WearOS Tests" parallelization to 2 agents. (#9639)
  [CI] Break "Package Tests" into 2 parallel jobs. (#9638)
  Bump to DevDiv/android-platform-support@3b4e16f1 (#9632)
  [NativeAOT] improve build logic, part 2 (#9631)
  Bump to dotnet/java-interop@2c06b3c2 (#9633)
  [NativeAOT] improve build logic, part 1 (#9614)
  [build] Generate `WorkloadDependencies.json` (#9613)
  [monodroid] remove `monodroid_get_log_categories()` (#9625)
  [monodroid] remove `_monodroid_get_identity_hash_code` (#9622)
  Bump to dotnet/java-interop@f800ea52 (#9607)
  [XABT] Break BuildApk into individual tasks for each content type. (#9612)
  [Mono.Android] Bind Android API-Baklava DP1 (#9594)
  [Xamarin.Android.Build.Tasks] Extract `BuildArchive` from `BuildApk` (#9556)
  [NativeAOT] MSBuild-related logic to get projects to build (#9583)
  [build] remove remnants of `OpenTK-1.0.dll` (#9610)
  [build] remove `Xamarin.Android.CSharp.targets` (#9609)
  [build] runtime "flavors" part 2 (#9598)
  Bump com.android.tools.build:manifest-merger to 31.7.3 (#9600)
  ...
@github-actions github-actions bot locked and limited conversation to collaborators Jan 9, 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