`Microsoft.DotNet.Cli.Utils.csproj` is built twice causing PDB mismatch on some platforms
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
@baronfel - This is affecting our 8.0 distro maintainers. Is this something you or someone from the container area can investigate? TIA
@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.
Friendly ping, Is there any update on when this will get fixed.
Offline suggestion was to add PublishDir to GlobalPropertiesToRemove on all MSBuild calls in GenerateLayouts.targets
@surayya-MS Any progress here? Does the copilot PR solve this and is sufficient?
@NikolaMilosavljevic - thoughts on the copilot PR?
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.
I signed off on the PR--current main (this is a recent PR build, arm64 linux) runs CoreCompile in that project multiple times
but this one does it once