-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Merging internal commits for release/9.0 #116499
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
Merging internal commits for release/9.0 #116499
Conversation
…rios (COM, C++/CLI, custom component host) could try to load coreclr from CWD There is a fallback for apps with no .deps.json where the host will consider the app directory for loading coreclr. In component hosting scenarios, we do not have an app path / directory. We were incorrectly going down the path of looking for coreclr next to the empty app directory, which resulted in looking in the current directory. This change skips that path for libhost scenarios. It also adds checks that the paths we determine for loading coreclr, hostpolicy, and hostfxr are absolute.
…-merge-9.0-2025-06-10-1320
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 merges internal commits for release/9.0, with the primary aim of enforcing that hosting components are loaded only via absolute paths and expanding tests to ensure that components in the working directory are ignored.
- Added absolute path checks for coreclr, hostfxr, and hostpolicy to prevent loading from non-rooted paths.
- Updated deps_resolver logic to conditionally add paths based on host mode and verify the presence of app deps.
- Added new tests in multiple files to confirm that working directory hosting components are not used.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/native/corehost/hostpolicy/standalone/coreclr_resolver.cpp | Adds an absolute path check on coreclr path before loading. |
src/native/corehost/hostpolicy/deps_resolver.cpp | Updates condition to avoid processing in libhost scenarios and asserts a non-empty app directory. |
src/native/corehost/fxr_resolver.h | Adds an absolute path check on hostfxr path. |
src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp | Adds an absolute path check on hostpolicy path. |
src/native/corehost/apphost/standalone/hostfxr_resolver.cpp | Adds an absolute path check for hostfxr in apphost context. |
src/installer/tests/HostActivation.Tests/NativeHosting/NativeHostingResultExtensions.cs | Renames the extension class and adds new fluent assertion extensions for hostfxr, hostpolicy, and coreclr resolution. |
src/installer/tests/HostActivation.Tests/NativeHosting/LoadAssemblyAndGetFunctionPointer.cs | Adds a test to verify that hosting components in the working directory are ignored. |
src/installer/tests/HostActivation.Tests/NativeHosting/Ijwhost.cs | Adds a test that validates library loading ignores components from the working directory. |
src/installer/tests/HostActivation.Tests/NativeHosting/Comhost.cs | Adds a test to ensure that components from the working directory are not utilized. |
Merging internal commits |
No description provided.