dotnet / linker

388 stars 127 forks source link

Deprecate the warning XmlDuplicatePreserveMember #3068

Open tlakollo opened 1 year ago

tlakollo commented 1 year ago

This warning is triggered when you preserve a member using a descriptor.xml file twice, meaning that in the case of linker you add a member to the annotation store, and the second time, we verify if the member is already in the cache and generate a warning about it. Given that there could be several descriptor.xml files playing at the same time if there is a member that is processed twice we would generate a warning that is not useful (the system will keep the member around either way) and may not be the user's fault (maybe a NuGet package inserts a descriptor.xml file). In the case of NativeAOT that doesn't have a notion of a global annotations cache and just uses the dependency graph, it would imply additional development to verify nothing was added twice and be able to produce the warning (the dependency graph already deduplicates marking). Therefore I think for the best we should stop producing the XmlDuplicatePreserveMember