-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Simplify RID graph #123161
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
base: main
Are you sure you want to change the base?
Simplify RID graph #123161
Conversation
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.
Copilot wasn't able to review any files in this pull request.
|
Haven't taken an in-depth look, but I think the complete removal of |
|
Fair. Anything with a UI stack should have a root. I can add that back. |
|
Added When you commit this breaking change:
Tagging @dotnet/compat for awareness of the breaking change. |
So this RID graph flows into the SDK and it redistributes it as We also used this RID graph when generating the fallback RID list that goes into the shared framework's deps file. This was used by the host when determining precedence of runtimeTargets. I'm not sure if that's still done or not - or if the runtime still needs those or not - since a lot of this changed when the runtime stopped using versioned RIDs. FWIW I still see those versioned RIDs in the shared framework's deps file.
Enumerate restore scenarios and call out what breaks. Consider restoring for specific RID, and also consuming packages which use specific RIDs. Also test loading of assets which have RID-specific runtime targets. If we drop RIDs from the shared framework deps file those will break too. What I'm not so sure about is how much of this was already broken/not, and how much of this already got warnings and for how long. |
|
It's already fully broken for new OSes so this is solely about older OSes (all non-latest and many EOL). A challenge is that we never gave guidance on how to use RIDs correctly. So, an incorrect and unsupported use could still "work". Do you have any tests for RID-based restore @nkolev92? |
|
We do have various unit tests for rid being used during restore, but we don't really test the true mapping, but rather just basic ones we create in our code to test the functionality itself, that being rid based asset selection and the fact that runtime.json is used at restore. The way to probably estimate potentially affected packages would be to look on nuget.org for packages that have rids that are no longer represented in this runtime.json. I don't know of a way to do the reverse (basically a soon to be unknown rid being used on the project side), as that's not something we track in any way. |
We made a change a few years ago to stop updating the runtime.json file. It is now stale and offers little to no value.
runtimes.json#123009The overall intent is to make runtime.json match the algorithmic mode in the host. However, that may be too breaking. The primary user of this file (AFAIK) is
dotnet restore.It's easiest to make this change with a somewhat explanatory PR description rather than write a spec and ask for feedback. Well, the spec was written 4 years ago and basically describes the plan except for this step.
Plan
anyorunixas a base; matches the host)linuxare considered portable, such as:feebsd,illumosandroidandtizen, even if they are Linux derivatives as an implemtentation detail.winrelated RIDsalpine(use a portable RID likelinux-musl)android.32andios.15Result
Before:
After:
wcformat: lines words bytes fileThat's a reduction of (almost) 4k lines and 60k+ bytes. This isn't a high-performance scenario so that's not the reason. It's a realization that almost all of the file is stale and serves no purpose and was based on an old plan (hence why the file hasn't been updated in 1.5 years). It is possible that reducing the file size will improve some memory use metrics (measured or otherwise).
Compatibility
The point here is that the last couple changes are still persisted in the the reduced file. The addiition of Debian 12 in the second change will be undone by this change. Debian 13 was never added (shipped long after the freeze of the file).
The open question is how to validate this change. This may well be correct, but we want to understand the likelihood of breakage. Another question is how much coverage we have in this tree for this tree. It is likely that I need to do some kind of search on nuget.org.
As a case in point, how do we reason about removing
alpine.3.17, for example? This means that there was some change in Alpine 3.17 that wasn't in Alpine 3.16. If it was in Alpine 3.16, thenalpineshould have been used as the RID. The transition from OpenSSL 1.x and 3.x happened between those two versions. Alpine 3.16 has been EOL since May 2024.Then, why use
alpinevslinux-musl? There isn't a reason. There is nothing we can guarantee about whatalpinedelivers overlinux-musl. You have to use documentation over and above the RID to ensure that the code works.All that said, there will be some packages that use these RIDs for good or bad reasons. And that's the compatibility risk.
Reference: https://alpinelinux.org/releases/