Skip to content

Move FixAbstractMethodsStep out of ILLink process - #11029

Merged
sbomer merged 4 commits into
mainfrom
dev/sbomer/fix-abstract-methods-v2
Mar 31, 2026
Merged

Move FixAbstractMethodsStep out of ILLink process#11029
sbomer merged 4 commits into
mainfrom
dev/sbomer/fix-abstract-methods-v2

Conversation

@sbomer

@sbomersbomer commented Mar 26, 2026

Copy link
Copy Markdown
Member

Move FixAbstractMethodsStep out of the ILLink MarkStep handler into the PostTrimmingPipeline MSBuild task (runs AfterTargets=ILLink). The step now extends BaseStep instead of BaseMarkHandler, with an internal constructor for dependency injection used by the new thin PostTrimmingFixAbstractMethodsStep wrapper. The no-trim path (LinkAssembliesNoShrink) continues to work via BaseStep.Initialize.

Preserve Java.Lang.AbstractMethodError via linker descriptor XML since the step no longer calls Annotations.Mark().

Trying as an alternative to #11010.

…ipeline
Move FixAbstractMethodsStep out of the ILLink MarkStep handler into the
PostTrimmingPipeline MSBuild task (runs AfterTargets=ILLink). The step
now extends BaseStep instead of BaseMarkHandler, with an internal
constructor for dependency injection used by the new thin
PostTrimmingFixAbstractMethodsStep wrapper. The no-trim path
(LinkAssembliesNoShrink) continues to work via BaseStep.Initialize.
Preserve Java.Lang.AbstractMethodError via linker descriptor XML since
the step no longer calls Annotations.Mark().
@sbomer
sbomer marked this pull request as ready for review March 30, 2026 17:44
CopilotAI review requested due to automatic review settings March 30, 2026 17:44

CopilotAI 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

Moves FixAbstractMethodsStep out of the ILLink MarkStep custom-step pipeline and into the PostTrimmingPipeline MSBuild task that runs AfterTargets="ILLink", while keeping the non-trim (LinkAssembliesNoShrink) path working via BaseStep.Initialize.

Changes:

  • Remove MonoDroid.Tuner.FixAbstractMethodsStep from _TrimmerCustomSteps and from the Microsoft.Android.Sdk.ILLink project.
  • Add PostTrimmingFixAbstractMethodsStep and wire it into PostTrimmingPipeline with memoized Mono.Android resolution.
  • Preserve Java.Lang.AbstractMethodError via Mono.Android.xml linker descriptor since the step no longer calls Annotations.Mark().

Reviewed changes

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

Show a summary per file
FileDescription
src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csprojAdds new post-trimming wrapper step source file to build tasks compilation.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/LinkerTests.csUpdates tests to use BaseStep.Initialize(LinkContext) signature.
src/Xamarin.Android.Build.Tasks/Tasks/PostTrimmingPipeline.csRegisters the new post-trimming fix step and memoizes Mono.Android assembly resolution.
src/Xamarin.Android.Build.Tasks/Tasks/LinkAssembliesNoShrink.csUpdates no-trim path initialization to use Initialize(context) only.
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.LlvmIr.targetsRemoves FixAbstractMethodsStep from ILLink custom steps list.
src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/PostTrimmingFixAbstractMethodsStep.csNew wrapper implementing IAssemblyModifierPipelineStep for post-trim execution.
src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/FixAbstractMethodsStep.csRefactors step to BaseStep + DI-friendly constructor, removing MarkStep handler behavior.
src/Microsoft.Android.Sdk.ILLink/PreserveLists/Mono.Android.xmlPreserves Java.Lang.AbstractMethodError constructor via descriptor XML.
src/Microsoft.Android.Sdk.ILLink/Microsoft.Android.Sdk.ILLink.csprojStops compiling/linking FixAbstractMethodsStep into the ILLink assembly.

Comment threadsrc/Xamarin.Android.Build.Tasks/Tasks/PostTrimmingPipeline.cs Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sbomer
sbomer merged commit c6bf63d into mainMar 31, 2026
6 checks passed
@sbomer
sbomer deleted the dev/sbomer/fix-abstract-methods-v2 branch March 31, 2026 22:13
@sbomersbomer mentioned this pull request Mar 31, 2026
9 tasks
@github-actionsgithub-actionsBot locked and limited conversation to collaborators May 1, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@sbomer@simonrozsival