Skip to content

Downgrade MT2255 warning to a log message Fixes #25670 - #25696

Merged
rolfbjarne merged 4 commits into
mainfrom
rolfbjarne/dev-rolf-issue-25670-downgrade-mt2255-to
Jun 18, 2026
Merged

rolfbjarne merged 4 commits into
mainfrom
rolfbjarne/dev-rolf-issue-25670-downgrade-mt2255-to

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

The MT2255 warning ("Unknown or unsupported Dlfcn pattern") fires when the linker encounters a Dlfcn call pattern it cannot inline. This is not actionable for developers using third-party libraries (like Avalonia) that call Dlfcn directly -- the call still works correctly at runtime, it just won't be inlined for a minor performance optimization.

Since there's nothing the developer can do about it, downgrade from a build warning to a verbose log message (level 3) so it doesn't pollute build output.

Fixes #25670

🤖 Pull request created by Copilot

The MT2255 warning fires for any Dlfcn call pattern we don't support
inlining. This is not actionable for developers using third-party
libraries (like Avalonia) that call Dlfcn directly in patterns we
don't handle. The call still works correctly at runtime - it just
won't be inlined.

Downgrade from a build warning to a verbose log message (level 3)
so it doesn't pollute build output.

Fixes #25670

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@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

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

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne
rolfbjarne marked this pull request as ready for review June 16, 2026 12:48
Copilot AI review requested due to automatic review settings June 16, 2026 12:48
@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

This PR updates the .NET linker step that inlines ObjCRuntime.Dlfcn patterns to stop emitting MT2255 as a build warning, and instead emit it as a verbosity-level log message, since the pattern is non-actionable for many third-party libraries and does not affect runtime correctness.

Changes:

  • Replaced MT2255 warning reporting with App.Log (3, ...) messages for unsupported/unrecognized Dlfcn inlining patterns.
  • Kept additional diagnostic details (e.g., unexpected IL sequences / opcode mismatches) in the verbose logs where applicable.

Comment thread tools/dotnet-linker/Steps/InlineDlfcnMethodsStep.cs
@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

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

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

This comment has been minimized.

@rolfbjarne

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@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

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

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

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

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 #f5adf5d] Build passed (Build packages) ✅

Pipeline on Agent
Hash: f5adf5d3f53ff743634c516b12b9a9491334c87c [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [CI Build #f5adf5d] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: f5adf5d3f53ff743634c516b12b9a9491334c87c [PR build]

@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: f5adf5d3f53ff743634c516b12b9a9491334c87c [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 #f5adf5d] Build failed (Build macOS tests) 🔥

Build failed for the job 'Build macOS tests' (with job status 'Canceled')

Pipeline on Agent
Hash: f5adf5d3f53ff743634c516b12b9a9491334c87c [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #f5adf5d] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 220 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. [attempt 4] Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. [attempt 2] 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 21 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 24 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 24 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 21 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. 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. [attempt 2] 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: f5adf5d3f53ff743634c516b12b9a9491334c87c [PR build]

@rolfbjarne
rolfbjarne merged commit 5d9d910 into main Jun 18, 2026
61 checks passed
@rolfbjarne
rolfbjarne deleted the rolfbjarne/dev-rolf-issue-25670-downgrade-mt2255-to branch June 18, 2026 17:01
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.

Unsupported Dlfcn pattern warning

4 participants