Skip to content

[MAUI] Measure only APK in Android SOD jobs#5265

Open
simonrozsival wants to merge 1 commit into
mainfrom
dev/simonrozsival/fix-maui-android-apk-size-sod
Open

[MAUI] Measure only APK in Android SOD jobs#5265
simonrozsival wants to merge 1 commit into
mainfrom
dev/simonrozsival/fix-maui-android-apk-size-sod

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

Summary

  • stage only the signed APK and versions.json for MAUI Android SizeOnDisk work items
  • prevent R8 mapping files, binlogs, and resource-designer assemblies from being reported as APK size
  • preserve the existing extracted-APK measurement and leave startup/build-time payloads unchanged

Background

Related: dotnet/android#12184

@matouskozak The NativeAOT MAUI sample-content chart jumped from roughly 27 MB to 53 MB after dotnet/android enabled the trimmable typemap by default. The trimmable path also enables R8, which publishes a large mapping.txt beside the APK.

The SOD work item recursively copied the complete correlation output into pub, and SizeOnDisk recursively measured that directory. Running the unmodified scenario against a reproduced payload reported 52,797,806 bytes, comprising:

  • APK: 21,561,293 bytes
  • mapping.txt: 28,318,349 bytes
  • publish and restore binlogs: 2,056,465 bytes
  • resource designer: 861,696 bytes
  • versions.json: 3 bytes

The actual trimmable APK is smaller than the previous managed-typemap APK; the regression is in measurement composition.

This change stages only the APK and versions.json for the two SOD work items. test.py consumes and removes versions.json in lab runs before invoking SizeOnDisk.

Validation

  • APK Size: 21,561,293 bytes, one counted APK
  • Extracted Size: 53,077,875 bytes, 1,435 APK member files
  • no mapping files, binlogs, or loose build outputs are included in either result

Stage only the signed APK and versions metadata for Android SizeOnDisk work items so mapping files, binlogs, and other publish sidecars are not reported as APK size.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a301fa68-0e6c-4280-b2f2-bc3d4c9ae3de
Copilot AI review requested due to automatic review settings July 23, 2026 21:30

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 fixes MAUI Android SizeOnDisk (SOD) measurements in Helix by staging only the signed APK (plus versions.json) into the pub directory, avoiding accidental inclusion of extra publish artifacts (e.g., R8 mapping.txt, binlogs, resource-designer assemblies) in the “APK size” metric.

Changes:

  • Update Android SOD work item pre-commands to copy only *.apk and versions.json into pub instead of recursively copying the entire correlation output.
  • Keep the extracted-APK measurement behavior by still expanding the APK contents into pub for the “Extracted Size” work item.
Show a summary per file
File Description
eng/performance/maui_scenarios_android.proj Adjusts Android SOD Helix work items to stage only the intended measurement inputs (APK + versions metadata) into pub to prevent inflated size reporting.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@matouskozak matouskozak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

3 participants