You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[RuntimeInteference.targets] add property to opt out of R2R error message (#48624)
Context: #36047
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.
<NETSdkErrorCondition="'$(PublishReadyToRun)' == 'true' and '$(RuntimeIdentifier)' == '' and '$(_IsPublishing)' == 'true'"
219
+
<NETSdkErrorCondition="'$(PublishReadyToRun)' == 'true' and '$(RuntimeIdentifier)' == '' and '$(_IsPublishing)' == 'true' and '$(AllowReadyToRunWithoutRuntimeIdentifier)' != 'true'"
<NETSdkErrorCondition="'$(PublishSingleFile)' == 'true' and '$(RuntimeIdentifier)' == '' and '$(_IsPublishing)' == 'true'"
223
+
<NETSdkErrorCondition="'$(PublishSingleFile)' == 'true' and '$(RuntimeIdentifier)' == '' and '$(_IsPublishing)' == 'true' and '$(AllowPublishSingleFileWithoutRuntimeIdentifier)' != 'true'"
0 commit comments