-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[wasm][coreclr] Do not try to probe .ni.dll assemblies #122643
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
base: main
Are you sure you want to change the base?
[wasm][coreclr] Do not try to probe .ni.dll assemblies #122643
Conversation
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 optimizes assembly loading for WebAssembly by removing native image (.ni.dll) probing, which is no longer supported on WASM and can negatively impact startup performance. The change affects only the CoreCLR binder's assembly probing logic.
Key Changes
- Conditionally excludes .ni.dll from assembly probe candidates when targeting WASM
- Updates loop iteration to use ARRAY_SIZE macro instead of hardcoded value for better maintainability
|
@jkotas there's still many places related to Would it be worth to remove |
|
@grendello was looking into something similar for Android (we don't need/want it there either)... and I assume we would like that for iOS as well. |
Yes, I went over the grep output and it looks all dead code, outdated comments, or local workaround for compat ( |
|
Could you please also delete |
|
There is still a lookup map in https://github.com/dotnet/runtime/blob/main/src/coreclr/vm/ceeload.h#L1667-L1675 which we can possibly get rid of. I also kept the related parts of |
That is just a comment talking about .ni.dll. The map itself is no specific to .ni.dlls. You can fix the comment so that it is not talking about .ni.dll. "When that happens a.ni.dll stores" -> "When that happens a.dll R2R image stores" |
What about the single file compilation, should I remove it too or keep it and not complain about |
I do not see @elinor-fung @davidwrighton Could you please confirm that it is fine to delete this? |
|
We can also delete .ni.dll from bringup script (used by new platform ports): --- a/src/tests/Common/scripts/bringup_runtest.sh
+++ b/src/tests/Common/scripts/bringup_runtest.sh
@@ -424,14 +424,6 @@ function create_core_overlay {
fi
cp -f -v "$testDependenciesDir/"xunit* "$coreOverlayDir/" 2>/dev/null
cp -n -v "$testDependenciesDir/"* "$coreOverlayDir/" 2>/dev/null
- if [ -f "$coreOverlayDir/mscorlib.ni.dll" ]; then
- # Test dependencies come from a Windows build, and mscorlib.ni.dll would be the one from Windows
- rm -f "$coreOverlayDir/mscorlib.ni.dll"
- fi
- if [ -f "$coreOverlayDir/System.Private.CoreLib.ni.dll" ]; then
- # Test dependencies come from a Windows build, and System.Private.CoreLib.ni.dll would be the one from Windows
- rm -f "$coreOverlayDir/System.Private.CoreLib.ni.dll"
- fi
copy_test_native_bin_to_test_root $coreOverlayDir
}
@@ -452,7 +444,7 @@ function precompile_overlay_assemblies {
if [[ "$doCrossgen" == 1 ]]; then
local overlayDir=$CORE_ROOT
- filesToPrecompile=$(find -L $overlayDir -iname \*.dll -not -iname \*.ni.dll -not -iname \*-ms-win-\* -type f )
+ filesToPrecompile=$(find -L $overlayDir -iname \*.dll -not -iname \*-ms-win-\* -type f )
for fileToPrecompile in ${filesToPrecompile}
do
local filename=${fileToPrecompile}These are also not needed? docs/design/features/jump-stubs.md:scenario. Mscorlib.ni.dll itself has 72 entries in the helper table.
docs/design/features/jump-stubs.md:System.XML.ni.dll has 51 entries, which would lead to 288 and 204 bytes
docs/workflow/editing-and-debugging.md: * `crossgen` - This is the host program that runs the JIT compiler and produces .NET Native images (`*.ni.dll`)
src/installer/tests/HostActivation.Tests/DependencyResolution/ResolveComponentDependencies.cs: .WithAsset("ComponentDependency.ni.dll"))));
src/installer/tests/HostActivation.Tests/DependencyResolution/ResolveComponentDependencies.cs: .And.HaveStdOutContaining("path: 'ComponentDependency.ni.dll'")
src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs: [InlineData("System.Collections.ni.dll", "System.Collections")]
src/tests/GC/Regressions/v2.0-beta2/445488/445488.cs:*** WARNING: Unable to verify checksum for D:\WINDOWS\Microsoft.NET\Framework\v2.0.x86dbg\assembly\NativeImages_v2.0.x86dbg_32\mscorlib\ab6a82069375373ebc7e85bf2de124cb\mscorlib.ni.dll
src/tests/GC/Regressions/v2.0-beta2/445488/445488.cs:*** ERROR: Module load completed but symbols could not be loaded for D:\WINDOWS\Microsoft.NET\Framework\v2.0.x86dbg\assembly\NativeImages_v2.0.x86dbg_32\mscorlib\ab6a82069375373ebc7e85bf2de124cb\mscorlib.ni.dll
src/tests/GC/Regressions/v2.0-beta2/445488/445488.cs:*** WARNING: Unable to verify checksum for D:\WINDOWS\Microsoft.NET\Framework\v2.0.x86dbg\assembly\NativeImages_v2.0.x86dbg_32\System\08fb29f559b89437a7fc3f4a7dbde9c1\System.ni.dll
src/tests/GC/Regressions/v2.0-beta2/445488/445488.cs:*** ERROR: Module load completed but symbols could not be loaded for D:\WINDOWS\Microsoft.NET\Framework\v2.0.x86dbg\assembly\NativeImages_v2.0.x86dbg_32\System\08fb29f559b89437a7fc3f4a7dbde9c1\System.ni.dll
src/tests/JIT/Performance/CodeQuality/Roslyn/CscBench.cs: // Some CoreCLR packages have System.Private.CoreLib.ni.dll only
src/tests/JIT/Performance/CodeQuality/Roslyn/CscBench.cs: string nicorlib = Path.Combine(CoreRoot, "System.Private.CoreLib.ni.dll"); |
And remove obsolete code around
.niassemblies and executables