[dotnet] Add support for transforming CoreCLR's dylibs to frameworks when building for device.#24506
Conversation
There was a problem hiding this comment.
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
ProcessRuntimeLibrariesMSBuild 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
InstallNameToolwith 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
trueandfalsekeys exist insplitRuntimeLibrariesdictionary on lines 60 and 62, but GroupBy might not create a group if no items match that key. UseTryGetValueor checkContainsKeybefore accessing.
using System;
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.
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.
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.
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.
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.
c90caa9 to
892f77f
Compare
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.
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.
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.
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.
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.
…when building for device.
11cea6f to
7062fc7
Compare
✅ [PR Build #7062fc7] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ [CI Build #7062fc7] Build passed (Build packages) ✅Pipeline on Agent |
✅ 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 |
✅ [CI Build #7062fc7] Build passed (Build macOS tests) ✅Pipeline on Agent |
💻 [CI Build #7062fc7] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #7062fc7] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
💻 [CI Build #7062fc7] Tests on macOS arm64 - Mac Tahoe (26) passed 💻✅ All tests on macOS arm64 - Mac Tahoe (26) passed. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [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 Pipeline on Agent |
No description provided.