-
Notifications
You must be signed in to change notification settings - Fork 511
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
[net10.0] [dotnet] Rework aggressive attribute trimming. Fixes #20906. #21314
[net10.0] [dotnet] Rework aggressive attribute trimming. Fixes #20906. #21314
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Note that removing this attribute can change runtime behavior. For example, | ||
System.Xml.Serialization will behave differently if a ctor is Obsolete. | ||
This is low enough risk on when 'ObjCRuntime.AggressiveAttributeTrimming' is enabled to justify | ||
removing the attribute for size savings. The app developer can override this setting | ||
to keep all ObsoleteAttributes. |
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.
Should we document this somewhere outside this file? /docs maybe? and maybe link it from build-properties.md entry you added
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.
@dalexsoto I expanded a bit on this in the build-properties.md doc.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The aggressive attribute trimming as exposed by ILLink is undocumented and has problematic behavior, so disable it (it can't be statically validated) - ILLink already removed support for it anyway. However, this has a somewhat significant size increase for our apps, and it would affect pretty much every app, so re-implement the aggressive attribute trimming ourselves. This is accomplished by copying ILLink's list of attributes to remove into our own xml definition, which we then pass to ILLink. I tested a release build of monotouch-test for all platforms, and the final size is almost entirely unchanged, except for a minimal size decrease. Here's the results for iOS: https://gist.github.com/rolfbjarne/dac3e08620a3ae499ad1fc134765e0d2 Fixes #20906.
9f56935
to
ec9c808
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…-attribute-trimming
✅ API diff for current PR / commit.NET (No breaking changes)✅ API diff vs stable.NET (No breaking changes)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
💻 [CI Build] Windows Integration Tests passed 💻✅ All Windows Integration Tests passed. Pipeline on Agent |
💻 [CI Build] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 101 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
The aggressive attribute trimming as exposed by ILLink is undocumented and has
problematic behavior, so disable it (it can't be statically validated) -
ILLink already removed support for it anyway.
However, this has a somewhat significant size increase for our apps, and it
would affect pretty much every app, so re-implement the aggressive attribute
trimming ourselves.
This is accomplished by copying ILLink's list of attributes to remove into our
own xml definition, which we then pass to ILLink.
I tested a release build of monotouch-test for all platforms, and the final
size is almost entirely unchanged, except for a minimal size decrease.
Here's the results for iOS: https://gist.github.com/rolfbjarne/dac3e08620a3ae499ad1fc134765e0d2
Fixes #20906.