Skip to content

[tests] Add app size test for macOS, Mac Catalyst and tvOS as well.#25106

Merged
rolfbjarne merged 5 commits intomainfrom
dev/rolf/tests-appsize-platforms
Apr 8, 2026
Merged

[tests] Add app size test for macOS, Mac Catalyst and tvOS as well.#25106
rolfbjarne merged 5 commits intomainfrom
dev/rolf/tests-appsize-platforms

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

@rolfbjarne rolfbjarne commented Apr 7, 2026

This also revealed a couple of other issues:

rolfbjarne and others added 5 commits April 7, 2026 08:28
Ensure outer multi-RID app bundle builds include merged MonoBundle dylibs in post-processing so dsymutil generates dSYMs for the universal CoreCLR native libraries.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Treat dylibs as frameworks in the SymbolStrip task, by passing -S -x to only
remove debug + local symbols.

Fixes dotnet/runtime#124570.
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

Adds app bundle size baselines and expands the existing AppSizeTest coverage to tvOS, Mac Catalyst, and macOS (including universal/macOS CoreCLR scenarios), while also adjusting post-processing so stripping/dSYM generation is applied correctly to dylibs in multi-RID builds.

Changes:

  • Extend AppSizeTest to run for tvOS, Mac Catalyst, macOS NativeAOT (multi-RID), and add a macOS CoreCLR interpreter size baseline.
  • Fix app bundle diff reporting in AppSizeTest and make preserved-API baseline reading tolerant of missing baseline files.
  • Update MSBuild post-processing item collection for multi-RID merged bundles and adjust stripping behavior to treat dylibs like frameworks.

Reviewed changes

Copilot reviewed 15 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/dotnet/UnitTests/expected/TVOS-NativeAOT-size.txt Add tvOS NativeAOT size baseline.
tests/dotnet/UnitTests/expected/TVOS-MonoVM-size.txt Add tvOS MonoVM size baseline.
tests/dotnet/UnitTests/expected/TVOS-MonoVM-interpreter-size.txt Add tvOS MonoVM interpreter size baseline.
tests/dotnet/UnitTests/expected/MacOSX-NativeAOT-size.txt Add macOS NativeAOT size baseline.
tests/dotnet/UnitTests/expected/MacOSX-CoreCLR-Interpreter-size.txt Add macOS CoreCLR interpreter (universal) size baseline.
tests/dotnet/UnitTests/expected/MacCatalyst-NativeAOT-size.txt Add Mac Catalyst NativeAOT size baseline.
tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-size.txt Add Mac Catalyst MonoVM size baseline.
tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-interpreter-size.txt Add Mac Catalyst MonoVM interpreter size baseline.
tests/dotnet/UnitTests/expected/iOS-NativeAOT-size.txt Update iOS NativeAOT baseline sizes/entries.
tests/dotnet/UnitTests/expected/iOS-MonoVM-size.txt Update iOS MonoVM baseline sizes/entries.
tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-size.txt Update iOS MonoVM interpreter baseline sizes/entries.
tests/dotnet/UnitTests/AppSizeTest.cs Add new platform test cases + tweak properties and baseline comparison behavior.
tests/dotnet/SizeTestApp/MacCatalyst/SizeTestApp.csproj Add Mac Catalyst SizeTestApp project.
tests/dotnet/SizeTestApp/AppDelegate.cs Add AppKit entrypoint/delegate support for macOS.
msbuild/Xamarin.Shared/Xamarin.Shared.targets Scan merged multi-RID app bundle for dylibs to ensure post-processing runs.
msbuild/Xamarin.MacDev.Tasks/Tasks/SymbolStrip.cs Treat dylibs like frameworks when choosing strip flags.

Comment on lines +2968 to +2972
<_MergedAppBundleDylib Include="$(AppBundleDir)/$(_AppContentsRelativePathForPostProcessing)*.dylib" Condition="'$(RuntimeIdentifiers)' != ''" />
<_PostProcessingItem Include="@(_MergedAppBundleDylib -> '$(_AppBundleName)$(AppBundleExtension)/$(_AppContentsRelativePathForPostProcessing)%(Filename)%(Extension)')" Condition="'$(RuntimeIdentifiers)' != ''">
<ItemSourcePath>$(_AppContainerDir)%(_PostProcessingItem.Identity)</ItemSourcePath>
<dSYMSourcePath>$(_AppContainerDir)%(_PostProcessingItem.Identity).dSYM</dSYMSourcePath>
<DSymName>%(Filename).dSYM</DSymName>
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

