-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trim RefSafetyRulesAttribute when trimming aggressively #88717
Conversation
This is another attribute that Roslyn uses for its own purposes only.
Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr, @marek-safar Issue DetailsThis is another attribute that Roslyn uses for its own purposes only. Cc @dotnet/illink-contrib (btw what's the difference between this and @dotnet/illink?)
|
@@ -320,6 +320,9 @@ | |||
<type fullname="System.Runtime.CompilerServices.ScopedRefAttribute"> | |||
<attribute internal="RemoveAttributeInstances" /> | |||
</type> | |||
<type fullname="System.Runtime.CompilerServices.RefSafetyRulesAttribute"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the C# compiler adds more and more of these, is there a way to keep this list up-to-date, or at least a way to audit when new attributes are added by the C# compiler?
From @333fred - #85612 (comment) lists all the attributes emitted by the compiler.
Also note - a bunch of these attributes are now in CoreLib with #87857.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't strip everything the compiler injects because some of these are "public APIs" (we tell people how to interpret them, like the nullable attributes). Then there's those with unknown purpose like RefSafetyRulesAttribute or EmbeddedAttribute that only mean something to Roslyn.
Roslyn should ideally have a holistic look at this because in 10 years we'll have 20 attributes that cost us 20 kB (need to count IL size, metadata size, readytorun code size) to encode 20 bytes of information in each assembly - #85612 (comment). If we could have a RoslynBreadcrumbsAttribute
that takes a byte[]
that Roslyn can decode, it might be more space efficient than a new type for every tiny bit of information.
This is another attribute that Roslyn uses for its own purposes only.
Cc @dotnet/illink-contrib (btw what's the difference between this and @dotnet/illink?)