Skip to content

[coreclr] projects with UseMonoRuntime=false successfully build #9754

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 3 commits into from
Feb 5, 2025

Conversation

jonathanpeppers
Copy link
Member

This is a step towards Android projects using UseMonoRuntime=false successfully:

  1. Create new packs such as Microsoft.Android.Runtime.CoreCLR.[api].[rid]

  2. Ensure a project builds with UseMonoRuntime=false in both Debug and Release configurations.

  3. The project will not be able to run successfully yet.

(Significant work required for no. 3)

This is a step towards Android projects using `UseMonoRuntime=false`
successfully:

1. Create new packs such as `Microsoft.Android.Runtime.CoreCLR.[api].[rid]`

2. Ensure a project *builds* with `UseMonoRuntime=false` in both
  `Debug` and `Release` configurations.

3. The project will not be able to run successfully yet.

(Significant work required for no. 3)
@jonathanpeppers jonathanpeppers marked this pull request as ready for review February 5, 2025 13:23
@jonathanpeppers

This comment was marked as outdated.

Path.Combine (XABuildPaths.BuildOutputDirectory, "nuget-unsigned"),
}
};
proj.SetProperty ("UseMonoRuntime", "false"); // Enables CoreCLR
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this one bool property going to be enough? As we will have MonoVM, CoreCLR and NativeAOT?

Copy link
Member Author

Choose a reason for hiding this comment

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

The logic is here:

<_AndroidRuntime Condition=" '$(PublishAot)' == 'true' and '$(UseMonoRuntime)' != 'true' ">NativeAOT</_AndroidRuntime>
<_AndroidRuntime Condition=" '$(PublishAot)' != 'true' and '$(UseMonoRuntime)' != 'true' ">CoreCLR</_AndroidRuntime>
<_AndroidRuntime Condition=" '$(_AndroidRuntime)' == '' ">MonoVM</_AndroidRuntime>

But yeah, I think they need to invent a new property. $(PublishAot) and $(UseMonoRuntime) are what iOS uses currently.

@jonathanpeppers
Copy link
Member Author

Latest build produces new packs:

image

Comment on lines -30 to +31
<Import Project="Microsoft.Android.Sdk.NativeAOT.targets" Condition=" '$(_AndroidRuntime)' == 'NativeAOT' And '$(DesignTimeBuild)' != 'true' " />
<Import Project="Microsoft.Android.Sdk.CoreCLR.targets" Condition=" '$(_AndroidRuntime)' == 'CoreCLR' " />
<Import Project="Microsoft.Android.Sdk.NativeAOT.targets" Condition=" '$(_AndroidRuntime)' == 'NativeAOT' " />
Copy link
Member

Choose a reason for hiding this comment

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

Just curious, why was there: '$(DesignTimeBuild)' != 'true' before ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this was accidental in an unrelated change: 9ed1469

When I saw it, felt like it would be wrong because it would prevent NativeAOT packs from being used in a design-time build.

@jonathanpeppers jonathanpeppers merged commit 7d04764 into main Feb 5, 2025
58 checks passed
@jonathanpeppers jonathanpeppers deleted the dev/peppers/coreclrbuilds branch February 5, 2025 19:06
grendello added a commit that referenced this pull request Feb 6, 2025
* main:
  [XABT] Ensure `$(DocumentationFile)` correctly uses `$(OutputPath)`. (#9755)
  [coreclr] projects with `UseMonoRuntime=false` successfully build (#9754)
  [.github] Update issue templates to include `net10.0-android`. (#9753)
@github-actions github-actions bot locked and limited conversation to collaborators Mar 8, 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.

3 participants