Microsoft.Interop.SourceGeneration gets built twice (with a potential of a race)

Open
#111,654 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Tech stack
csharp
Domain
build-system

Research direction

Start by examining the build output for Microsoft.Interop.SourceGeneration and DownlevelLibraryImportGenerator, then trace the build entry points that schedule those projects. Compare the repeated Microsoft.Interop.SourceGeneration and DownlevelLibraryImportGenerator entries and determine whether duplicate scheduling can race. Done means each project is built only once in the relevant build sequence.

Written by the indexing model from the issue text.

Description

area-System.Runtime.InteropServices source-generator tenet-build-performance
  installer.tasks -> C:\git\runtime4\artifacts\bin\installer.tasks\Debug\net10.0\installer.tasks.dll
  Crossgen2Tasks -> C:\git\runtime4\artifacts\bin\Crossgen2Tasks\Debug\net10.0\Crossgen2Tasks.dll
  Microsoft.Interop.SourceGeneration -> C:\git\runtime4\artifacts\bin\Microsoft.Interop.SourceGeneration\Debug\netstandard2.0\Microsoft.Interop.SourceGeneration.dll
  DownlevelLibraryImportGenerator -> C:\git\runtime4\artifacts\bin\DownlevelLibraryImportGenerator\Debug\netstandard2.0\Microsoft.Interop.LibraryImportGenerator.Downle
  vel.dll
  installer.tasks -> C:\git\runtime4\artifacts\bin\installer.tasks\Debug\net472\installer.tasks.dll
  ILLink.RoslynAnalyzer -> C:\git\runtime4\artifacts\bin\ILLink.RoslynAnalyzer\Debug\netstandard2.0\ILLink.RoslynAnalyzer.dll
  ILLink.CodeFixProvider -> C:\git\runtime4\artifacts\bin\ILLink.CodeFixProvider\Debug\netstandard2.0\ILLink.CodeFixProvider.dll
  Mono.Linker -> C:\git\runtime4\artifacts\bin\Mono.Linker\ref\Debug\net10.0\illink.dll
  Mono.Linker -> C:\git\runtime4\artifacts\bin\Mono.Linker\Debug\net10.0\illink.dll
  ILLink.Tasks -> C:\git\runtime4\artifacts\bin\ILLink.Tasks\Debug\net\ILLink.Tasks.dll
  System.Private.CoreLib.Generators -> C:\git\runtime4\artifacts\bin\System.Private.CoreLib.Generators\Debug\netstandard2.0\System.Private.CoreLib.Generators.dll
  System.Private.CoreLib -> C:\git\runtime4\artifacts\bin\System.Private.CoreLib\ref\Debug\net10.0\System.Private.CoreLib.dll
  Microsoft.Interop.SourceGeneration -> C:\git\runtime4\artifacts\bin\Microsoft.Interop.SourceGeneration\Debug\netstandard2.0\Microsoft.Interop.SourceGeneration.dll
  LibraryImportGenerator -> C:\git\runtime4\artifacts\bin\LibraryImportGenerator\Debug\netstandard2.0\Microsoft.Interop.LibraryImportGenerator.dll

and the build then later yet again builds the DownlevelLibraryImportGenerator project:

  BUILD: Product binaries are available at C:\git\runtime4\artifacts\bin\coreclr\linux.x64.Debug\x64
  runincontext -> C:\git\runtime4\artifacts\bin\coreclr\windows.x64.Debug\runincontext.dll
  tieringtest -> C:\git\runtime4\artifacts\bin\coreclr\windows.x64.Debug\tieringtest.dll
  DownlevelLibraryImportGenerator -> C:\git\runtime4\artifacts\bin\DownlevelLibraryImportGenerator\Debug\netstandard2.0\Microsoft.Interop.LibraryImportGenerator.Downle
  vel.dll
  ILCompiler.TypeSystem -> C:\git\runtime4\artifacts\bin\ILCompiler.TypeSystem\x64\Debug\ILCompiler.TypeSystem.dll

cc @jkoritzinsky

Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/runtime

All issues in dotnet/runtime

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.