Skip to content

Conversation

jonathanpeppers
Copy link
Member

@jonathanpeppers jonathanpeppers commented Jun 24, 2025

Context: #10007

Just like we enable $(RunAOTCompilation) and $(AndroidEnableProfiledAot) in Release mode by default for Mono, we should enable R2R composite for CoreCLR.

"One weird trick" we're doing is to set $(_IsPublishing) by default, so the correct packs can be restored & ran during a dotnet build. We were already doing this for NativeAOT, so hoping the same trick will work for CoreCLR.

I also updated the BasicApplicationPublishReadyToRun() test to verify these defaults are working as expected.

Context: #10007

Just like we enable `$(RunAOTCompilation)` and
`$(AndroidEnableProfiledAot)` in `Release` mode by default for Mono,
we should enable R2R composite for CoreCLR.

"One weird trick" we're doing is to set `$(_IsPublishing)` by default,
so the correct packs can be restored & ran during a `dotnet build`. We
were already doing this for NativeAOT, so hoping the same trick will
work for CoreCLR.

I also updated the `BasicApplicationPublishReadyToRun()` test to
verify these defaults are working as expected.
<PublishReadyToRun Condition=" '$(PublishReadyToRun)' == '' and '$(Configuration)' == 'Release' ">true</PublishReadyToRun>
<PublishReadyToRunComposite Condition=" '$(PublishReadyToRunComposite)' == '' and '$(PublishReadyToRun)' == 'true' ">true</PublishReadyToRunComposite>
<_IsPublishing Condition=" '$(_IsPublishing)' == '' and '$(PublishReadyToRun)' == 'true' ">true</_IsPublishing>
<AllowReadyToRunWithoutRuntimeIdentifier Condition=" '$(PublishReadyToRun)' == 'true' and '$(RuntimeIdentifiers)' != '' ">true</AllowReadyToRunWithoutRuntimeIdentifier>
Copy link
Member Author

Choose a reason for hiding this comment

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

Note that this is required for multi-RID builds:

(_CheckForUnsupportedAppHostUsage target) -> 
    C:\a\_work\1\s\bin\Release\dotnet\sdk\10.0.100-preview.6.25304.106\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(219,5):
    error NETSDK1191: A runtime identifier for the property 'PublishReadyToRun' couldn't be inferred. Specify a rid explicitly. 

@jonathanpeppers jonathanpeppers marked this pull request as ready for review June 27, 2025 18:00
@grendello grendello merged commit 9861b57 into main Jun 30, 2025
59 checks passed
@grendello grendello deleted the dev/peppers/r2r-release-default branch June 30, 2025 08:37
@github-actions github-actions bot locked and limited conversation to collaborators Jul 30, 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.

2 participants