dotnet / dotnet/linker

Custom step insertion is error-prone

Open
#2,081 0 comments 0 reactions 0 assignees View on GitHub
area-Linker: Extensibility
Dominant language
C#
Stars
392
Forks
128
Avg merge
2d 10h
Merged PRs (30d)
2

Description

It's quite easy to make mistakes with the custom step MSBuild/command-line and insert them in an unintended order. For example you might write
```xml
<_TrimmerCustomSteps Include="$(_TaskAsm)" AfterStep="OutputStep" Type="Xamarin.Linker.RegistrarStep" />
<_TrimmerCustomSteps Include="$(_TaskAsm)" AfterStep="OutputStep" Type="Xamarin.Linker.DoneStep" />
```
expecting that `DoneStep` will come last when really this just determines the order of insertions (this actually was the case before https://github.com/mono/linker/pull/2082). Maybe it would be better to provide a way to insert multiple custom steps at once in a fixed order, similar to SubStepDispatcher (see https://github.com/xamarin/xamarin-android/blob/main/src/Microsoft.Android.Sdk.ILLink/PreserveSubStepDispatcher.cs#L9-L17 for example), but with a list of Steps instead of SubSteps.

This probably isn't worth it just for xamarin-android/xamarin-macios, but we should consider improving this if we ever want the plugin model to become more widely used.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.