Skip to content

Comments

Move _LinkedResolvedFileToPublishCandidate computation to after PrepareForILLink#124812

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/ensure-metadata-flows-downstream
Draft

Move _LinkedResolvedFileToPublishCandidate computation to after PrepareForILLink#124812
Copilot wants to merge 2 commits intomainfrom
copilot/ensure-metadata-flows-downstream

Conversation

Copy link
Contributor

Copilot AI commented Feb 24, 2026

_LinkedResolvedFileToPublishCandidate was computed inside _ComputeManagedAssemblyToLink, before PrepareForILLink runs. Per-assembly metadata added to ManagedAssemblyToLink by PrepareForILLink (or targets hooking in via BeforeTargets/AfterTargets) was therefore lost and never flowed through to ResolvedFileToPublish.

Changes

  • New _ComputeLinkedResolvedFileToPublishCandidate target (DependsOnTargets="PrepareForILLink") — moves the _LinkedResolvedFileToPublishCandidate ItemGroup computation to after PrepareForILLink and all its hooks have run, so item metadata is captured correctly.
  • _RunILLink DependsOnTargets updated from _ComputeManagedAssemblyToLink;PrepareForILLink to _ComputeLinkedResolvedFileToPublishCandidate; all prior dependencies are transitively covered.

Target execution order (after fix)

  1. _ComputeManagedAssemblyToLink (+ AfterTargets hooks, e.g. NativeAOT's _ComputeManagedAssemblyForILLink)
  2. PrepareForILLink (+ BeforeTargets/AfterTargets hooks adding per-assembly metadata)
  3. _ComputeLinkedResolvedFileToPublishCandidate ← new; sees fully-annotated ManagedAssemblyToLink
  4. _RunILLinkILLinkResolvedFileToPublish populated with correct metadata

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…reForILLink

Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
@dotnet-policy-service dotnet-policy-service bot added the linkable-framework Issues associated with delivering a linker friendly framework label Feb 24, 2026
Copilot AI changed the title [WIP] Ensure per-assembly metadata flows to ResolvedFileToPublish Move _LinkedResolvedFileToPublishCandidate computation to after PrepareForILLink Feb 24, 2026
@github-actions github-actions bot added the area-Tools-ILLink .NET linker development as well as trimming analyzers label Feb 24, 2026
@dotnet-policy-service
Copy link
Contributor

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

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 linkable-framework Issues associated with delivering a linker friendly framework

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants