-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[fxr] Use std::find_if when searching for root framework. #72080
Conversation
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov Issue DetailsFixes #71027. .NET 6:Consider:
|
src/native/corehost/fx_definition.h
Outdated
fx_definitions.end(), | ||
[&](const std::unique_ptr<fx_definition_t>& fxdef) | ||
{ | ||
return fxdef->get_name() == L"Microsoft.NETCore.App"; |
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.
Sorry, when I first looked inside of pal.h I thought it unconditionally defined it's string_t as a typedef of wstring on all platforms. I was wrong 😄.
I would prefer we solved this by correctly sorting the frameworks during resolution. Currently the code doesn't really assume anything about the root framework - other than it having Also regarding .NET 6 backport - we can try it, but personally I would be against doing it. The risk is non-trivial (hostfxr is used in every single app and is used across all .NET versions). While I understand that this is important for your scenario, there is a workaround and it's the first time we've actually heard about anybody using additional frameworks like this. I would much prefer we fix this fully (sorting) - if it makes it into .NET 7, great. |
I guess here we could check that the framework here:
|
Something like that - currently we don't have information about the "level" (that's kind of the point of the sorting to create that info). I think what this should do is add a list of dependencies on each |
I was thinking of another way as well, have hostpolicy and fxr become static libraries (like hostcommon) that way the loading code is only needed to load coreclr then that way it would not have to look in the framework directories to load up anything much else and would make it so much easier to maintain the host. Then that way all the code would have to do is check "is coreclr in the current directory? Yes, then self-contained." otherwise then all it would have to do is check if frameworks are installed and if not then it will fail with the usual "not installed" like it currently does. Although there might be a reason for hostpolicy existing in the shared framework (I do not see a functional reason for it to be there unless the libraries in it try to p/invoke from it which I do not think it does). With all the complexity I think it would be an option as well. |
|
I think reimplementing it into corelib or to coreclr would be the better idea. |
Closing this for now as the changes are not ready yet. @AraHaan if you're still interested in fixing this, please open a new PR with changed as discussed above. |
Fixes #71027.
.NET 6:
Consider:
Tests:
Test was updated to ensure that the modified code works.