Repository navigation
Add XML output for retained type maps in ILC and ILLink - #135275
simonrozsival wants to merge 3 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 4 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @agocke, @dotnet/illink |
Integrate NativeAOT output with ObjectDumper, pass the configured output path to both tools, and use shared library trimming tests for runtime, XML, and build-lifecycle coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
@MichalStrehovsky thanks for the review. Your suggestions helped simplify this quite a bit. ILC now uses an The output path comes from I moved the tests into the existing library trimming test so the same C# source checks runtime behavior and XML with both ILC and ILLink. The XML is copied beside the executable only for testing. This also covers cross-assembly mappings and universe isolation. The custom compiler/process harnesses and artificial metadata-name and null-key cases are gone. The extra type-name handling was an attempt to account for hypothetical unusual metadata names. I removed those special cases and the documentation caveat; ILC uses its existing formatter. I also removed the speculative unsupported-type diagnostic and format version, restored platform-default line endings, and moved the ILLink-only escaping helper out of the shared writer. Note This comment was drafted with GitHub Copilot. |
Generate the optional Import element only when additional targets are specified, avoiding empty Project attributes in other trimming test projects. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Adds opt-in XML output describing the type maps retained by ILC and ILLink, including external and proxy mappings grouped by universe.
This gives downstream build tools, such as Android’s R8 integration, the information needed to keep generated wrappers for surviving mappings without relying on dependency graphs or trimmed-assembly inspection.
Enable it with
TypeMapGenerateXmlFile=truein SDK builds or--output-typemapson the command line. The XML is an intermediate build artifact, not part of the published application, and does not change trimming behavior.The output uses a common XML format for both ILC and ILLink:
The root declares the format version, and each universe has separate sections for external (
string → Type) and proxy (Type → Type) mappings. External keys are preserved verbatim. Managed types use reflection-style names with simple assembly qualification.Closes #120204
/cc @rolfbjarne
Note
This PR description was drafted with GitHub Copilot.