Use PortableRuntimeIdentifierGraph in ToolPackage#55046
Conversation
Where does it end up using it? |
|
sdk/src/Layout/redist/targets/GenerateLayout.targets Lines 13 to 15 in dec5a57 It copies runtime.json (legacy graph) as RuntimeIdentifier.json which ends up at "openbsd-x64": {
"#import": [
"openbsd-x64"
]
}(without the proper hierarchy) |
|
I published openbsd-x64 sdk via GA workflow https://github.com/am11/dotnet-riscv/releases/tag/11.0.100-preview.7.26327.199, if you extract the tar, you will find both files under that location. |
That sounds like a bug at https://github.com/dotnet/runtime/blob/567a079a3f45e2e217815b49e1e09fa76ab72f11/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj#L29C46-L29C55 . This line will introduce the self-reference when TargetRid == PortableTargetRid . |
|
@jkotas, I have tested with this PR and can confirm that If it makes sense then this PR switching to portable graph (when available; not available in <.NET8 TFMs) can move forward. dotnet/runtime#129929 is optional; it only makes sense if this PR is not accepted, or if we want to support
Correctness fix is in dotnet/runtime#129944 (i.e. it is unrelated to |
There was a problem hiding this comment.
Pull request overview
Updates dotnet tool’s RID graph lookup to use the portable runtime identifier graph so newer platforms (e.g., OpenBSD) can resolve RID-specific tool packages correctly, aligning tool behavior with post-.NET 8 RID-graph expectations.
Changes:
- Switch default runtime graph file from
RuntimeIdentifierGraph.json(legacy/frozen) toPortableRuntimeIdentifierGraph.jsonfor tool package operations.
jkotas
left a comment
There was a problem hiding this comment.
Migrating away from the legacy RID graph for tools looks good to me.
I will leave this for the tools area owners to sign off.
|
@baronfel could you (or refer someone to) review this patch? Thanks! :) |
baronfel
left a comment
There was a problem hiding this comment.
LGTM - though we should log this as a breaking change in the .NET 11 tools since any tools that use platform identifiers that are not in the new portable graph would no longer to be able to be installed.
|
Added When you commit this breaking change:
You can refer to the .NET SDK breaking change guidelines |
|
@baronfel, it's a breaking change, in theory, but not in the way the "portable" vs. non-portable distinction might initially suggest. Before: it uses the full After: it uses This effectively produces That missing |
|
To wit: $ docker run --rm fedora bash -c 'dnf install -y dotnet-sdk-10.0 &>/dev/null &&
tail -10 /usr/lib64/dotnet/sdk/*/PortableRuntimeIdentifierGraph.json'
"win"
]
},
"fedora.44-arm64": {
"#import": [
"linux-arm64"
]
}
} |
|
WRT the breaking change, is a tool targeting something like |
If SDK was built with If SDK was built with |
We have a build property you can set to use the older graph during build, in order to consume older packages that use the old RIDs. We don't currently have anything like that for tool packages. Can we do an analysis of how many tool packages use RIDs that aren't in the portable graph? @baronfel @nkolev92 If there are such tool packages, we might want to change the logic for tools to try to use the portable graph, and if that fails fall back to the old RID graph. |
We can add an explicit switch |
|
I went spelunking in the NuGet package telemetry for the latest versions of all tool packages on NuGet.org, and inspected their listed files to determine the TFMs and RIDs (if any) supported by those tools. No tool packages had any RIDs that were only on the old graph - so I feel pretty confident in making this change. |
The legacy graph is frozen since .NET 8 and we are supposed to use portable graph for new platforms. However, after building OpenBSD, I found that "dotnet tool" fails as it ends up using the legacy graph.