Skip to content

Add DependencyKind.DisablePrivateReflectionRequirement to methodreasons and typereasons to fix tests.#128461

Open
jtschuster wants to merge 1 commit into
dotnet:mainfrom
jtschuster:runtime-trimmer-ci-assert
Open

Add DependencyKind.DisablePrivateReflectionRequirement to methodreasons and typereasons to fix tests.#128461
jtschuster wants to merge 1 commit into
dotnet:mainfrom
jtschuster:runtime-trimmer-ci-assert

Conversation

@jtschuster
Copy link
Copy Markdown
Member

@jtschuster jtschuster commented May 21, 2026

#128349 started running tests with a Debug illink, which is tripping an assert. I missed the fact that the illink unit tests didn't run and now those tests are failing: #128349 (comment)

To fix, add this reason as an expected reason for marking a method or a type.

@jtschuster jtschuster requested review from a team, MichalStrehovsky, Copilot and sbomer May 21, 2026 22:26
@dotnet-policy-service dotnet-policy-service Bot added the linkable-framework Issues associated with delivering a linker friendly framework label May 21, 2026
@github-actions github-actions Bot added the area-Tools-ILLink .NET linker development as well as trimming analyzers label May 21, 2026
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

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

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

This PR updates ILLink’s MarkStep debug-only validation allowlists to recognize DependencyKind.DisablePrivateReflectionRequirement as a valid reason when marking types and methods. This prevents DEBUG builds/tests from throwing due to the newly used dependency kind when the linker roots DisablePrivateReflectionAttribute.

Changes:

  • Add DependencyKind.DisablePrivateReflectionRequirement to the _typeReasons allowlist used by MarkType DEBUG validation.
  • Add DependencyKind.DisablePrivateReflectionRequirement to the _methodReasons allowlist used by ProcessMethod DEBUG validation.
@jtschuster
Copy link
Copy Markdown
Member Author

RequiresUnsafe failure seems like something for a separate PR.

@jtschuster jtschuster enabled auto-merge (squash) May 22, 2026 00:06
@agocke
Copy link
Copy Markdown
Member

agocke commented May 22, 2026

I think you can delete the RequiresUnsafe analyzer now and just keep the code fixer

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 linkable-framework Issues associated with delivering a linker friendly framework

4 participants