Repository navigation
Narrow NativeAOT interop test exclusions - #133398
MichalStrehovsky merged 1 commit into
Conversation
Replace project-wide exclusions with inline guards for UnmanagedType.Error, System.Delegate fields, and unsupported StringBuilder callbacks, retaining unrelated marshalling coverage. Co-authored-by: Copilot <[email protected]> Copilot-Session: 3dea65e4-6bec-47a1-b938-b02f43d8a0bb
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib |
There was a problem hiding this comment.
🟡 Changes recommended
The NativeAOT guards currently skip only call sites, but the unsupported interop paths remain rooted via always-reachable switch bodies, so NativeAOT compilation may still fail for the unsupported signatures.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR narrows NativeAOT test exclusions in src/tests/Interop by removing project-wide <NativeAotIncompatible>true</NativeAotIncompatible> and replacing it with targeted runtime guards that skip known-unsupported marshalling scenarios while keeping the rest of the interop coverage enabled.
Changes:
- Removed
NativeAotIncompatiblefrom several interop test projects so they can participate in NativeAOT test runs. - Added
!Utilities.IsNativeAot/!TestLibrary.Utilities.IsNativeAotguards to skip specific failing struct IDs / callbacks (e.g.,UnmanagedType.Error, delegate fields, certain LPSTR-out callbacks). - Annotated the skips with issue links to document why specific coverage is disabled under NativeAOT.
File summaries
| File | Description |
|---|---|
| src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest.csproj | Removes project-wide NativeAOT exclusion for this reverse-P/Invoke struct marshalling test. |
| src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest_.cs | Adds NativeAOT runtime guards around invoking S8/S9 test cases. |
| src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/DelegatePInvoke/DelegatePInvokeTest.csproj | Removes project-wide NativeAOT exclusion for this delegate-P/Invoke test. |
| src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/DelegatePInvoke/DelegatePInvokeTest.cs | Adds NativeAOT runtime guards around invoking S8/S9 test cases. |
| src/tests/Interop/StructMarshalling/PInvoke/MarshalStructAsLayoutSeq.csproj | Removes project-wide NativeAOT exclusion for this P/Invoke struct marshalling test. |
| src/tests/Interop/StructMarshalling/PInvoke/MarshalStructAsLayoutSeq.cs | Adds NativeAOT runtime guards for delegate-field scenario and S8/S9 test case invocation. |
| src/tests/Interop/BestFitMapping/BestFitMapping.csproj | Removes project-wide NativeAOT exclusion for BestFitMapping interop coverage. |
| src/tests/Interop/BestFitMapping/BestFitMapping.cs | Adds NativeAOT runtime guards to skip LPSTR-out callback paths under NativeAOT. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 3
- Review effort level: Lite
|
/ba-g mono crash was #133442 |
Resolves dotnet/runtimelab#180.
Replace project-wide exclusions with inline guards for UnmanagedType.Error, System.Delegate fields, and unsupported StringBuilder callbacks, retaining unrelated marshalling coverage.
We should run all interop testing we can run. We may never implement the things triggering the disablement.