Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[RuntimeInteference.targets] add property to opt out of R2R error mes…
…sage

Context: d21e6bf
Context: dotnet/android#10062

We have experimental support for CoreCLR+R2R on Android. Android is
also unique in that a default build can target multiple RIDs via:

    <RuntimeIdentifiers>android-arm;android-arm64;android-x86;android-x64</RuntimeIdentifiers>

Unfortunately, targeting 4 RIDs like this results in:

    dotnet/sdk/10.0.100-preview.4.25180.3/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

But simply skipping this error message allows the build to succeed, and
R2R successfully runs on all 4 RIDs.

Just like in d21e6bf, I introduced a new
`$(AllowReadyToRunWithoutRuntimeIdentifier)` property to opt out of
this error message.

I also added `$(AllowPublishSingleFileWithoutRuntimeIdentifier)`, to
give the same flexibility in the future.
  • Loading branch information
jonathanpeppers committed Apr 22, 2025
commit 115dd481d4680ff8005db3d1e14a0d67a07af22e
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ Copyright (c) .NET Foundation. All rights reserved.
ResourceName="ImplicitRuntimeIdentifierResolutionForPublishPropertyFailed"
FormatArguments="SelfContained"/>

<NETSdkError Condition="'$(PublishReadyToRun)' == 'true' and '$(RuntimeIdentifier)' == '' and '$(_IsPublishing)' == 'true'"
<NETSdkError Condition="'$(PublishReadyToRun)' == 'true' and '$(RuntimeIdentifier)' == '' and '$(_IsPublishing)' == 'true' and '$(AllowReadyToRunWithoutRuntimeIdentifier)' != 'true'"
ResourceName="ImplicitRuntimeIdentifierResolutionForPublishPropertyFailed"
FormatArguments="PublishReadyToRun"/>

<NETSdkError Condition="'$(PublishSingleFile)' == 'true' and '$(RuntimeIdentifier)' == '' and '$(_IsPublishing)' == 'true'"
<NETSdkError Condition="'$(PublishSingleFile)' == 'true' and '$(RuntimeIdentifier)' == '' and '$(_IsPublishing)' == 'true' and '$(AllowPublishSingleFileWithoutRuntimeIdentifier)' != 'true'"
ResourceName="ImplicitRuntimeIdentifierResolutionForPublishPropertyFailed"
FormatArguments="PublishSingleFile"/>

Expand Down