Skip to content

[assembly-preparer] Log per-step timings and whether each step modified assemblies.#25944

Merged
rolfbjarne merged 1 commit into
mainfrom
dev/rolf/assembly-preparer-logging-improvements
Jul 8, 2026
Merged

[assembly-preparer] Log per-step timings and whether each step modified assemblies.#25944
rolfbjarne merged 1 commit into
mainfrom
dev/rolf/assembly-preparer-logging-improvements

Conversation

@rolfbjarne

@rolfbjarne rolfbjarne commented Jul 6, 2026

Copy link
Copy Markdown
Member

Add timing information to the assembly-preparer's PrepareAssemblies task: for each step (in both the Prepare and PostProcess passes) log - at MessageImportance.Low - how long the step took, whether it modified any assemblies, and a total duration for all steps. The fixed-width duration is printed before the (variable-width) step name so the durations line up between all the log lines.

To know whether a step modified any assemblies, add an AssemblySaved callback to the AppBundleRewriter (invoked whenever SaveAssembly is called). All the steps that modify assemblies go through AppBundleRewriter.SaveAssembly (except two that's being fixed in separate PRs to either not save (RegistrarRemovalTrackingStep) or to subclass AssemblyModifierStep).

…ed assemblies.

Add timing information to the assembly-preparer's PrepareAssemblies task: for each
step (in both the Prepare and PostProcess passes) log - at MessageImportance.Low -
how long the step took, whether it modified any assemblies, and a total duration for
all steps. The fixed-width duration is printed before the (variable-width) step name
so the durations line up between all the log lines.

To know whether a step modified any assemblies, add an AssemblySaved callback
to the AppBundleRewriter (invoked whenever SaveAssembly is called). All the
steps that modify assemblies go through AppBundleRewriter.SaveAssembly (except
two that's being fixed in separate PRs to either not save
(RegistrarRemovalTrackingStep) or to subclass AssemblyModifierStep).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@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 marked this pull request as ready for review July 7, 2026 09:00
Copilot AI review requested due to automatic review settings July 7, 2026 09:00
@rolfbjarne rolfbjarne requested a review from mauroa as a code owner July 7, 2026 09:00

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 enhances the assembly-preparer diagnostics by recording per-step execution timing and whether each step saved (and thus potentially modified) any assemblies, and then emitting that information from the MSBuild PrepareAssemblies task.

Changes:

  • Add a per-step timing/“modified assemblies” tracking mechanism to AssemblyPreparer.
  • Add an AssemblySaved notification hook to AppBundleRewriter.SaveAssembly so steps can be detected as modifying assemblies.
  • Log per-step timings and a total duration from the PrepareAssemblies MSBuild task.

Reviewed changes

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

File Description
tools/dotnet-linker/AppBundleRewriter.cs Adds an AssemblySaved hook invoked from SaveAssembly to detect assembly-save activity.
tools/assembly-preparer/AssemblyPreparer.cs Tracks per-step duration and whether any SaveAssembly occurred during that step.
msbuild/Xamarin.MacDev.Tasks/Tasks/PrepareAssemblies.cs Logs per-step timing/modification status and a total duration at MessageImportance.Low.

Comment thread tools/dotnet-linker/AppBundleRewriter.cs
Comment thread msbuild/Xamarin.MacDev.Tasks/Tasks/PrepareAssemblies.cs
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #ca9b6cd] Build passed (Build packages) ✅

Pipeline on Agent
Hash: ca9b6cdf93ca98618c60e7e2ec4bc54b00f9be8c [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

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

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

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #ca9b6cd] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: ca9b6cdf93ca98618c60e7e2ec4bc54b00f9be8c [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #ca9b6cd] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 199 tests passed 🎉

Tests counts

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ 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. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 17 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 18 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 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

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. [attempt 2] Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: ca9b6cdf93ca98618c60e7e2ec4bc54b00f9be8c [PR build]

@rolfbjarne rolfbjarne enabled auto-merge (squash) July 8, 2026 10:18
@rolfbjarne rolfbjarne merged commit 7f1ad70 into main Jul 8, 2026
57 checks passed
@rolfbjarne rolfbjarne deleted the dev/rolf/assembly-preparer-logging-improvements branch July 8, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants