Repository navigation
[Xamarin.Android.Build.Tasks] Remove redundant output logging - #13129
Merged
Merged
Conversation
Reduce the logging work performed by Android MSBuild tasks, especially when using multi-threaded MSBuild. Formatting output dumps produces extra messages and allocations. Out-of-process task hosts also need to serialize and route those messages back to the build. Bound task outputs already have structural binlog records. Remove plain scalar, item and metadata dumps and output-only headings across all repository-owned task implementations. Preserve output properties and bindings, computations, meaningful diagnostics and protected virtual hooks. Unbound outputs are not claimed to be structurally recorded. Update assertions in existing tests without introducing a separate OutputLoggingTests fixture. Representative normal and strict multi-threaded builds eliminate 105 dump headers/scalars while preserving the affected bound outputs. This reduces redundant logging work; it is not a measured end-to-end performance speedup. Co-authored-by: Copilot App <[email protected]> Copilot-Session: c7241405-6476-473c-aa61-b0d31cde7880
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Task behavior and output bindings remain intact, with only optional test-specificity suggestions outstanding.
3 open findings
What changed in this PR
Removes redundant MSBuild task output dumps to reduce logging allocations and message traffic while preserving task outputs and bindings.
Changes:
- Removes scalar, item, and metadata output logging from 29 tasks.
- Preserves diagnostic, decision, warning, and error messages.
- Updates tests to verify outputs remain populated without redundant logs.
| File | Description |
|---|---|
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/ValidateJavaVersionTests.cs |
Verifies Java outputs without dumps. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/ResolveSdksTaskTests.cs |
Checks SDK outputs and removed logging. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/RemoveDirTests.cs |
Verifies removed-directory output. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/CopyIfChangedTests.cs |
Verifies modified-file output. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/DebuggingTasksTests.cs |
Checks ABI outputs without dumps. |
src/Xamarin.Android.Build.Tasks/Tasks/ValidateJavaVersion.cs |
Removes JDK output logging. |
src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs |
Removes resolved SDK path dumps. |
src/Xamarin.Android.Build.Tasks/Tasks/ResolveLibraryProjectImports.cs |
Removes imported-item dumps. |
src/Xamarin.Android.Build.Tasks/Tasks/ResolveAndroidTooling.cs |
Removes tooling output dumps while retaining the virtual hook. |
src/Xamarin.Android.Build.Tasks/Tasks/RemoveUnknownFiles.cs |
Removes deleted-item output dumps. |
src/Xamarin.Android.Build.Tasks/Tasks/RemoveDirFixed.cs |
Removes removed-directory dump. |
src/Xamarin.Android.Build.Tasks/Tasks/ReadLibraryProjectImportsCache.cs |
Removes cached-item dumps. |
src/Xamarin.Android.Build.Tasks/Tasks/ReadImportedLibrariesCache.cs |
Removes imported-library dumps. |
src/Xamarin.Android.Build.Tasks/Tasks/Legacy/ResolveAndroidTooling.cs |
Removes legacy framework output logging. |
src/Xamarin.Android.Build.Tasks/Tasks/GetImportedLibraries.cs |
Removes discovered-library dumps. |
src/Xamarin.Android.Build.Tasks/Tasks/GetFilesThatExist.cs |
Removes existing-file dump. |
src/Xamarin.Android.Build.Tasks/Tasks/GetExtraPackages.cs |
Removes package output logging. |
src/Xamarin.Android.Build.Tasks/Tasks/GenerateLayoutBindings.cs |
Removes generated-file dump. |
src/Xamarin.Android.Build.Tasks/Tasks/FindLayoutsToBind.cs |
Removes layout output dump. |
src/Xamarin.Android.Build.Tasks/Tasks/DetermineJavaLibrariesToCompile.cs |
Removes Java library dumps. |
src/Xamarin.Android.Build.Tasks/Tasks/CreateTemporaryDirectory.cs |
Removes temporary-path logging. |
src/Xamarin.Android.Build.Tasks/Tasks/CopyIfChanged.cs |
Removes modified-file dump. |
src/Xamarin.Android.Build.Tasks/Tasks/CopyGeneratedJavaResourceClasses.cs |
Removes generated resource-file logging. |
src/Xamarin.Android.Build.Tasks/Tasks/ConvertCustomView.cs |
Removes output metadata logging. |
src/Xamarin.Android.Build.Tasks/Tasks/ComputeHash.cs |
Removes hashed-item dump. |
src/Xamarin.Android.Build.Tasks/Tasks/CalculateLayoutCodeBehind.cs |
Removes layout result dumps. |
src/Xamarin.Android.Build.Debugging.Tasks/Tasks/GetPrimaryCpuAbi.cs |
Removes device output dumps. |
src/Microsoft.Android.Build.Tasks/Tests/Microsoft.Android.Build.Tasks.Tests/GetAndroidPackageNameTests.cs |
Verifies package output without logging. |
src/Microsoft.Android.Build.Tasks/Tasks/GetAndroidPackageName.cs |
Removes package-name dump. |
build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/Which.cs |
Removes resolved-location logging. |
build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/GitCommitsInRange.cs |
Removes commit-count logging. |
build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/GitCommitHash.cs |
Removes abbreviated-hash logging. |
build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/GitBranch.cs |
Removes branch output logging. |
build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/GitBlame.cs |
Removes commit metadata dumps. |
build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/Git.cs |
Removes duplicated command-output logging. |
🧠 Review effort: Balanced
jonathanpeppers
enabled auto-merge (squash)
October 13, 2026 21:56
simonrozsival
approved these changes
Oct 13, 2026
Member
Author
|
/backport to release/11.0.1xx |
Contributor
|
Started backporting to |
Contributor
|
@jonathanpeppers backporting to git am output$ git cherry-pick dc740e88cf17201a616cfec5ff718842f43c46b3
Auto-merging build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/GitCommitsInRange.cs
Auto-merging src/Xamarin.Android.Build.Debugging.Tasks/Tasks/GetPrimaryCpuAbi.cs
CONFLICT (content): Merge conflict in src/Xamarin.Android.Build.Debugging.Tasks/Tasks/GetPrimaryCpuAbi.cs
Auto-merging src/Xamarin.Android.Build.Tasks/Tasks/ResolveAndroidTooling.cs
CONFLICT (content): Merge conflict in src/Xamarin.Android.Build.Tasks/Tasks/ResolveAndroidTooling.cs
Auto-merging src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs
CONFLICT (content): Merge conflict in src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs
Auto-merging src/Xamarin.Android.Build.Tasks/Tasks/ValidateJavaVersion.cs
Auto-merging src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/DebuggingTasksTests.cs
CONFLICT (content): Merge conflict in src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/DebuggingTasksTests.cs
Auto-merging src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/ResolveSdksTaskTests.cs
Auto-merging src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/ValidateJavaVersionTests.cs
error: could not apply dc740e88c... [Xamarin.Android.Build.Tasks] Remove redundant output logging (#13129)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: [Xamarin.Android.Build.Tasks] Remove redundant output logging
Using index info to reconstruct a base tree...
M build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/GitCommitsInRange.cs
M src/Xamarin.Android.Build.Debugging.Tasks/Tasks/GetPrimaryCpuAbi.cs
M src/Xamarin.Android.Build.Tasks/Tasks/ResolveAndroidTooling.cs
M src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs
M src/Xamarin.Android.Build.Tasks/Tasks/ValidateJavaVersion.cs
M src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/DebuggingTasksTests.cs
M src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/ResolveSdksTaskTests.cs
M src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/ValidateJavaVersionTests.cs
Falling back to patching base and 3-way merge...
Auto-merging build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/GitCommitsInRange.cs
Auto-merging src/Xamarin.Android.Build.Debugging.Tasks/Tasks/GetPrimaryCpuAbi.cs
CONFLICT (content): Merge conflict in src/Xamarin.Android.Build.Debugging.Tasks/Tasks/GetPrimaryCpuAbi.cs
Auto-merging src/Xamarin.Android.Build.Tasks/Tasks/ResolveAndroidTooling.cs
CONFLICT (content): Merge conflict in src/Xamarin.Android.Build.Tasks/Tasks/ResolveAndroidTooling.cs
Auto-merging src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs
CONFLICT (content): Merge conflict in src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs
Auto-merging src/Xamarin.Android.Build.Tasks/Tasks/ValidateJavaVersion.cs
Auto-merging src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/DebuggingTasksTests.cs
CONFLICT (content): Merge conflict in src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/DebuggingTasksTests.cs
Auto-merging src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/ResolveSdksTaskTests.cs
Auto-merging src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/ValidateJavaVersionTests.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 [Xamarin.Android.Build.Tasks] Remove redundant output logging
Error: The process '/usr/bin/git' failed with exit code 128 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Reduce unnecessary logging work in Android MSBuild tasks, particularly with multi-threaded MSBuild. Formatting output values and item lists creates extra allocations and log messages. For out-of-process task hosts, those messages also need to be serialized and routed back to MSBuild. Bound task outputs already have structural records in the binlog, so repeating their values as task-authored messages is redundant.
For example,
<ValidateJavaVersion/>logs an output heading plusJdkVersionandMinimumRequiredJdkVersion, even though its existing output bindings record$(_JdkVersion)and$(_DefaultJdkVersion). Removing these dumps avoids three extra messages per invocation without changing the outputs or how often the task runs.Audit all 178 repository-owned task classes, including inherited and partial definitions,
src,build-tools, in-tree Java.Interop and inline tasks. Remove output-only scalar/item/metadata dumps and headings from 29 task files, and update assertions in six existing test files. Keep output properties, computations and bindings unchanged, together with input diagnostics, warnings/errors, decisions, progress, useful counts, file-operation outcomes and protected virtual hooks. Java.Interop has no output-only dump requiring an edit. This does not change nested-build scheduling or gate common logging helpers globally.Representative normal and strict multi-threaded (
-mt) Android rebuilds show 105 matched dump headers/scalars dropping to zero. The affected tasks retain 57 bound properties, two nonempty items and 17 metadata entries in their structural output records. In particular,$(_JdkVersion)=21.0.8and$(_DefaultJdkVersion)=11.0remain recorded. The two intentionally random temporary-directory roots are normalized for comparison; their output property names and derived paths are preserved.This is a performance-motivated reduction in redundant message traffic, not a claim of a measured end-to-end build-time speedup.
Output visibility caveats
Removing a dump does not make an unbound output structurally visible. No new product bindings are added. The following removed dumps have no in-tree
<Output/>binding:<Git/>:Output;<Which/>:Location;<GetFilesThatExist/>:FilesThatExist.<GetImportedLibraries/>:Jars,NativeLibraries,ManifestDocuments.<ResolveAndroidTooling/>:TargetFrameworkVersion;<ReadLibraryProjectImportsCache/>:Jars.<RemoveDirFixed/>and<RemoveUnknownFiles/>:RemovedDirectories.<ResolveLibraryProjectImports/>:Jars,ResolvedAssetDirectories,ResolvedResourceDirectories,ResolvedEnvironmentFiles,ResolvedResourceDirectoryStamps,ProguardConfigFiles,ExtractedDirectories.Cache-producing tasks still write their existing cache files; existing bound cache-reader outputs provide later structural records where applicable. There is no claim that every unbound value is captured.
Local validation and exact commands
Built the changed SDK in this worktree using the pinned local SDK
12.0.100-alpha.1.26509.101, MSBuild18.13.0-1.26509.101and Android Debug workload37.99.0. No installed Android RC1 workload was used.Commands below run from the repository root in
cmd.exe, with:Full local SDK build: passed, zero errors, 92 existing warnings.
Test project rebuild after removing
OutputLoggingTests.cs: passed, zero warnings/errors. The separate fixture is not part of this PR.Host task regressions and sequential/parallel CoreCLR layout integration: 67 passed, zero failed/skipped.
Modern package-name output/error validation: 4 passed, zero failed/skipped.
Session-only preparation-task output checks: passed all six changed tasks, including item metadata.
Read-only Pixel 10 checks: passed live, cached and architecture-shortcut
<GetPrimaryCpuAbi/>paths, matchingadb getpropresults (arm64-v8a,android-arm64, API 36). Explicit serial58230DLCR0013R; no app installed or changed.Representative Android builds: passed normal and strict multi-threaded builds, zero warnings/errors. Binlog inspection confirms strict mode was enabled for
-mt.binlogtoolinspection and output comparisons: passed, removed dump text absent and affected bound outputs preserved.Saved local evidence includes
baseline-app.binlog,changed-app.binlog,changed-app-mt.binlog,audit-inventory.json,binlog-comparison.jsonandchanged-app-mt-comparison.json. The comparisons are scoped to changed tasks: untouched typemap item ordering varies, and the later untouched assembly-processing output includes an additional local-packMono.Android.Export.pdb.No linked issue.
Pull Request
title and
description
should follow the
commit-messages.mdworkflow documentation, and in particular should include: