From 5732e8a36bfde78fcff65ee20aa60d067004578d Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 7 Oct 2026 21:08:22 +0000 Subject: [PATCH 1/4] Remove MoveSymbolFiles PDB consolidation and read CoreLib PDB from its natural location The MoveSymbolFiles target in src/coreclr/Directory.Build.targets copied every managed project's PDB into a single flattened $(RuntimeBinDir)PDB\ folder after each build. Besides being unnecessary busywork for the ~25 projects whose PDBs are copied there but never consumed from that location, this consolidation caused a real bug: projects with multiple build variants that share an assembly name (e.g. crossgen2's normal and published builds) would race to overwrite each other's PDB in the shared folder, so the PDB left behind in PDB\ did not necessarily match the DLL actually shipped. The only real consumer of this folder, eng/liveBuilds.targets' ResolveRuntimeFilesFromLocalBuild target (used when other subsets assemble the shared framework from an already-built clr subset), only ever looked up System.Private.CoreLib.pdb and System.Private.CoreLib.ni.pdb from it. - System.Private.CoreLib.ni.pdb is already written directly to the PDB\ folder by crossgen-corelib.proj, independent of MoveSymbolFiles. - System.Private.CoreLib.pdb (the managed/IL PDB) is produced by CoreLib's own compile and naturally lands at $(RuntimeBinDir)IL\System.Private.CoreLib.pdb, identical to the copy MoveSymbolFiles produced. This change removes the MoveSymbolFiles target and its associated item group entirely, and updates ResolveRuntimeFilesFromLocalBuild to read the managed CoreLib PDB directly from its natural IL\ location (mirroring the existing DLL fallback already present in that target), removing the need for the copy mechanism altogether. Validated by rebuilding the clr subset (no errors, no behavior change for consumers of the shared framework) and by directly invoking AddRuntimeFilesToPackage on Microsoft.NETCore.App.Runtime.CoreCLR.sfxproj, confirming System.Private.CoreLib.pdb resolves correctly from its natural location. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 099eec3c-119a-4097-8071-6cd952af9e7c --- eng/liveBuilds.targets | 4 ++-- src/coreclr/Directory.Build.targets | 25 ------------------------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index da24977023c101..5eb449bee25305 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -124,8 +124,8 @@ $(CoreCLRSharedFrameworkPdbDir)*.pdb; $(CoreCLRSharedFrameworkPdbDir)*.dbg; $(CoreCLRSharedFrameworkPdbDir)*.dwarf" IsNative="true" /> - + diff --git a/src/coreclr/Directory.Build.targets b/src/coreclr/Directory.Build.targets index 1241d0bb5d79f1..e243c161155d20 100644 --- a/src/coreclr/Directory.Build.targets +++ b/src/coreclr/Directory.Build.targets @@ -2,31 +2,6 @@ - - <_DebugSymbolToMove Include="@(DebugSymbolsProjectOutputGroupOutput->Metadata('FinalOutputPath'))" - FolderName="$([System.IO.Directory]::GetParent('%(Identity)').Name)" /> - <_DebugSymbolToMoveToExclude Include="@(_DebugSymbolToMove->WithMetadataValue('FolderName', 'aotsdk'))" /> - <_DebugSymbolToMoveToUpdate Include="@(_DebugSymbolToMove)" - Exclude="@(_DebugSymbolToMoveToExclude)" /> - - <_DebugSymbolToMove Update="@(_DebugSymbolToMoveToUpdate)" - FolderName="" /> - <_DebugSymbolToMove Update="@(_DebugSymbolToMove)" - Destination="$(RuntimeBinDir)PDB\%(FolderName)\%(Filename)%(Extension)" /> - - - - - - - From 32a23e47fd41aa783b82029314059971d163049c Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 8 Oct 2026 20:35:18 +0000 Subject: [PATCH 2/4] Fix NU5118 pack collision for System.Private.CoreLib.pdb on Windows The IL/System.Private.CoreLib.pdb and IL/System.Private.CoreLib.dll paths used a literal forward slash, producing a different string than the backslash-separated path the SharedFramework SDK's symbol-file discovery reconstructs via %(RootDir)%(Directory)%(FileName)%(Extension) for every ReferenceCopyLocalPaths item on Windows. Because MSBuild's RemoveDuplicates compares raw ItemSpec strings without normalizing separators, the two equivalent-but-differently-spelled paths were not deduplicated, causing NuGet to reject the second add with NU5118. Introduce CoreCLRArtifactsILDir, built with [MSBuild]::NormalizeDirectory like the existing CoreCLRArtifactsPdbDir, and use it for both the CoreLib DLL fallback and PDB RuntimeFiles entries so the resolved paths are consistently separator-normalized. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 099eec3c-119a-4097-8071-6cd952af9e7c --- eng/liveBuilds.targets | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index 5eb449bee25305..7f889f58dc7230 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -85,6 +85,7 @@ $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)')) $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)','PDB')) + $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)','IL')) - + + From 9f2fd22733d5d5a16fd49df4925fd0dd9e86f483 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 8 Oct 2026 22:14:55 +0000 Subject: [PATCH 4/4] Escape semicolon in _NT_SYMBOL_PATH HelixPreCommand A literal ';' inside an MSBuild Include attribute is the item-list separator, so the previous commit's _NT_SYMBOL_PATH value was split into two HelixPreCommand items: the 'set' command ending at '\PDB', and a second command consisting of just the '\IL' path, which Helix would try to execute directly instead of using it as the second symbol search directory. Escape the separator as %3B, matching the existing precedent in src/libraries/sendtohelix-browser.targets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 099eec3c-119a-4097-8071-6cd952af9e7c --- src/tests/Common/helixpublishwitharcade.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/Common/helixpublishwitharcade.proj b/src/tests/Common/helixpublishwitharcade.proj index 939e1bdffead06..2a40068ba628bb 100644 --- a/src/tests/Common/helixpublishwitharcade.proj +++ b/src/tests/Common/helixpublishwitharcade.proj @@ -641,7 +641,7 @@ - +