Remove unused nativeImagePath from assembly LoadFromPath paths#129597
Open
elinor-fung wants to merge 1 commit into
Open
Remove unused nativeImagePath from assembly LoadFromPath paths#129597elinor-fung wants to merge 1 commit into
elinor-fung wants to merge 1 commit into
Conversation
The native image (NI) path is a vestige of NGEN, which CoreCLR no longer supports. It was already ignored on every runtime: the CoreCLR AssemblyNative_LoadFromPath QCall ignored pwzNIPath, Mono dropped it with a TODO, and NativeAot threw PlatformNotSupportedException. Remove pwzNIPath from the QCall and drop the now-unused nativeImagePath parameter from InternalLoadFromPath across CoreCLR, Mono, and NativeAot. The public LoadFromNativeImagePath API is unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Tagging subscribers to this area: @agocke, @elinor-fung |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the unused “native image” path parameter from the internal AssemblyLoadContext LoadFromPath plumbing across CoreCLR, Mono, and NativeAOT, including updating the CoreCLR QCall signature accordingly.
Changes:
- Remove the
nativeImagePathparameter fromInternalLoadFromPathand update all call sites to pass onlyassemblyPath. - Update CoreCLR’s
AssemblyNative_LoadFromPathQCall declaration/definition and its managedLibraryImportsignature to drop the NI-path argument. - Simplify Mono’s implementation by removing the now-unneeded warning suppression and TODO related to the unused parameter.
Show a summary per file
| File | Description |
|---|---|
| src/mono/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.Mono.cs | Drops unused nativeImagePath parameter from Mono’s InternalLoadFromPath. |
| src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.cs | Updates LoadFromAssemblyPath / LoadFromNativeImagePath to call the 1-arg InternalLoadFromPath. |
| src/coreclr/vm/assemblynative.hpp | Updates QCall prototype for AssemblyNative_LoadFromPath to remove NI-path parameter. |
| src/coreclr/vm/assemblynative.cpp | Updates QCall implementation signature for AssemblyNative_LoadFromPath accordingly. |
| src/coreclr/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.CoreCLR.cs | Updates managed LibraryImport for AssemblyNative_LoadFromPath and CoreCLR InternalLoadFromPath. |
| src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.NativeAot.cs | Drops unused nativeImagePath parameter from NativeAOT stub InternalLoadFromPath. |
Copilot's findings
- Files reviewed: 6/6 changed files
- Comments generated: 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The native image (NI) path is a vestige of NGEN, which CoreCLR no longer supports. It was already ignored on every runtime:
AssemblyNative_LoadFromPathQCall ignoredpwzNIPath.// TODO: Handle nativeImagePath.PlatformNotSupportedException.This removes
pwzNIPathfrom the QCall and drops thenativeImagePathparameter fromInternalLoadFromPath.cc @dotnet/appmodel @AaronRobinsonMSFT
Note
This PR description was generated with the assistance of GitHub Copilot.