Skip to content

Commit bfba2ac

Browse files
committed
only use the LEAF rids to compute compatibility with user-provided RIDs
This ensures that valid-but-meaninless in this context RIDs (like unix, any, base, etc.) are not take into consideration for compatibility
1 parent 8bbd201 commit bfba2ac

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Microsoft.NET.Build.Containers/Registry.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,12 @@ async Task<HttpResponseMessage> GetBlob(string repositoryName, string digest)
146146
return response;
147147
}
148148

149-
private string? CheckIfRidExistsInGraph(RuntimeGraph graphForManifestList, string userRid) => graphForManifestList.Runtimes.FirstOrDefault(kvp => graphForManifestList.AreCompatible(kvp.Key, userRid)).Key;
149+
private string? CheckIfRidExistsInGraph(RuntimeGraph graphForManifestList, string userRid) {
150+
var leafRids =
151+
graphForManifestList.Runtimes.Keys
152+
.Where(k => !graphForManifestList.Runtimes.Values.Any(r => r.InheritedRuntimes.Contains(k)));
153+
return leafRids.FirstOrDefault(leaf => graphForManifestList.AreCompatible(leaf, userRid));
154+
}
150155

151156
private (IReadOnlyDictionary<string, PlatformSpecificManifest>, RuntimeGraph) ConstructRuntimeGraphForManifestList(ManifestListV2 manifestList, RuntimeGraph dotnetRuntimeGraph)
152157
{

0 commit comments

Comments
 (0)