Skip to content

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

Merged

Conversation

vseanreesermsft
Copy link

No description provided.

elinor-fung and others added 8 commits May 1, 2025 19:01
…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 10, 2025 20:21
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/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.

@hoyosjs hoyosjs added the Servicing-approved Approved for servicing release label Jun 11, 2025
@rbhanda rbhanda enabled auto-merge (squash) June 11, 2025 18:37
@hoyosjs hoyosjs disabled auto-merge June 11, 2025 18:38
@hoyosjs hoyosjs enabled auto-merge June 11, 2025 18:40
@hoyosjs hoyosjs disabled auto-merge June 11, 2025 18:46
@hoyosjs hoyosjs merged commit b5ccd89 into dotnet:release/9.0 Jun 11, 2025
17 of 119 checks passed
@hoyosjs
Copy link
Member

hoyosjs commented Jun 11, 2025

Merging internal commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants