Skip to content
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

Remove custom types marking for types which XA does not own for netcore #5354

Merged
merged 13 commits into from
Dec 9, 2020

Conversation

marek-safar
Copy link
Contributor

@marek-safar marek-safar commented Dec 2, 2020

This is or will be handled by BCL libraries and XA tooling should try
not to interfere with more fine tuned handling done by BCL.

Simplifies [Preserve] attribute implementation and removes
old code to preserve serialization, which doesn't work
well with new .NET5/6 runtime libraries. (the old serialization
code: https://github.com/xamarin/xamarin-android/blob/master/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/ApplyPreserveAttribute.cs#L57-L82)

The serialization is currently broken
and will be fixed in runtime libs. Part of CustomLinkDescriptionPreserve
test is thus disabled.

Also the attribute removal is now handled in illink.

The serialization fix leads to great reduction of assemblies size in simple
XA test app by cca 1MB, apkdiff before/after:

Summary:
  -   1,199,411 Assemblies -55.66% (of 2,154,984)
  -   1,206,333 Package size difference -13.37% (of 9,024,291)

@@ -217,7 +217,11 @@ public void InstallWithoutSharedRuntime ()
// "The Shared Runtime should not have been installed.");
var directorylist = GetContentFromAllOverrideDirectories (proj.PackageName);
StringAssert.Contains ($"{proj.ProjectName}.dll", directorylist, $"{proj.ProjectName}.dll should exist in the .__override__ directory.");
StringAssert.Contains ($"System.dll", directorylist, $"System.dll should exist in the .__override__ directory.");
if (Builder.UseDotNet)
StringAssert.Contains ($"System.Private.CoreLib.dll", directorylist, $"System.Private.CoreLib.dll should exist in the .__override__ directory.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this test fails, you might check for a different assembly like System.Linq.dll. I think System.Private.CoreLib.dll can be in a sub-directory like armeabi-v7a or x86.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System.Private.CoreLib.dll is probably only reliable marker. I hope System.Linq.dll will be gone too next week ;-)

@jonpryor
Copy link
Member

jonpryor commented Dec 4, 2020

@radekdoulik: please address the merge conflicts.

Additionally, you had mentioned that this change would "implicitly" break apps requiring serialization, e.g. dotnet/runtime#45559

Please write up a description/explanation for the non-obvious relation here.

@radekdoulik radekdoulik merged commit 89edafc into dotnet:master Dec 9, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants