Skip to content

Revert "Don't use incompatible LOAD_LIBRARY_SEARCH flags when using LOAD_WITH_ALTERED_SEARCH_PATH" #114592

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
merged 1 commit into from
Apr 12, 2025

Conversation

jkotas
Copy link
Member

@jkotas jkotas commented Apr 12, 2025

Reverts #111990

@Copilot Copilot AI review requested due to automatic review settings April 12, 2025 13:48
@ghost ghost added the area-Interop-coreclr label Apr 12, 2025
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.

Copilot reviewed 6 out of 9 changed files in this pull request and generated no comments.

Files not reviewed (3)
  • src/tests/Interop/CMakeLists.txt: Language not supported
  • src/tests/Interop/DllImportSearchPaths/DllImportSearchPathsTest.csproj: Language not supported
  • src/tests/Interop/DllImportSearchPaths/NativeLibraryWithDependency/CMakeLists.txt: Language not supported
Comments suppressed due to low confidence (3)

src/coreclr/vm/nativelibrary.cpp:478

  • Removal of the assertion checking that the path is not relative may allow unintended relative path usage. Please verify that path validation is performed elsewhere to avoid potential loading issues.
_ASSERTE(!Path::IsRelative(path));

src/tests/Interop/DllImportSearchPaths/DllImportSearchPathsTest.cs:67

  • The test method 'AssemblyDirectory_SearchFlags_WithDependency_Found' has been removed, which might reduce test coverage for dependency loading via the assembly directory. Consider ensuring equivalent coverage exists or reintroducing a minimal test.
[ConditionalFact(nameof(CanLoadAssemblyInSubdirectory))]

src/mono/mono/metadata/native-library.c:355

  • Reverting the flag adjustment by removing the call to add_load_with_altered_search_path_flags may impact the handling of search flags on Windows. Please confirm that the new flag logic correctly supports all expected behaviors.
module = netcore_probe_for_module_variations (mdirname, file_name, lflags, error);

Copy link
Contributor

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

@jkotas
Copy link
Member Author

jkotas commented Apr 12, 2025

#111990 (comment)

@jkotas jkotas merged commit 8f313fd into main Apr 12, 2025
142 of 147 checks passed
@jkotas jkotas deleted the revert-111990-alteredSearchPath-mask branch April 12, 2025 17:34
elinor-fung added a commit to elinor-fung/runtime that referenced this pull request Apr 14, 2025
elinor-fung added a commit that referenced this pull request Apr 15, 2025
…LOAD_WITH_ALTERED_SEARCH_PATH" (#114651)

Undo the revert in #114592.

Additional changes:
- Removes setting /DEPENDENTLOADFLAG:0x800 in test
- Ignore empty paths when looking in the p/invoke assembly directory
- Adds a test in DllImportSearchPathsTests that uses an in-memory assembly
@github-actions github-actions bot locked and limited conversation to collaborators May 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants