[assembly-preparer] Log per-step timings and whether each step modified assemblies.#25944
Conversation
…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>
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.
There was a problem hiding this comment.
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
AssemblySavednotification hook toAppBundleRewriter.SaveAssemblyso steps can be detected as modifying assemblies. - Log per-step timings and a total duration from the
PrepareAssembliesMSBuild 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. |
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #ca9b6cd] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #ca9b6cd] Build passed (Detect API changes) ✅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 |
✅ [PR Build #ca9b6cd] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [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 macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
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).