Skip to content

TypeMap API: For trimmed and nativeaot builds, provide a list of the types kept by the typemap #120204

@jtschuster

Description

@jtschuster

In Android (and maybe iOS), it is necessary to create Java wrapper types and native glue stubs that call into .NET. It's not necessary to keep these java types and native methods for .NET types that are trimmed away, but there's not an easy way to tell what is necessary for the app. If the TypeMap output the target types in the typemap that are kept, it would greatly simplify and speed up the build process, and create smaller applications.
Alternatively, the android build could inspect every single assembly in trimmed apps, and parse the ILC trimming xml logger for nativeaot apps.

Open questions:

Android works around one Java class mapping to multiple .NET types with a "mapper class" in the TypeMap that points to each of the aliases. This would require additional bookkeeping in the build to remember which types are mapper classes and which java classes and stubs they should keep for those mapper types.

cc. @simonrozsival @AaronRobinsonMSFT

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Tools-ILLink.NET linker development as well as trimming analyzers

    Type

    No type

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions