Skip to content

Use resolved publish output for NativeAOT IlcCompileInput#127579

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/fix-ilc-compile-input-issue
Draft

Use resolved publish output for NativeAOT IlcCompileInput#127579
Copilot wants to merge 4 commits intomainfrom
copilot/fix-ilc-compile-input-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 29, 2026

When RunILLink=true, NativeAOT could still compile @(IntermediateAssembly) instead of the post-ILLink main assembly from $(IntermediateLinkDir). This updates ComputeIlcCompileInputs to select the resolved publish item for the app assembly when available, while preserving the existing fallback for flows that do not populate it.

  • Main change

    • ComputeIlcCompileInputs now matches the app’s main assembly by name against @(ResolvedFileToPublish) entries marked PostprocessAssembly=true.
    • When a match is found, IlcCompileInput uses that resolved item instead of @(IntermediateAssembly).
  • Fallback behavior

    • If no matching resolved publish item exists, IlcCompileInput continues to use @(IntermediateAssembly).
    • This keeps the non-ILLink and non-publish paths unchanged.
  • Matching behavior

    • The lookup is based on the IntermediateAssembly file name so the main assembly can be sourced from the linked output without requiring consumers to override IlcCompileInput.
<!-- Before -->
<ManagedBinary Include="@(IntermediateAssembly)" />

<!-- After: prefer the matching resolved publish item when present -->
<_ResolvedManagedBinary Include="@(ResolvedFileToPublish)"
                        Condition="'%(ResolvedFileToPublish.PostprocessAssembly)' == 'true' ..." />
<ManagedBinary Condition="'@(_ResolvedManagedBinary)' != ''" Include="@(_ResolvedManagedBinary)" />
<ManagedBinary Condition="'@(_ResolvedManagedBinary)' == ''" Include="@(IntermediateAssembly)" />

Copilot AI self-assigned this Apr 29, 2026
Copilot AI review requested due to automatic review settings April 29, 2026 18:42
Copilot AI review requested due to automatic review settings April 29, 2026 18:42
@github-actions github-actions Bot added the area-Tools-ILLink .NET linker development as well as trimming analyzers label Apr 29, 2026
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @dotnet/illink
See info in area-owners.md if you want to be subscribed.

Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/7ed4b310-ac69-4948-a79e-5626cfc57a13

Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot April 29, 2026 19:12
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/7ed4b310-ac69-4948-a79e-5626cfc57a13

Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot April 29, 2026 19:16
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/7ed4b310-ac69-4948-a79e-5626cfc57a13

Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[NativeAOT] IlcCompileInput ignores ILLink output when RunILLink=true

2 participants