Skip to content

[dotnet] Add support for transforming CoreCLR's dylibs to frameworks when building for device.#24506

Merged
rolfbjarne merged 1 commit intonet11.0from
dev/rolf/dylibs-to-fw
Jan 29, 2026
Merged

[dotnet] Add support for transforming CoreCLR's dylibs to frameworks when building for device.#24506
rolfbjarne merged 1 commit intonet11.0from
dev/rolf/dylibs-to-fw

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds support for transforming CoreCLR's dylibs into frameworks when building for iOS/tvOS device targets. Apple's App Store does not allow .dylib files in apps, so when using CoreCLR runtime with static linking mode on mobile platforms, dylib files must be converted to .framework bundles.

Changes:

  • Introduces a new ProcessRuntimeLibraries MSBuild task to select and filter runtime libraries based on the runtime type (MonoVM/CoreCLR/NativeAOT) and link mode
  • Implements dylib-to-framework conversion infrastructure using InstallNameTool with proper identity updates and library reference fixups
  • Updates test expectations to reflect frameworks instead of dylibs in iOS CoreCLR builds

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
msbuild/Xamarin.MacDev.Tasks/Tasks/ProcessRuntimeLibraries.cs New task that filters runtime libraries and identifies dylibs needing framework conversion
msbuild/Xamarin.MacDev.Tasks/Tasks/InstallNameTool.cs Enhanced to support fixing up library references and incremental builds via stamp files
dotnet/targets/Xamarin.Shared.Sdk.targets Integrates ProcessRuntimeLibraries task and implements framework creation pipeline
msbuild/Xamarin.Shared/Xamarin.Shared.targets Registers the new ProcessRuntimeLibraries task
tools/dotnet-linker/LinkerConfiguration.cs Adds parsing and logging for DylibToConvertToFramework configuration
tools/common/Application.cs Adds DylibsToConvertToFrameworks list property
tools/common/Target.cs Includes converted dylibs in runtime libraries array generation
runtime/runtime.m Adds commented-out debug logging (development aid)
msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx Adds error message resources for new task validation
tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/ProcessRuntimeLibrariesTest.cs Unit tests for the new ProcessRuntimeLibraries task
tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-size.txt Updated size expectations reflecting framework structure
tests/dotnet/UnitTests/expected/iOS-CoreCLR-Interpreter-size.txt Updated size expectations reflecting framework structure
Comments suppressed due to low confidence (1)

msbuild/Xamarin.MacDev.Tasks/Tasks/ProcessRuntimeLibraries.cs:1

  • Potential KeyNotFoundException when accessing dictionary keys. The code assumes both true and false keys exist in splitRuntimeLibraries dictionary on lines 60 and 62, but GroupBy might not create a group if no items match that key. Use TryGetValue or check ContainsKey before accessing.
using System;

Comment thread msbuild/Xamarin.MacDev.Tasks/Tasks/ProcessRuntimeLibraries.cs
Comment thread msbuild/Xamarin.MacDev.Tasks/Tasks/ProcessRuntimeLibraries.cs Outdated
Comment thread msbuild/Xamarin.MacDev.Tasks/Tasks/InstallNameTool.cs Outdated
Comment thread msbuild/Xamarin.MacDev.Tasks/Tasks/InstallNameTool.cs Outdated
Comment thread runtime/runtime.m Outdated
@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

This comment has been minimized.

@rolfbjarne rolfbjarne force-pushed the dev/rolf/dylibs-to-fw branch from c90caa9 to 892f77f Compare January 15, 2026 11:39
@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

This comment has been minimized.

@rolfbjarne rolfbjarne force-pushed the dev/rolf/dylibs-to-fw branch from 11cea6f to 7062fc7 Compare January 27, 2026 21:08
@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #7062fc7] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 7062fc7879a26adb6e4bf6082b9963ada8ab43d2 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #7062fc7] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 7062fc7879a26adb6e4bf6082b9963ada8ab43d2 [PR build]

@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: 7062fc7879a26adb6e4bf6082b9963ada8ab43d2 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #7062fc7] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 7062fc7879a26adb6e4bf6082b9963ada8ab43d2 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

💻 [CI Build #7062fc7] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: 7062fc7879a26adb6e4bf6082b9963ada8ab43d2 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

💻 [CI Build #7062fc7] Tests on macOS arm64 - Mac Sequoia (15) passed 💻

All tests on macOS arm64 - Mac Sequoia (15) passed.

Pipeline on Agent
Hash: 7062fc7879a26adb6e4bf6082b9963ada8ab43d2 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

💻 [CI Build #7062fc7] Tests on macOS arm64 - Mac Tahoe (26) passed 💻

All tests on macOS arm64 - Mac Tahoe (26) passed.

Pipeline on Agent
Hash: 7062fc7879a26adb6e4bf6082b9963ada8ab43d2 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne marked this pull request as ready for review January 28, 2026 09:32
@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

🚀 [CI Build #7062fc7] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 117 tests passed 🎉

Tests counts

✅ 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. [attempt 2] Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 9 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 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

Pipeline on Agent
Hash: 7062fc7879a26adb6e4bf6082b9963ada8ab43d2 [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

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 rolfbjarne merged commit 16a3f68 into net11.0 Jan 29, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants