Remove debug only attributes when Debugger.IsSupported is false.#39237
Remove debug only attributes when Debugger.IsSupported is false.#39237eerhardt merged 2 commits intodotnet:masterfrom
Conversation
|
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
| </assembly> | ||
|
|
||
| <!-- The following attributes are only necessary when debugging is supported --> | ||
| <assembly fullname="System.Private.CoreLib" feature="System.Diagnostics.Debugger.IsSupported" featurevalue="false"> |
There was a problem hiding this comment.
"featurevalue=false" means these can be removed when IsSupported is set to false, right? Just validating it's not actually setting IsSupported to false :)
There was a problem hiding this comment.
Correct. Feature and featurevalue in the linker xml files are conditions. “Do this when this feature has this value”.
| </assembly> | ||
|
|
||
| <!-- The following attributes are only necessary when debugging is supported --> | ||
| <assembly fullname="System.Private.CoreLib" feature="System.Diagnostics.Debugger.IsSupported" featurevalue="false"> |
There was a problem hiding this comment.
As all these are feature-switch covered settings which are not wasm specific and we should move them to shared SPC ILLink.LinkAttributes.xml
There was a problem hiding this comment.
I'm not sure I understand what makes the feature-switch covered attribute different from the rest of the attributes in this file. Why aren't the rest of them in the shared SPC?
There was a problem hiding this comment.
The default SDK setup is trim with copy so it feels odd to include the list of always removed attribute for everyone but I'm not against ;-)
src/mono/netcore/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.wasm.xml
Outdated
Show resolved
Hide resolved
|
|
Contributes to dotnet/linker#1093
Locally, I'm seeing roughly ~100 KB total reduction when enabling
Debugger.IsSupported = falseafter this change. That does include roughly ~8KB other Debugger-only trimming coming from #37288, so the net win with this change is about 90 KB.