-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Merging internal commits for release/8.0 #116554
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/8.0 #116554
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-8.0-2025-06-10-1311
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 8.0, enforcing absolute-path loading in various host resolvers, refining dependency resolution logic, and extending test utilities with new working-directory-ignorance tests.
- Enforce
is_path_rooted
checks before loading coreclr, hostfxr, and hostpolicy libraries - Update
deps_resolver
to skip app-deps probing inlibhost
mode - Add
TestArtifact.Create
helper and new tests to verify working-directory ignore behavior
Reviewed Changes
Copilot reviewed 10 out of 10 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 | Add absolute-path check before load_library |
src/native/corehost/hostpolicy/deps_resolver.cpp | Skip app-deps probing when in libhost mode |
src/native/corehost/fxr_resolver.h | Add absolute-path check for hostfxr library |
src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp | Add absolute-path check for hostpolicy library |
src/native/corehost/apphost/standalone/hostfxr_resolver.cpp | Add absolute-path check before setting status |
src/installer/tests/TestUtils/TestArtifact.cs | Introduce Create factory method for test artifacts |
src/installer/tests/HostActivation.Tests/NativeHosting/NativeHostingResultExtensions.cs | Rename extension class and add new assertions |
src/installer/tests/HostActivation.Tests/NativeHosting/LoadAssemblyAndGetFunctionPointer.cs | Add IgnoreWorkingDirectory test |
src/installer/tests/HostActivation.Tests/NativeHosting/Ijwhost.cs | Add LoadLibrary_IgnoreWorkingDirectory test |
src/installer/tests/HostActivation.Tests/NativeHosting/Comhost.cs | Add ActivateClass_IgnoreWorkingDirectory test |
Comments suppressed due to low confidence (4)
src/native/corehost/hostpolicy/standalone/coreclr_resolver.cpp:17
- There are no existing tests covering the new absolute-path check in
resolve_coreclr
. Consider adding a unit test that passes a relative path and verifiesresolve_coreclr
returns false.
if (!pal::is_path_rooted(coreclr_dll_path))
src/native/corehost/fxr_resolver.h:48
- No tests currently cover the
is_path_rooted
check for hostfxr. Add a test case supplying a non-rootedfxr_path
and assert it returnsCoreHostLibMissingFailure
.
if (!pal::is_path_rooted(fxr_path))
src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp:184
- The new absolute-path check in
hostpolicy_resolver::load
isn't exercised by tests. Consider adding a test feeding a relativehost_path
and verifying the failure path.
if (!pal::is_path_rooted(host_path))
src/native/corehost/apphost/standalone/hostfxr_resolver.cpp:41
- The constructor check for non-rooted
m_fxr_path
should be tested. Add a scenario whereapp_root
resolves to a relative path and verifym_status_code
is set to failure.
else if (!pal::is_path_rooted(m_fxr_path))
No description provided.