[registrar] Omit CoreCLR callback entry points. Fixes #21732 - #26263
Conversation
Keep UnmanagedCallersOnlyAttribute on generated managed registrar callbacks, but avoid adding its EntryPoint field when targeting CoreCLR. Preserve the field for MonoVM and NativeAOT runtimes that may use direct symbols. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 45717e2d-c75e-4743-aca9-b9f6a8fa9ebe
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Updates the managed-static registrar code generation in the dotnet linker to reduce managed metadata size for CoreCLR scenarios by omitting the unused UnmanagedCallersOnlyAttribute.EntryPoint named argument, while preserving existing symbol-lookup behavior for MonoVM/NativeAOT.
Changes:
- Update managed registrar callback generation to only emit
EntryPointfor non-CoreCLR runtimes. - Add assembly-preparer tests verifying
EntryPointpresence/absence on generated registrar callbacks for MonoVM vs CoreCLR.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tools/dotnet-linker/Steps/ManagedRegistrarStep.cs | Conditionally omits UnmanagedCallersOnlyAttribute EntryPoint named argument when targeting CoreCLR. |
| tests/assembly-preparer/ManagedRegistrarStepTests.cs | Adds a focused test asserting EntryPoint is emitted for MonoVM and omitted for CoreCLR on generated registrar callback methods. |
This comment has been minimized.
This comment has been minimized.
|
|
❌ Failed to apply gist. Check the workflow run for details. |
This comment has been minimized.
This comment has been minimized.
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #42026c5] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 203 tests passed 🎉 Tests counts✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
Generated managed registrar callbacks targeting CoreCLR still receive
UnmanagedCallersOnlyAttribute, but no longer include its unusedEntryPointnamed field.MonoVM and NativeAOT configurations continue to include
EntryPoint, preserving direct-symbol lookup behavior.Added focused assembly-preparer tests covering both CoreCLR and MonoVM.
Fixes #21732
🤖 Pull request created by Copilot