Move FixAbstractMethodsStep out of ILLink process#11029
Open
Conversation
…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().
Contributor
There was a problem hiding this comment.
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.FixAbstractMethodsStepfrom_TrimmerCustomStepsand from theMicrosoft.Android.Sdk.ILLinkproject. - Add
PostTrimmingFixAbstractMethodsStepand wire it intoPostTrimmingPipelinewith memoizedMono.Androidresolution. - Preserve
Java.Lang.AbstractMethodErrorviaMono.Android.xmllinker descriptor since the step no longer callsAnnotations.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. |
src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/FixAbstractMethodsStep.cs
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
3 tasks
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.