Skip to content

Migrate GenerateReferencesStep from ILLink pipeline#24914

Draft
sbomer wants to merge 1 commit intodotnet:mainfrom
sbomer:generate-references
Draft

Migrate GenerateReferencesStep from ILLink pipeline#24914
sbomer wants to merge 1 commit intodotnet:mainfrom
sbomer:generate-references

Conversation

@sbomer
Copy link
Member

@sbomer sbomer commented Mar 18, 2026

...to standalone MSBuild task

Move native symbol reference generation out of the ILLink trimmer pipeline into a standalone MSBuild task (GenerateReferencesTask) that runs after _LoadLinkerOutput. This removes one more ILLink API dependency from the build pipeline.

  • ListExportedSymbols now writes collected symbols as _RequiredNativeReference .items files so they survive the ILLink -> MSBuild boundary
  • New GenerateReferencesTask in Xamarin.MacDev.Tasks reads these items and produces _ReferencesFile (Code mode) or _ProcessedReferenceNativeSymbol (Linker mode) output, matching the old step's behavior
  • New _GenerateReferences target wired between _LoadLinkerOutput and _CompileNativeExecutable in the build dependency chain
  • Add 16 unit tests covering all modes, symbol filtering, error handling, incremental builds, and symbol name processing

…uild task

Move native symbol reference generation out of the ILLink trimmer pipeline
into a standalone MSBuild task (GenerateReferencesTask) that runs after
_LoadLinkerOutput. This removes one more ILLink API dependency from the
build pipeline.

- ListExportedSymbols now writes collected symbols as _RequiredNativeReference
  .items files so they survive the ILLink -> MSBuild boundary
- New GenerateReferencesTask in Xamarin.MacDev.Tasks reads these items and
  produces _ReferencesFile (Code mode) or _ProcessedReferenceNativeSymbol
  (Linker mode) output, matching the old step's behavior
- New _GenerateReferences target wired between _LoadLinkerOutput and
  _CompileNativeExecutable in the build dependency chain
- Add 16 unit tests covering all modes, symbol filtering, error handling,
  incremental builds, and symbol name processing
@rolfbjarne
Copy link
Member

@sbomer this looks like it'll get redundant once #24888 (and a few other upcoming pull requests I have in progress) have been completed - in fact I'm working on removing all custom linker steps this spring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants