-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Stop checking for and writing out breadcrumbs for Microsoft.NET.DotNetHostPolicy #122212
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?
Conversation
|
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov |
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.
Pull request overview
This PR removes legacy code for tracking and resolving the Microsoft.NETCore.DotNetHostPolicy package, which hasn't been used since before .NET 3.0. The changes eliminate unnecessary file I/O operations (breadcrumb writes and deps.json parsing) and simplify the hostpolicy resolution logic.
Key changes:
- Simplified breadcrumb setup in hostpolicy_context.cpp by removing explicit policy package tracking
- Removed deps.json parsing logic that searched for hostpolicy version information
- Streamlined hostpolicy_resolver::try_get_dir() signature by removing unused probe_paths parameter
- Removed obsolete package-related macros from configure.h.in
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/native/corehost/hostpolicy/hostpolicy_context.cpp | Simplified breadcrumb initialization by removing hardcoded hostpolicy package insertion and consolidating resolver call |
| src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp | Removed legacy functions for parsing deps.json, probing package directories, and servicing lookups; simplified try_get_dir() to only check expected locations |
| src/native/corehost/fxr/hostpolicy_resolver.h | Updated try_get_dir() signature to remove probe_realpaths parameter |
| src/native/corehost/fxr/fx_muxer.cpp | Updated all try_get_dir() call sites to match new signature |
| src/native/corehost/configure.h.in | Removed HOST_POLICY_PKG_NAME and HOST_POLICY_PKG_REL_DIR macro definitions |
| src/native/corehost/apphost/static/hostpolicy_resolver.cpp | Updated try_get_dir() signature to match header |
| src/installer/tests/TestUtils/DotNetBuilder.cs | Removed test code that created mock DotNetHostPolicy package structure |
This package hasn't been the way we construct .NET apps since before 3.0. We currently check for it in the deps.json on startup and write it out as a breadcrumb file for every app - we should be able to stop doing this and avoid some unnecessary file I/O and allocations.
cc @dotnet/appmodel @AaronRobinsonMSFT