The new multi-RID fallback that scans the merged app bundle for *.dylib items doesn't carry over item metadata like NuGetPackageId. That metadata is later used to set NoSymbolStrip=true for Microsoft.NETCore.App.Runtime dylibs; without it, runtime dylibs found via the glob will be stripped in multi-RID builds, which contradicts the existing exemption and can reintroduce strip failures. Consider propagating NuGetPackageId (or directly setting NoSymbolStrip) for these globbed dylibs, e.g., by mapping back to ResolvedFileToPublish or by applying the same exemption by filename for known runtime dylibs.

Suggested change
<_MergedAppBundleDylib Include="$(AppBundleDir)/$(_AppContentsRelativePathForPostProcessing)*.dylib" Condition="'$(RuntimeIdentifiers)' != ''" />
<_PostProcessingItem Include="@(_MergedAppBundleDylib -> '$(_AppBundleName)$(AppBundleExtension)/$(_AppContentsRelativePathForPostProcessing)%(Filename)%(Extension)')" Condition="'$(RuntimeIdentifiers)' != ''">
<ItemSourcePath>$(_AppContainerDir)%(_PostProcessingItem.Identity)</ItemSourcePath>
<dSYMSourcePath>$(_AppContainerDir)%(_PostProcessingItem.Identity).dSYM</dSYMSourcePath>
<DSymName>%(Filename).dSYM</DSymName>
<_MergedAppBundleDylib Include="$(AppBundleDir)/$(_AppContentsRelativePathForPostProcessing)*.dylib" Condition="'$(RuntimeIdentifiers)' != ''">
<NuGetPackageId>@(ResolvedFileToPublish->WithMetadataValue('RelativePath', '$(_AppContentsRelativePathForPostProcessing)%(Filename)%(Extension)')->'%(NuGetPackageId)')</NuGetPackageId>
</_MergedAppBundleDylib>
<_PostProcessingItem Include="@(_MergedAppBundleDylib -> '$(_AppBundleName)$(AppBundleExtension)/$(_AppContentsRelativePathForPostProcessing)%(Filename)%(Extension)')" Condition="'$(RuntimeIdentifiers)' != ''">
<ItemSourcePath>$(_AppContainerDir)%(_PostProcessingItem.Identity)</ItemSourcePath>
<dSYMSourcePath>$(_AppContainerDir)%(_PostProcessingItem.Identity).dSYM</dSYMSourcePath>
<DSymName>%(Filename).dSYM</DSymName>
<NuGetPackageId>%(NuGetPackageId)</NuGetPackageId>
<NoSymbolStrip Condition="'%(NuGetPackageId)' != '' And $([System.String]::Copy('%(NuGetPackageId)').StartsWith('Microsoft.NETCore.App.Runtime'))">true</NoSymbolStrip>

Copilot uses AI. Check for mistakes.

if (GetIsFramework (item)) {
if (GetIsFrameworkOrDynamicLibrary (item)) {
// Only remove debug symbols from frameworks.
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

The comment says “Only remove debug symbols from frameworks”, but this branch now applies the same strip flags to dynamic libraries too. Please update the comment to match the new behavior (frameworks and dylibs) so future readers don’t misinterpret why -S/-x are used here.

Suggested change
// Only remove debug symbols from frameworks.
// Only remove debug symbols from frameworks and dynamic libraries.

Copilot uses AI. Check for mistakes.
@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #0f48288] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 0f482889b2b303c335c89d6f14f8502ab3740651 [PR build]

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

✅ [CI Build #0f48288] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 0f482889b2b303c335c89d6f14f8502ab3740651 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

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

✅ [PR Build #0f48288] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 0f482889b2b303c335c89d6f14f8502ab3740651 [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: 0f482889b2b303c335c89d6f14f8502ab3740651 [PR build]

@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 #0f48288] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 156 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. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ linker: All 44 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (iOS): All 11 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 15 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (macOS): All 12 tests passed. [attempt 4] Html Report (VSDrops) Download
✅ monotouch (tvOS): All 11 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. [attempt 4] Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. [attempt 4] 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: 0f482889b2b303c335c89d6f14f8502ab3740651 [PR build]

@rolfbjarne rolfbjarne merged commit 4c0192e into main Apr 8, 2026
52 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.

Runtime dylibs can't be stripped: error: symbols referenced by indirect symbol table entries that can't be stripped in:

5 participants