Repository navigation
Align NativeAOT generic marshalling rejection with CoreCLR - #133400
MichalStrehovsky merged 1 commit into
Conversation
Reject generic interfaces and validate generic types before accepting blittable byref returns. Re-enable all 38 affected NativeAOT Generics tests. 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.
🔵 Needs a closer look
It changes core marshalling classification behavior in shared compiler tooling, so a human review should validate broader interop impact across platforms/configurations.
Pull request overview
Aligns NativeAOT’s generic marshalling rejection behavior with existing CoreCLR expectations by tightening marshalling classification rules, and re-enables previously-disabled interop generics tests that were broadly skipped for NativeAOT.
Changes:
- Update marshalling kind selection to (1) validate generic types before allowing blittable byref returns and (2) reject generic interfaces from being marshaled.
- Remove
ActiveIssue(... IsNativeAot ...)skips from the Interop/PInvoke/Generics test suite so these tests execute under NativeAOT again.
File summaries
| File | Description |
|---|---|
| src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.cs | Tightens generic marshalling classification (generic interface rejection; validate generics for byref return). |
| src/tests/Interop/PInvoke/Generics/GenericsTest.VectorU.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.VectorL.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.VectorF.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.VectorD.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.VectorC.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.VectorB.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64U.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64L.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64F.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64D.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64C.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64B.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256U.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256L.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256F.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256D.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256C.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256B.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128U.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128L.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128F.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128D.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128C.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128B.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.SpanU.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.SpanL.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.SpanF.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.SpanD.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanU.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanL.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanF.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanD.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceU.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceL.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceF.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceD.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceC.cs | Remove NativeAOT ActiveIssue skip. |
| src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceB.cs | Remove NativeAOT ActiveIssue skip. |
Review details
- Files reviewed: 39/39 changed files
- Comments generated: 1
- Review effort level: Lite
|
I think we are still missing a case in the tests where generic function pointers in CoreCLR reject cases when runtime marshalling is involved (i.e. when being actually used, instead of being in the context only but unused), but NativeAOT happily accepts them. |
If/when we care enough to add a test we'll care enough on native AOT side too. |
|
/ba-g mono crash was #133442 |
Resolves dotnet/runtimelab#177.
This was another wide disablement that got copypasted into tests that have nothing to do with COM. We should run them.
Reject generic interfaces and validate generic types before accepting blittable byref returns. Re-enable all 38 affected NativeAOT Generics tests.