Avoid having two copies of System.Private.CoreLib.ni.pdb in the same NuGet package...
authorAnton Lapounov <antonl@microsoft.com>
Sun, 23 Aug 2020 00:14:58 +0000 (17:14 -0700)
committerGitHub <noreply@github.com>
Sun, 23 Aug 2020 00:14:58 +0000 (17:14 -0700)
eng/liveBuilds.targets
src/installer/pkg/projects/netcoreapp/pkg/Microsoft.NETCore.App.Crossgen2.pkgproj

index f6e1053..5135de0 100644 (file)
 
     <PropertyGroup Condition="'$(RuntimeFlavor)' == 'CoreCLR'">
       <CoreCLRArtifactsPath>$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)'))</CoreCLRArtifactsPath>
+      <CoreCLRArtifactsPdbDir>$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)','PDB'))</CoreCLRArtifactsPdbDir>
       <!--
         Even though CoreCLRSharedFrameworkDir is statically initialized, set it again in case the
         value is different after CoreCLRArtifactsPath is normalized.
       -->
       <CoreCLRSharedFrameworkDir>$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)','sharedFramework'))</CoreCLRSharedFrameworkDir>
+      <CoreCLRSharedFrameworkPdbDir>$([MSBuild]::NormalizeDirectory('$(CoreCLRSharedFrameworkDir)','PDB'))</CoreCLRSharedFrameworkPdbDir>
       <CoreCLRCrossTargetComponentDir
         Condition="'$(CoreCLRCrossTargetComponentDirName)' != ''">$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)','$(CoreCLRCrossTargetComponentDirName)','sharedFramework'))</CoreCLRCrossTargetComponentDir>
     </PropertyGroup>
       <RuntimeFiles Include="@(_systemPrivateCoreLib)" />
       <RuntimeFiles
         Include="
-          $(CoreCLRSharedFrameworkDir)PDB/*.pdb;
-          $(CoreCLRSharedFrameworkDir)PDB/*.dbg;
-          $(CoreCLRSharedFrameworkDir)PDB/*.dwarf" />
+          $(CoreCLRSharedFrameworkPdbDir)*.pdb;
+          $(CoreCLRSharedFrameworkPdbDir)*.dbg;
+          $(CoreCLRSharedFrameworkPdbDir)*.dwarf" />
       <RuntimeFiles
-        Include="$(CoreCLRArtifactsPath)PDB/System.Private.CoreLib.pdb;" />
-      <RuntimeFiles Condition="Exists('$(CoreCLRArtifactsPath)PDB/System.Private.CoreLib.ni.pdb')"
-        Include="$(CoreCLRArtifactsPath)PDB/System.Private.CoreLib.ni.pdb" />
+        Include="$(CoreCLRArtifactsPdbDir)System.Private.CoreLib.pdb" />
+      <RuntimeFiles Condition="Exists('$(CoreCLRArtifactsPdbDir)System.Private.CoreLib.ni.pdb')"
+        Include="$(CoreCLRArtifactsPdbDir)System.Private.CoreLib.ni.pdb" />
+
       <CoreCLRCrossTargetFiles Condition="'$(CoreCLRCrossTargetComponentDir)' != ''"
         Include="
-          $(CoreCLRCrossTargetComponentDir)PDB/*.pdb;
-          $(CoreCLRCrossTargetComponentDir)PDB/*.dbg;
-          $(CoreCLRCrossTargetComponentDir)PDB/*.dwarf" />
+          $(CoreCLRSharedFrameworkPdbDir)*.pdb;
+          $(CoreCLRSharedFrameworkPdbDir)*.dbg;
+          $(CoreCLRSharedFrameworkPdbDir)*.dwarf" />
 
       <CoreCLRCrossTargetFiles>
         <TargetPath>runtime/$(CoreCLRCrossTargetComponentDirName)_$(TargetArchitecture)/native</TargetPath>
index d652108..60b592d 100644 (file)
     </MSBuild>
 
     <ItemGroup>
-      <File Include="@(Crossgen2File)">
+      <!-- Avoid having two copies of System.Private.CoreLib.ni.pdb in the same directory -->
+      <Crossgen2File Update="@(Crossgen2File)" SavedIdentity="%(Identity)" />
+      <Crossgen2FileDistinct Include="@(Crossgen2File->'%(Filename)%(Extension)'->Distinct())" />
+
+      <File Include="@(Crossgen2FileDistinct->'%(SavedIdentity)')" RemoveMetadata="SavedIdentity">
         <TargetPath>tools</TargetPath>
       </File>
       <!--