Conversation
Replace the stale Mariner 2.0 RID string check with the Azure Linux 3.0 RID while keeping the cm.2 runtime RID normalization in place. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the layout build RID normalization logic to recognize Azure Linux 3.0 RIDs (instead of the older Mariner 2.0 string) while still mapping runtime asset selection to the existing cm.2 RID.
Changes:
- Update the
NetRuntimeRidnormalization check frommariner.2.0toazurelinux.3.0. - Preserve the normalization target to
cm.2for runtime asset compatibility.
| <NetRuntimeRid Condition="'$(NetRuntimeRid)' == ''">$(HostRid)</NetRuntimeRid> | ||
| <NetRuntimeRid Condition="('$(OSName)' == 'win' or '$(OSName)' == 'osx' or '$(OSName)' == 'freebsd' or '$(OSName)' == 'openbsd' or '$(OSName)' == 'illumos' or '$(OSName)' == 'solaris' or '$(OSName)' == 'haiku') and '$(DotNetBuildSourceOnly)' != 'true'">$(OSName)-$(TargetArchitecture)</NetRuntimeRid> | ||
| <NetRuntimeRid Condition="'$(DotNetBuild)' != 'true' and $(NetRuntimeRid.StartsWith('mariner.2.0'))">$(HostRid.Replace('mariner.2.0', 'cm.2'))</NetRuntimeRid> | ||
| <NetRuntimeRid Condition="'$(DotNetBuild)' != 'true' and $(NetRuntimeRid.StartsWith('azurelinux.3.0'))">$(HostRid.Replace('azurelinux.3.0', 'cm.2'))</NetRuntimeRid> |
There was a problem hiding this comment.
The condition is based on NetRuntimeRid, but the replacement is applied to HostRid. If NetRuntimeRid is set explicitly (e.g., for cross/target layout generation), this will overwrite it with a value derived from the host RID (and potentially the host architecture), which can produce an incorrect runtime RID. Consider applying the replacement to $(NetRuntimeRid) (or, if the intent is host-only normalization, make the condition check HostRid.StartsWith(...) as well) so the same RID is used consistently.
| <NetRuntimeRid Condition="'$(DotNetBuild)' != 'true' and $(NetRuntimeRid.StartsWith('azurelinux.3.0'))">$(HostRid.Replace('azurelinux.3.0', 'cm.2'))</NetRuntimeRid> | |
| <NetRuntimeRid Condition="'$(DotNetBuild)' != 'true' and $(NetRuntimeRid.StartsWith('azurelinux.3.0'))">$(NetRuntimeRid.Replace('azurelinux.3.0', 'cm.2'))</NetRuntimeRid> |
Note
This PR was AI/Copilot-generated.
Summary
Update the layout RID normalization to key off Azure Linux 3.0 instead of the old Mariner 2.0 RID string while continuing to map to the existing
cm.2runtime assets.mariner.2.0string match withazurelinux.3.0cm.2runtime RID normalization behaviorFollow-up to dotnet/runtime#126528.