Skip to content

[illink] Do not preserve whole collection types - #5445

Merged
jonpryor merged 1 commit into
dotnet:masterfrom
radekdoulik:pr-illink-java-collections
Jan 7, 2021
Merged

jonpryor merged 1 commit into
dotnet:masterfrom
radekdoulik:pr-illink-java-collections

Conversation

@radekdoulik

Copy link
Copy Markdown
Member

Context: #5167
Context: #5206

Instead of preserving these types unconditionally, use the new dynamic
dependency attributes

apksize impact on BuildReleaseArm64False test:

> lapkdiff -f -e dll$ before.apk after.apk
Size difference in bytes ([*1] apk1 only, [*2] apk2 only):
  -         477 assemblies/Java.Interop.dll
  -         603 assemblies/System.Collections.Concurrent.dll
  -       1,388 assemblies/System.Private.CoreLib.dll
  -      30,291 assemblies/Mono.Android.dll
Summary:
  -      32,759 Assemblies -4.19% (of 781,837)
  -      32,768 Package size difference -0.43% (of 7,645,409)

Context: dotnet#5167
Context: dotnet#5206

Instead of preserving these types unconditionally, use the new dynamic
dependency attributes

apksize impact on BuildReleaseArm64False test:

    > lapkdiff -f -e dll$ before.apk after.apk
    Size difference in bytes ([*1] apk1 only, [*2] apk2 only):
      -         477 assemblies/Java.Interop.dll
      -         603 assemblies/System.Collections.Concurrent.dll
      -       1,388 assemblies/System.Private.CoreLib.dll
      -      30,291 assemblies/Mono.Android.dll
    Summary:
      -      32,759 Assemblies -4.19% (of 781,837)
      -      32,768 Package size difference -0.43% (of 7,645,409)
@radekdoulik
radekdoulik marked this pull request as ready for review December 23, 2020 17:29
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.Size))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.SizeF))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.SystemColors))]
[assembly: InternalsVisibleTo("Mono.Android.Export, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this change needed? Does the C# compiler "know about" [DynamicDependency] and require visibility to the specified member?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Because DynamicDependencyAttribute is internal attribute in Mono.Android for monodroid target framework - that's our "placeholder" to avoid #if's .

@jonpryor
jonpryor merged commit 15269f6 into dotnet:master Jan 7, 2021
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 26, 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.

2 participants