-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Fix running tests against our DNNE'd NativeExports project to work in NativeAOT #84578
Fix running tests against our DNNE'd NativeExports project to work in NativeAOT #84578
Conversation
Tagging subscribers to this area: @dotnet/interop-contrib Issue DetailsIn NativeAOT, we'll forego using the DNNE-generated shim and instead will directly call the Contributes to #84451 by enabling libraries tests with DNNE components to run on our NativeAOT test runs.
|
...Runtime.InteropServices/tests/ComInterfaceGenerator.Tests/ComInterfaceGenerator.Tests.csproj
Outdated
Show resolved
Hide resolved
Thank you for looking into this! Once #84552 merges, could you trigger |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
Looks like the ComInterfaceGenerator.Tests test suite hits an AV when AOTd. I'll take a look. |
…e zeroed (CoreCLR does this). The interop source generators depend on this behavior for lazy initialization.
We should augment the test runtime/src/libraries/System.Runtime/tests/System/Runtime/CompilerServices/RuntimeHelpersTests.cs Line 376 in 9d6396d
|
...veaot/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.NativeAot.cs
Outdated
Show resolved
Hide resolved
…e/CompilerServices/RuntimeHelpers.NativeAot.cs Co-authored-by: Jan Kotas <jkotas@microsoft.com>
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
Looks like there's still some failures on Mac. I'll investigate next time I have a Mac to test with (probably later this week). |
They also fail on Linux. We could make these only run on Windows for now and cut a bug for non-Windows. Looks like there's at least two issues: https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-84578-merge-0c2106cb7a2b4c4eb9/ComInterfaceGenerator.Tests/1/console.1e0f119a.log?helixlogtype=result
looks like we PNSE ComWrappers outside Windows. We already ran into that one: #76005 The sigsegv has a crashdump that can be downaloded with
|
Looks like the sigsev might also be the PNSE, but just on the other side of an UnmanagedCallersOnly call. I'll exclude the project on non-Windows NativeAOT for now and work on enabling ComWrappers on NativeAOT there next. |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
The tests enabled by this PR all pass, so I'm going to merge. |
In NativeAOT, we'll forego using the DNNE-generated shim and instead will directly call the
[UnmanagedCallersOnly]
exports from the[LibraryImport]
/[DllImport]
methods in our tests. We'll use the functionality that was added for the iOS team to export the[UnmanagedCallersOnly]
symbols from an assembly that is not the entry-point to include the unmanaged names for the symbols inNativeExports
, and we'll use the Direct P/Invoke functionality to redirect the calls to the DNNE-based shim to call the symbols we now have exported from the same image, allowing the native linker to put the pieces together.Contributes to #84451 by enabling libraries tests with DNNE components to run on our NativeAOT test runs.