-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consume portable RID graph from runtime #17760
Conversation
1. Consume portable RID graph from runtime (subsequent PR will delete it from sdk). 2. Use the portable RID graph in source build projects 3. Delete the mutate RID graph and invocation as that's already handled directly in runtime.
<GenerateSdkRuntimeIdentifierChain | ||
RuntimeIdentifier="$(PortableProductMonikerRid)" | ||
RuntimeIdentifierGraphPath="$(SdkOutputDirectory)RuntimeIdentifierGraph.json" | ||
RuntimeIdentifierGraphPath="$(SdkOutputDirectory)PortableRuntimeIdentifierGraph.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have absolutely no idea what that chain file is about but it should still work as expected with the portable RID graph. In general, our product build shouldn't use the legacy RID graph anymore which only exists to make the back compat switch work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This chain file contains an ordered list of rids that are usable with the rid being built.
On the 8.0 rc2 I have installed on Fedora it contains:
linux-x64
linux
unix-x64
unix
any
I'm slightly surprised it doesn't include the source-build non-portable rid.
The CLI seems to use it for some things.
Contributes to #35750 Related: dotnet/installer#17760
<Target Name="SetOutputList" AfterTargets="Package" BeforeTargets="GatherBuiltPackages"> | ||
<ItemGroup> | ||
<PackagesOutputList Include="$(ShippingPackagesOutput)" /> | ||
<PackagesOutputList Include="$(NonShippingPackagesOutput)" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<Target Name="UpdateRuntimeGraph" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see this source-build specialization removed.
smoke-tests surfaced some rid related issues:
|
Yes, I hope that @tmds can help me understand the failures: 9ce6a45#r132417371 |
@@ -1195,9 +1195,13 @@ Copyright (c) .NET Foundation. All rights reserved. | |||
DestinationFiles="$(SdkOutputDirectory)RuntimeIdentifierGraph.json" | |||
SkipUnchangedFiles="true"/> | |||
|
|||
<Copy SourceFiles="$(NuGetPackageRoot)/microsoft.netcore.platforms/$(_NETCorePlatformsPackageVersion)/PortableRuntimeIdentifierGraph.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my understanding:
Is this copying from a package that is produced by the runtime repo build?
Did we not have to copy this previously because it came with the sdk repo build output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly. The package is produced in runtime. The portable RID graph was previously checked into the sdk directly. We want to remove that extra copy now and use the package from runtime as the source of truth.
I think there's an issue mapping the non-portable source-built rid ( <ProcessFrameworkReferences FrameworkReferences="@(FrameworkReference)"
...
RuntimeGraphPath="$(RuntimeIdentifierGraphPath)"
...
NETCoreSdkRuntimeIdentifier="$(NETCoreSdkRuntimeIdentifier)"
... That would mean that the non-portable rid was not added to the |
@tmds do you know where that file is coming from? I can't find it checked-in anywhere. 9ce6a45#diff-de198c84af9d2e1870737bbc063dd42615618c702cc0a1f4c41b40fc11a16e59R78 |
In Probably the changes cause to use the original |
Right. But do you know where this path is: |
installer/src/SourceBuild/content/repo-projects/runtime.proj Lines 64 to 74 in dccd713
I think this is dead code. Nothing sets Afaik, the patching of the runtime graph with non-portable rids is working well since .NET 7 when the runtime repo assumed that responsibility. |
This confuses me:
Shouldn't this import Here's the live built RID graph: PortableRuntimeIdentifierGraph.json Yes, that's the issue. The current portable runtime json file has the following entry:
This needs a fix in runtime. |
@@ -16,7 +16,7 @@ | |||
<RuntimeOS>$(NETCoreSdkRuntimeIdentifier.Substring(0, $(_platformIndex)))</RuntimeOS> | |||
|
|||
<_platformIndex>$(NETCoreSdkPortableRuntimeIdentifier.LastIndexOf('-'))</_platformIndex> | |||
<BaseOS>$(NETCoreSdkPortableRuntimeIdentifier.Substring(0, $(_platformIndex)))</BaseOS> | |||
<BaseOS>$(NETCoreSdkPortableRuntimeIdentifier.Substring(0, $(_platformIndex)))-$(Platform)</BaseOS> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tmds I had to add the Platform
property here so that AdditionalRuntimeIdentifierParent is set to the right value.
This needs to change as we now use a different "add current RID to RID graph" code in runtime (the one that originated in sdk): https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.NETCore.Platforms/src/UpdateRuntimeIdentifierGraph.cs
Please double check if this is correct. Should we change the name of this property to PortableRid
(which is what sdk.proj uses)? Changing the property name would require a change in runtime.
I assume your pipelines pass BaseOS
in as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to change as we now use a different "add current RID to RID graph" code in runtime (the one that originated in sdk): https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.NETCore.Platforms/src/UpdateRuntimeIdentifierGraph.cs
Yes, it seems that the task that updated the old runtime graph didn't expect this to include an architecture (which is why this is named OS
and not Rid
), while the new task that updates the new graphs expects this to include an architecture.
Please double check if this is correct. Should we change the name of this property to PortableRid (which is what sdk.proj uses)? Changing the property name would require a change in runtime.
If it includes an architecture, it makes more sense to end with a Rid
suffix.
Yes, this line needs to change: https://github.com/dotnet/runtime/blob/487d7f010b90a82178d55eea21e72dc6dedf9d5d/eng/SourceBuild.props#L45.
Contributes to dotnet/sdk#35750
cc @tmds