Enable trim and AOT analyzers for selected library tests#128355
Conversation
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/5977beb1-58f4-4a75-9a1c-02ff1bb17294 Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/5977beb1-58f4-4a75-9a1c-02ff1bb17294 Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
|
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries |
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/5a0b0c7b-d13e-4936-8392-ff08d859bc72 Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/5a0b0c7b-d13e-4936-8392-ff08d859bc72 Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/087bc9c5-a2a7-4eea-becd-4a9625ddce15 Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/087bc9c5-a2a7-4eea-becd-4a9625ddce15 Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
|
@copilot build breaks For the ManagementObjectTests.cs occurence, mark the method as For the DirectoryServicesTests.cs, suppress the warning using |
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/5e49e977-7ef9-4b3f-ba25-f076d020cb7e Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
|
Build breaks in the .NET framework build (TargetFramework=net481). Add ifdef for the Also a build break on Windows x64: For this, propagate the DynamicallyAccessedMembers annotations from the called method to the calling methods T. |
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/798bad8f-5f09-4037-886d-e162a23c8e96 Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
... Fixed in ea6ff58. I added the net481 fallback around |
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/bf35c830-f126-452f-8a1b-0b1e01c449a2 Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
sbomer
left a comment
There was a problem hiding this comment.
One question, otherwise LGTM, thanks!
Description
Several library test projects suppressed trim/AOT analyzer warnings by disabling the analyzers at the project level. This change enables the analyzers for the selected test projects where appropriate and replaces broad suppressions with targeted fixes or narrow warning pragmas at known test-only reflection and dynamic-code sites.
dotnet/runtime#126862analyzer-disable blocks from the selected test projects, while leavingMicrosoft.Extensions.HostFactoryResolver.Testsdisabled for separate follow-up because enabling it would require product changes.DiagnosticMethodInfo,Enum.GetValues<TEnum>(), LINQ-based collection conversion, and source-project references where applicable.net481test builds.System.Threading.RateLimiting.Teststo reference the source project withSkipUseReferenceAssembly="true"and avoid local reflection suppressions.DynamicallyAccessedMembersannotations through the WinHttpHandler test marshal shim.GetStateMachineData.DescribeandWatchdogbehavior intact, with narrow suppressions documenting that the diagnostic reflection path is dead code after runtime async.#pragma warning disable/restorescopes only for remaining emitted IL warnings that require reflection, dynamic code, or unsupported trim/AOT analysis patterns.