Skip to content

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

Merged

Conversation

hoyosjs
Copy link
Member

@hoyosjs hoyosjs commented Jun 11, 2025

No description provided.

elinor-fung and others added 7 commits May 1, 2025 19:02
…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.
@Copilot Copilot AI review requested due to automatic review settings June 11, 2025 18:55
@hoyosjs hoyosjs merged commit 5d23275 into dotnet:release/8.0 Jun 11, 2025
174 of 184 checks passed
Copy link
Contributor

@Copilot Copilot AI left a 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 in libhost 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 verifies resolve_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-rooted fxr_path and assert it returns CoreHostLibMissingFailure.
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 relative host_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 where app_root resolves to a relative path and verify m_status_code is set to failure.
else if (!pal::is_path_rooted(m_fxr_path))

@github-actions github-actions bot locked and limited conversation to collaborators Jul 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants