Skip to content

Conversation

@rmarinho
Copy link
Member

Description of Change

Change the pipelines to allow to run the tests with CoreCLR

This pull request introduces support for using CoreCLR in Android builds and tests. The changes include updates to the build script (android.cake) to handle a new useCoreClr argument, modifications to pipeline templates to propagate this parameter, and adjustments to build and test logic.

Build Script Updates:

  • Added a new useCoreClr argument to the android.cake script, defaulting to false. This argument is passed to the ExecuteBuild method. [1] [2] [3]
  • Updated the ExecuteBuild method to conditionally append the /p:UseMonoRuntime=false MSBuild property when useCoreClr is enabled.

Pipeline Template Updates:

  • Introduced a useCoreClr parameter in device-tests-jobs.yml and device-tests-steps.yml, defaulting to false. This parameter is passed through various pipeline configurations. [1] [2]
  • Updated job display names to indicate when CoreCLR is being used.
  • Propagated the useCoreClr parameter to build and test steps, ensuring it is included in the dotnet cake command. [1] [2]

Android-Specific Pipeline Enhancements:

  • Added a conditional block in device-tests.yml to handle Android-specific projects with the useCoreClr parameter.

Issues Fixed

Fixes #30277

@rmarinho rmarinho added this to the .NET 10.0-preview7 milestone Jul 17, 2025
Copilot AI review requested due to automatic review settings July 17, 2025 15:25
@rmarinho rmarinho requested a review from a team as a code owner July 17, 2025 15:25
@rmarinho rmarinho added the area-testing Unit tests, device tests label Jul 17, 2025
Copy link
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

This pull request introduces support for using CoreCLR runtime instead of Mono in Android device tests by adding a new useCoreClr parameter throughout the build pipeline. The changes enable the option to run Android tests with CoreCLR while maintaining backward compatibility with the default Mono runtime.

  • Adds useCoreClr parameter to pipeline templates and build scripts
  • Updates Android build logic to conditionally set MSBuild properties for CoreCLR
  • Extends pipeline configurations to support CoreCLR testing workflows

Reviewed Changes

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

File Description
eng/pipelines/common/device-tests.yml Adds new Android-specific block with CoreCLR parameter
eng/pipelines/common/device-tests-steps.yml Passes useCoreClr parameter to build command
eng/pipelines/common/device-tests-jobs.yml Adds CoreCLR parameter and updates display names
eng/devices/android.cake Implements CoreCLR logic with MSBuild property configuration
Comments suppressed due to low confidence (1)

eng/devices/android.cake:28

  • The argument name 'coreclr' is inconsistent with the variable name 'useCoreClr' and the parameter name used throughout the pipeline templates. Consider using 'useCoreClr' for consistency.
var useCoreClr = Argument("coreclr", false);

<RuntimeIdentifier Condition="$(TargetFramework.Contains('-maccatalyst'))">maccatalyst-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="$(TargetFramework.Contains('-maccatalyst')) and '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'arm64'">maccatalyst-arm64</RuntimeIdentifier>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">android-arm64;android-x86;android-x64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">android-arm64;android-x64</RuntimeIdentifiers>
Copy link
Member

Choose a reason for hiding this comment

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

Just FYI, if you have tests that run on a really old API level somewhere (maybe main?), you might need android-x86 in some cases. It depends on if Google put out an x86_64 emulator image for each version.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah on our main build we run from 23/33

@rmarinho
Copy link
Member Author

/rebase

@jonathanpeppers
Copy link
Member

@rmarinho is there a way we can merge this, but only run CoreCLR on the newer API levels?

I think it's only broken on older ones, @simonrozsival is still investigating which one breaks.

@rmarinho rmarinho moved this from Todo to In Progress in MAUI SDK Ongoing Jul 29, 2025
@rmarinho
Copy link
Member Author

/rebase

@PureWeen PureWeen moved this from In Progress to Ready To Review in MAUI SDK Ongoing Aug 4, 2025
@rmarinho
Copy link
Member Author

/rebase

@rmarinho
Copy link
Member Author

rmarinho commented Aug 18, 2025

This is still waiting for dotnet/runtime#118161 so it runs on old devices

@jonathanpeppers
Copy link
Member

@rmarinho .NET 10 dotnet/runtime, might be "done". It's past the "platform shutdown" date.

Can we just run CoreCLR on the newest API level? Just a single one is enough.

@rmarinho rmarinho modified the milestones: .NET 10.0-rc1, .NET 10.0-rc2 Aug 19, 2025
Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

@rmarinho Could you rebase and fix the conflict? Thanks in advance.

[ci] Review changes

[ci] Fix job names

try again

Again

Use core CLR
@rmarinho rmarinho merged commit b09df6d into net10.0 Sep 30, 2025
159 of 164 checks passed
@rmarinho rmarinho deleted the fix-30277 branch September 30, 2025 12:52
@github-project-automation github-project-automation bot moved this from Ready To Review to Done in MAUI SDK Ongoing Sep 30, 2025
@PureWeen PureWeen mentioned this pull request Oct 21, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-testing Unit tests, device tests

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants