Skip to content

Commit

Permalink
Fix PDBs in dbgshim packages (#3122)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoyosjs authored Jun 15, 2022
1 parent a7b35e8 commit a513fed
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 54 deletions.
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
},
"msbuild-sdks": {
"Microsoft.Build.NoTargets": "2.0.1",
"Microsoft.Build.NoTargets": "3.5.0",
"Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22313.1"
}
}
1 change: 1 addition & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<DebugType>portable</DebugType>
</PropertyGroup>

<Import Project="$(RepositoryEngineeringDir)native\naming.props" />
<Import Condition="'$(DotNetBuildFromSource)' != 'true'"
Project="$(RepositoryEngineeringDir)Analyzers.props" />
</Project>
39 changes: 7 additions & 32 deletions src/dbgshim/pkg/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,43 +1,18 @@
<Project>
<Import Project="$(MSBuildThisFileDirectory)..\..\Directory.Build.props"/>

<PropertyGroup>
<IsShipping>true</IsShipping>
<NoPackageAnalysis>true</NoPackageAnalysis>
<PackageDescription>Internal implementation package not meant for direct consumption. Please do not reference directly.</PackageDescription>
<ExeSuffix Condition="$(PackageRID.StartsWith('win'))">.exe</ExeSuffix>
<OsFolderName Condition="$(PackageRID.StartsWith('win'))">Windows_NT</OsFolderName>
<OsFolderName Condition="$(PackageRID.StartsWith('linux-musl'))">Linux-musl</OsFolderName>
<OsFolderName Condition="$(PackageRID.StartsWith('linux')) and '$(OsFolderName)' == ''">Linux</OsFolderName>
<OsFolderName Condition="$(PackageRID.StartsWith('osx'))">OSX</OsFolderName>
</PropertyGroup>

<Choose>
<When Condition="$(OutputRid.StartsWith('win'))">
<PropertyGroup>
<OsFolderName>Windows_NT</OsFolderName>
<ExeSuffix>.exe</ExeSuffix>
<LibSuffix>.dll</LibSuffix>
<StaticLibSuffix>.lib</StaticLibSuffix>
<SymbolsSuffix>.pdb</SymbolsSuffix>
</PropertyGroup>
</When>
<When Condition="$(OutputRid.StartsWith('osx'))">
<PropertyGroup>
<OsFolderName>OSX</OsFolderName>
<LibPrefix>lib</LibPrefix>
<LibSuffix>.dylib</LibSuffix>
<StaticLibSuffix>.a</StaticLibSuffix>
<SymbolsSuffix>.dwarf</SymbolsSuffix>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<OsFolderName>Linux</OsFolderName>
<OsFolderName Condition="$(OutputRid.StartsWith('linux-musl'))">Linux-musl</OsFolderName>
<LibPrefix>lib</LibPrefix>
<LibSuffix>.so</LibSuffix>
<StaticLibSuffix>.a</StaticLibSuffix>
<SymbolsSuffix>.dbg</SymbolsSuffix>
</PropertyGroup>
</Otherwise>
</Choose>

<PropertyGroup>
<NativeBinDir>$(ArtifactsBinDir)\$(OsFolderName).$(PackageArch).$(Configuration)\</NativeBinDir>
<NativeBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', '$(OsFolderName).$(PackageArch).$(Configuration)'))</NativeBinDir>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<OutputRid>linux-arm</OutputRid>
<PackageRID>linux-arm</PackageRID>
<PackageArch>arm</PackageArch>
</PropertyGroup>
<Import Project="Microsoft.Diagnostics.DbgShim.props" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<OutputRid>linux-arm64</OutputRid>
<PackageRID>linux-arm64</PackageRID>
<PackageArch>arm64</PackageArch>
</PropertyGroup>
<Import Project="Microsoft.Diagnostics.DbgShim.props" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<OutputRid>linux-musl-x64</OutputRid>
<PackageRID>linux-musl-x64</PackageRID>
<PackageArch>x64</PackageArch>
</PropertyGroup>
<Import Project="Microsoft.Diagnostics.DbgShim.props" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<OutputRid>linux-musl-x64</OutputRid>
<PackageRID>linux-musl-x64</PackageRID>
<PackageArch>x64</PackageArch>
</PropertyGroup>
<Import Project="Microsoft.Diagnostics.DbgShim.props" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<OutputRid>linux-x64</OutputRid>
<PackageRID>linux-x64</PackageRID>
<PackageArch>x64</PackageArch>
</PropertyGroup>
<Import Project="Microsoft.Diagnostics.DbgShim.props" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<OutputRid>osx-arm64</OutputRid>
<PackageRID>osx-arm64</PackageRID>
<PackageArch>arm64</PackageArch>
</PropertyGroup>
<Import Project="Microsoft.Diagnostics.DbgShim.props" />
Expand Down
2 changes: 1 addition & 1 deletion src/dbgshim/pkg/Microsoft.Diagnostics.DbgShim.osx-x64.proj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<OutputRid>osx-x64</OutputRid>
<PackageRID>osx-x64</PackageRID>
<PackageArch>x64</PackageArch>
</PropertyGroup>
<Import Project="Microsoft.Diagnostics.DbgShim.props" />
Expand Down
22 changes: 12 additions & 10 deletions src/dbgshim/pkg/Microsoft.Diagnostics.DbgShim.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<!-- IncludeBuildOutput needs to be set to true to make NuGet include the passed in debug symbol files. -->
<IncludeBuildOutput>false</IncludeBuildOutput>
<IncludeBuildOutput>true</IncludeBuildOutput>
<IncludeSymbols>true</IncludeSymbols>
<IsPackable>true</IsPackable>
<AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>$(SymbolsSuffix)</AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>
Expand All @@ -16,20 +16,22 @@

<ItemGroup>
<None Include="$(NativeBinDir)$(LibPrefix)dbgshim$(LibSuffix)"
PackagePath="runtimes/$(OutputRid)/native"
PackagePath="runtimes/$(PackageRID)/native"
Pack="true" />
</ItemGroup>

<Target Name="AddRuntimeSpecificNativeSymbolToPackage">
<ItemGroup>
<TfmSpecificDebugSymbolsFile Condition="$(OutputRid.StartsWith('win'))"
Include="$(NativeBinDir)PDB\$(LibPrefix)dbgshim$(SymbolsSuffix)"
TargetPath="/runtimes/$(OutputRid)/native"
TargetFramework="$(TargetFramework)" />
<PropertyGroup>
<_SymbolFilePath>$([MSBuild]::NormalizePath('$(NativeBinDir)', '$(LibPrefix)dbgshim$(LibSuffix)$(SymbolsSuffix)'))</_SymbolFilePath>
<_SymbolFilePath Condition="$(PackageRID.StartsWith('win'))">$([MSBuild]::NormalizePath('$(NativeBinDir)', 'PDB', '$(LibPrefix)dbgshim$(SymbolsSuffix)'))</_SymbolFilePath>
</PropertyGroup>

<TfmSpecificDebugSymbolsFile Condition="!$(OutputRid.StartsWith('win'))"
Include="$(NativeBinDir)$(LibPrefix)dbgshim$(LibSuffix)$(SymbolsSuffix)"
TargetPath="/runtimes/$(OutputRid)/native"
<Error Condition="!Exists('$(_SymbolFilePath)')"
Text="Symbol file to package not found at: $(_SymbolFilePath)"/>

<ItemGroup>
<TfmSpecificDebugSymbolsFile Include="$(_SymbolFilePath)"
TargetPath="/runtimes/$(PackageRID)/native"
TargetFramework="$(TargetFramework)" />
</ItemGroup>
</Target>
Expand Down
2 changes: 1 addition & 1 deletion src/dbgshim/pkg/Microsoft.Diagnostics.DbgShim.win-arm.proj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<OutputRid>win-arm</OutputRid>
<PackageRID>win-arm</PackageRID>
<PackageArch>arm</PackageArch>
</PropertyGroup>
<Import Project="Microsoft.Diagnostics.DbgShim.props" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<OutputRid>win-arm64</OutputRid>
<PackageRID>win-arm64</PackageRID>
<PackageArch>arm64</PackageArch>
</PropertyGroup>
<Import Project="Microsoft.Diagnostics.DbgShim.props" />
Expand Down
2 changes: 1 addition & 1 deletion src/dbgshim/pkg/Microsoft.Diagnostics.DbgShim.win-x64.proj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<OutputRid>win-x64</OutputRid>
<PackageRID>win-x64</PackageRID>
<PackageArch>x64</PackageArch>
</PropertyGroup>
<Import Project="Microsoft.Diagnostics.DbgShim.props" />
Expand Down
2 changes: 1 addition & 1 deletion src/dbgshim/pkg/Microsoft.Diagnostics.DbgShim.win-x86.proj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<OutputRid>win-x86</OutputRid>
<PackageRID>win-x86</PackageRID>
<PackageArch>x86</PackageArch>
</PropertyGroup>
<Import Project="Microsoft.Diagnostics.DbgShim.props" />
Expand Down

0 comments on commit a513fed

Please sign in to comment.