Skip to content

Make CustomizeTrimming virtual#124973

Open
mrvoorhe wants to merge 1 commit intodotnet:mainfrom
Unity-Technologies:linker-expose-customize-trimming
Open

Make CustomizeTrimming virtual#124973
mrvoorhe wants to merge 1 commit intodotnet:mainfrom
Unity-Technologies:linker-expose-customize-trimming

Conversation

@mrvoorhe
Copy link
Contributor

Unity's test framework needs to override this. At some point between net8 and now this was refactored and the virtual was dropped.

Unity's test framework needs to override this
@mrvoorhe mrvoorhe requested a review from sbomer as a code owner February 27, 2026 14:45
Copilot AI review requested due to automatic review settings February 27, 2026 14:45
@github-actions github-actions bot added the area-Tools-ILLink .NET linker development as well as trimming analyzers label Feb 27, 2026
@mrvoorhe
Copy link
Contributor Author

@sbomer please take a look

@dotnet-policy-service dotnet-policy-service bot added linkable-framework Issues associated with delivering a linker friendly framework community-contribution Indicates that the PR has been added by a community member labels Feb 27, 2026
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @agocke, @dotnet/illink
See info in area-owners.md if you want to be subscribed.

Copy link
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

This PR restores overridability of the trimming customization hook used by the ILLink trimming test runners, enabling Unity’s test framework to override CustomizeTrimming as it could in .NET 8.

Changes:

  • Mark CustomizeTrimming(TrimmingDriver, TestCaseMetadataProvider) as virtual in the shared TestRunner declaration.
  • Update the corresponding partial implementations in the Mono.Linker and NativeAOT trimming test runners to match the new virtual modifier.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/tools/illink/test/Trimming.Tests.Shared/TestRunner.cs Makes the shared partial CustomizeTrimming declaration virtual so derived runners can override it.
src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestRunner.cs Updates the partial implementation to include virtual, matching the shared declaration.
src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TestRunner.cs Updates the partial implementation to include virtual, matching the shared declaration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Tools-ILLink .NET linker development as well as trimming analyzers community-contribution Indicates that the PR has been added by a community member linkable-framework Issues associated with delivering a linker friendly framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants