[msbuild] Filter static frameworks from post-processing items. Fixes #24840.#24845
[msbuild] Filter static frameworks from post-processing items. Fixes #24840.#24845rolfbjarne wants to merge 1 commit intomainfrom
Conversation
…24840. Static frameworks were included in _PostProcessingItem (which feeds dsymutil/strip) even though they aren't copied to the app bundle. This caused dsymutil to try to process frameworks that don't exist. The fix reuses the _FilteredFrameworkToPublish item group (produced by _ComputeFrameworkFilesToPublish) instead of _ResolvedNativeReference when building the _PostProcessingItem list for frameworks. This ensures only dynamic frameworks that will actually be present in the app bundle are included. An explicit dependency on _ComputeFrameworkFilesToPublish is added to _CollectItemsForPostProcessingDependsOn in the SDK targets. Fixes #24840 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes post-build symbol/strip post-processing by excluding static frameworks that are not copied into the app bundle, preventing dsymutil from targeting non-existent paths.
Changes:
- Update MSBuild post-processing item collection to use
_FilteredFrameworkToPublish(dynamic frameworks only). - Add an explicit SDK-target dependency to ensure framework publish items are computed before post-processing collection.
- Add a unit test app + test case validating static frameworks are excluded from
_PostProcessingItem.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/dotnet/UnitTests/PostBuildTest.cs | Adds regression test ensuring static frameworks do not appear in post-processing items. |
| tests/dotnet/StaticFrameworkFilterApp/shared.csproj | Defines native references for one dynamic and one static framework to reproduce the issue. |
| tests/dotnet/StaticFrameworkFilterApp/AppDelegate.cs | Minimal entry point calling into the dynamic framework to ensure it’s present/used. |
| tests/dotnet/StaticFrameworkFilterApp/iOS/StaticFrameworkFilterApp.csproj | Adds iOS test project wiring to shared settings. |
| tests/dotnet/StaticFrameworkFilterApp/tvOS/StaticFrameworkFilterApp.csproj | Adds tvOS test project wiring to shared settings. |
| tests/dotnet/StaticFrameworkFilterApp/macOS/StaticFrameworkFilterApp.csproj | Adds macOS test project wiring to shared settings. |
| tests/dotnet/StaticFrameworkFilterApp/MacCatalyst/StaticFrameworkFilterApp.csproj | Adds Mac Catalyst test project wiring to shared settings. |
| msbuild/Xamarin.Shared/Xamarin.Shared.targets | Switches framework post-processing inputs to use filtered publish frameworks. |
| dotnet/targets/Xamarin.Shared.Sdk.targets | Ensures _ComputeFrameworkFilesToPublish runs before collecting post-processing items. |
You can also share your feedback on Copilot code review. Take the survey.
✅ [CI Build #a441281] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #a441281] Build passed (Detect API changes) ✅Pipeline on Agent |
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 |
🔥 [CI Build #a441281] Test results 🔥Test results❌ Tests failed on VSTS: test results 5 tests crashed, 52 tests failed, 79 tests passed. Failures❌ dotnettests tests (iOS)1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ dotnettests tests (MacCatalyst)1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ dotnettests tests (macOS)1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ dotnettests tests (Multiple platforms)1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ dotnettests tests (tvOS)1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ linker tests16 tests failed, 28 tests passed.Failed tests
|
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.
✅ [CI Build #a441281] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🔥 [CI Build #a441281] Test results 🔥Test results❌ Tests failed on VSTS: test results 0 tests crashed, 39 tests failed, 117 tests passed. Failures❌ dotnettests tests (iOS) [attempt 5]1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ dotnettests tests (MacCatalyst) [attempt 5]1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ dotnettests tests (macOS) [attempt 5]1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ dotnettests tests (Multiple platforms) [attempt 5]1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ dotnettests tests (tvOS) [attempt 5]1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ linker tests [attempt 5]5 tests failed, 39 tests passed.Failed tests
Html Report (VSDrops) Download ❌ monotouch tests (MacCatalyst) [attempt 5]15 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ monotouch tests (macOS) [attempt 5]12 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ windows tests [attempt 5]2 tests failed, 1 tests passed.Failed tests
Html Report (VSDrops) Download Successes✅ cecil: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. [attempt 4] Html Report (VSDrops) Download Pipeline on Agent |
Static frameworks were included in _PostProcessingItem (which feeds
dsymutil/strip) even though they aren't copied to the app bundle.
This caused dsymutil to try to process frameworks that don't exist.
The fix reuses the _FilteredFrameworkToPublish item group (produced by
_ComputeFrameworkFilesToPublish) instead of _ResolvedNativeReference
when building the _PostProcessingItem list for frameworks. This ensures
only dynamic frameworks that will actually be present in the app bundle
are included. An explicit dependency on _ComputeFrameworkFilesToPublish
is added to _CollectItemsForPostProcessingDependsOn in the SDK targets.
Fixes #24840