Skip to content

[registrar] Omit CoreCLR callback entry points. Fixes #21732 - #26263

Merged
rolfbjarne merged 2 commits into
mainfrom
dev/rolf/omit-coreclr-entrypoints
Jul 27, 2026
Merged

[registrar] Omit CoreCLR callback entry points. Fixes #21732#26263
rolfbjarne merged 2 commits into
mainfrom
dev/rolf/omit-coreclr-entrypoints

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Generated managed registrar callbacks targeting CoreCLR still receive UnmanagedCallersOnlyAttribute, but no longer include its unused EntryPoint named 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

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
@vs-mobiletools-engineering-service2

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 EntryPoint for non-CoreCLR runtimes.
  • Add assembly-preparer tests verifying EntryPoint presence/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.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

⚠️ AppSizeTest expected files changed ⚠️

The AppSizeTest detected changes in the expected app size files.

To update the expected files, add a comment with the following command:

/apply-gist https://gist.github.com/vs-mobiletools-engineering-service2/6710993b6dea5ea95808cbdb080c3489
Updated files
  • MacOSX-CoreCLR-Interpreter-size.txt
  • MacOSX-CoreCLR-Interpreter-TrimmableStatic-size.txt

Pipeline on Agent
Hash: ccba6e2a1b60d4ad69fb22b1573de17d505b2c79 [PR build]

@rolfbjarne

Copy link
Copy Markdown
Member Author

/apply-gist https://gist.github.com/vs-mobiletools-engineering-service2/6710993b6dea5ea95808cbdb080c3489

@github-actions

Copy link
Copy Markdown
Contributor

❌ Failed to apply gist. Check the workflow run for details.

@rolfbjarne rolfbjarne closed this Jul 24, 2026
@rolfbjarne rolfbjarne reopened this Jul 24, 2026
@rolfbjarne
rolfbjarne marked this pull request as ready for review July 24, 2026 06:01
@rolfbjarne
rolfbjarne enabled auto-merge (squash) July 24, 2026 06:02
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 42026c5dee55f6e7d254dcd2c0d1a39f9a8818f9 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [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
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 19 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 19 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 19 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 42026c5dee55f6e7d254dcd2c0d1a39f9a8818f9 [PR build]

@rolfbjarne
rolfbjarne requested a review from dalexsoto July 27, 2026 16:25
@rolfbjarne
rolfbjarne disabled auto-merge July 27, 2026 16:40
@rolfbjarne
rolfbjarne merged commit 78f1fbf into main Jul 27, 2026
61 checks passed
@rolfbjarne
rolfbjarne deleted the dev/rolf/omit-coreclr-entrypoints branch July 27, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ios] Investigate stripping EntryPoint strings from assemblies as a size optimization for Mono iOS applications

4 participants