Implement TrimmingDescriptorNode for ILTrim XML descriptor support#126990
Open
Implement TrimmingDescriptorNode for ILTrim XML descriptor support#126990
Conversation
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/d523a942-ceab-437f-850d-dcb3d528fd44 Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
MichalStrehovsky
April 16, 2026 08:48
View session
MichalStrehovsky
approved these changes
Apr 16, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Implements support for ILTrim’s -x (XML descriptor) option by reusing the NativeAOT TrimmingDescriptorNode, enabling descriptor-based rooting during ILTrim runs and updating ILTrim test expectations accordingly.
Changes:
- Enabled
-xprocessing underILTRIMby addingTrimmingDescriptorNodeto ILTrim inputs instead of skipping descriptor handling. - Updated
TrimmingDescriptorNodeto compile and function underILTRIMby using ILTrim’sNodeFactorylogging/settings surface and excludingICompilationRootProviderwhere unavailable. - Updated ILTrim expected failures list to reflect newly passing descriptor-related tests and added one expected failure due to semantic differences.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/tools/illink/src/linker/Linker/Driver.cs |
Wires -x into ILTrim by adding TrimmingDescriptorNode to ILTrim inputs. |
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/TrimmingDescriptorNode.cs |
Adds #if ILTRIM adaptations for logger/settings and guards ICompilationRootProvider. |
src/coreclr/tools/ILTrim.Core/ILTrim.Core.csproj |
Links TrimmingDescriptorNode.cs into ILTrim.Core so ILTrim can use it. |
src/coreclr/tools/ILTrim.Tests/ILTrimExpectedFailures.txt |
Removes now-passing tests from expected failures; adds one new expected failure. |
Contributor
|
Tagging subscribers to this area: @agocke, @dotnet/illink |
This was referenced Apr 16, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
-x(XML descriptor) command-line option was unimplemented for ILTrim — the#if !ILTRIMblock inDriver.cssimply skipped descriptor processing. This reusesTrimmingDescriptorNodefromILCompiler.Compilerto implement it.Changes
Driver.cs(illink): AddedTrimmingDescriptorNodeusing alias under#if ILTRIM; replaced the no-op#if !ILTRIMwithinputs.Add(new TrimmingDescriptorNode(xmlFile))TrimmingDescriptorNode.cs: Added#if ILTRIMto usefactory.Logger/factory.Settings.FeatureSettingsinstead ofMetadataManager; guardedICompilationRootProviderwith#if !ILTRIM(not available in ILTrim)ILTrim.Core.csproj: IncludedTrimmingDescriptorNode.csas a linked compile itemILTrimExpectedFailures.txt: Removed 23 now-passing tests (mostlyLinkXml.*and someInheritance.Interfaces.*); added 1 new expected failure (LinkXml.UnusedNonRequiredTypeIsRemoved— inherits NativeAOT'sDescriptorMarkersemantics which don't honorrequired="0")Test results: 0 failures, 308 passed (up from 285), 604 skipped.