dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.36k stars 4.74k forks source link

System.Collections.Immutable aren't runnable with trimming #108274

Open MichalStrehovsky opened 1 month ago

MichalStrehovsky commented 1 month ago

107872 added reflection to the test that cannot be statically analyzed. Native AOT outerloop testing has been on the floor ever since. I'm going to disable running all S.C.Immutable tests under native AOT on this issue to get outerloop green again.

dotnet-policy-service[bot] commented 1 month ago

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

eiriktsarpalis commented 1 month ago

I think it should be fine to just disable the tests using reflection in Native AOT. They're there to validate certain non-functional invariants (e.g. whether the internal tree structures are always balanced) that we don't need to run on every platform (and ideally should be replaced with debug asserts at some point).

lambdageek commented 1 month ago

This might be a good place to use [UnsafeAccessor] instead of reflection

MichalStrehovsky commented 1 month ago

I think it should be fine to just disable the tests using reflection in Native AOT

The tests could also be annotated for trimming.

This might be a good place to use [UnsafeAccessor] instead of reflection

If we don't have to run these tests on Framework, it might. But I do see $(NetFrameworkMinimum) in the csproj.