sdk icon indicating copy to clipboard operation
sdk copied to clipboard

`Microsoft.DotNet.Cli.Utils.csproj` is built twice causing PDB mismatch on some platforms

Open NikolaMilosavljevic opened this issue 1 year ago • 5 comments

This issue is causing a failure in source-build, on s390x platform. On other platforms, i.e. x64, there is no PDB mismatch at the moment, but that can happen at any time with a change in compiler or other toolset dependency.

Each project should only be built once. Microsoft.DotNet.Cli.Utils.csproj gets built the second time, as a reference in Microsoft.NET.Build.Containers.csproj project.

According to @rainersigwald (https://github.com/dotnet/source-build/issues/4150#issuecomment-2397852662) this happens because GenerateLayout.targets is calling the publish with an additional PublishDir global property that breaks it out from the "normal" reference and causes project to be built again: https://github.com/dotnet/sdk/blob/e89072b5f36b1821dc24987a5a487ba0093ef9f4/src/Layout/redist/targets/GenerateLayout.targets#L215-L219

Original issue has relevant binlogs.

@baronfel, @omajid

NikolaMilosavljevic avatar Oct 09 '24 16:10 NikolaMilosavljevic

@baronfel - This is affecting our 8.0 distro maintainers. Is this something you or someone from the container area can investigate? TIA

MichaelSimons avatar Oct 16 '24 14:10 MichaelSimons

@surayya-MS may be able to take this after she finishes the multi-arch containers work that she's currently working on. Will need to coordinate with @donJoseLuis.

baronfel avatar Oct 16 '24 14:10 baronfel

Friendly ping, Is there any update on when this will get fixed.

MichaelSimons avatar May 07 '25 16:05 MichaelSimons

Offline suggestion was to add PublishDir to GlobalPropertiesToRemove on all MSBuild calls in GenerateLayouts.targets

marcpopMSFT avatar May 21 '25 20:05 marcpopMSFT

@surayya-MS Any progress here? Does the copilot PR solve this and is sufficient?

marcpopMSFT avatar Jun 18 '25 22:06 marcpopMSFT

@NikolaMilosavljevic - thoughts on the copilot PR?

leecow avatar Jul 16 '25 15:07 leecow

Has anyone, i.e. project owners, confirmed that the PR solves the issue? Some other project references are being updated as well. It would be good for someone with domain knowledge to review it.

NikolaMilosavljevic avatar Jul 16 '25 20:07 NikolaMilosavljevic

I signed off on the PR--current main (this is a recent PR build, arm64 linux) runs CoreCompile in that project multiple times

Image

but this one does it once

Image

rainersigwald avatar Jul 16 '25 21:07 rainersigwald