Skip to content

Move FixAbstractMethodsStep out of ILLink process#11029

Open
sbomer wants to merge 3 commits intomainfrom
dev/sbomer/fix-abstract-methods-v2
Open

Move FixAbstractMethodsStep out of ILLink process#11029
sbomer wants to merge 3 commits intomainfrom
dev/sbomer/fix-abstract-methods-v2

Conversation

@sbomer
Copy link
Copy Markdown
Member

@sbomer sbomer commented Mar 26, 2026

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.

sbomer added 2 commits March 26, 2026 16:01
…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
Copilot AI review requested due to automatic review settings March 30, 2026 17:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
File Description
src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj Adds new post-trimming wrapper step source file to build tasks compilation.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs Updates tests to use BaseStep.Initialize(LinkContext) signature.
src/Xamarin.Android.Build.Tasks/Tasks/PostTrimmingPipeline.cs Registers the new post-trimming fix step and memoizes Mono.Android assembly resolution.
src/Xamarin.Android.Build.Tasks/Tasks/LinkAssembliesNoShrink.cs Updates no-trim path initialization to use Initialize(context) only.
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.LlvmIr.targets Removes FixAbstractMethodsStep from ILLink custom steps list.
src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/PostTrimmingFixAbstractMethodsStep.cs New wrapper implementing IAssemblyModifierPipelineStep for post-trim execution.
src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/FixAbstractMethodsStep.cs Refactors step to BaseStep + DI-friendly constructor, removing MarkStep handler behavior.
src/Microsoft.Android.Sdk.ILLink/PreserveLists/Mono.Android.xml Preserves Java.Lang.AbstractMethodError constructor via descriptor XML.
src/Microsoft.Android.Sdk.ILLink/Microsoft.Android.Sdk.ILLink.csproj Stops compiling/linking FixAbstractMethodsStep into the ILLink assembly.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

2 participants