Skip to content

Commit

Permalink
Use "portable" PDB files (xamarin#758)
Browse files Browse the repository at this point in the history
Context: https://github.com/dotnet/core/blob/79c19c12ab2bc11912551bb0c3025f602cd541d9/Documentation/diagnostics/portable_pdb.md

In doing some performance testing with builds in VS 2019, I noticed:

    115 ms  _ConvertPdbFiles                           1 calls

And looking at files were converted:

    ConvertDebuggingFiles
        Parameters
            Files
                C:\ProgramData\Xamarin\NuGet\xamarin.essentials\1.0.1\lib\monoandroid81\Xamarin.Essentials.pdb
        [Output] ConvertedFiles:
            C:\ProgramData\Xamarin\NuGet\xamarin.essentials\1.0.1\lib\monoandroid81\Xamarin.Essentials.dll

The Xamarin.Essentials NuGet package is shipping a non-portable PDB
file. This is a Windows-specific format that Mono doesn't support.

Xamarin.Android runs a tool called `pdb2mdb` when it encounters a
non-portable PDB file so symbols be converted to something that Mono
can use. If you have `DebugType=full` or `DebugType=pdbonly`,
Xamarin.Android has to do this extra work to convert it.

I see no drawbacks to just use `DebugType=portable` in this project
all the time?

Since Xamarin.Essentials uses sourcelink, I double-checked and they
support portable PDBs:

https://github.com/dotnet/sourcelink#prerequisites-for-net-projects

I sent a similar PR to Xamarin.Forms, shipping since 3.4. I wrote a
bit more detail on symbol files there if you need more info:

xamarin/Xamarin.Forms#4201
  • Loading branch information
jonathanpeppers authored and Schilli, Niklas committed Aug 28, 2019
1 parent d09ab7d commit 1d34895
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions Xamarin.Essentials/Xamarin.Essentials.csproj
Expand Up @@ -32,26 +32,19 @@
<PackageProjectUrl>https://go.microsoft.com/fwlink/?linkid=868960</PackageProjectUrl>
<MDocDocumentationDirectory>$(MSBuildThisFileDirectory)..\docs\en</MDocDocumentationDirectory>
<Configurations>Debug;Release;Samples;Docs</Configurations>
<DebugType>portable</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Samples'">
<DebugType>pdbonly</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)'=='Debug' ">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)'=='Release' And '$(OS)' == 'Windows_NT' ">
<DebugType>pdbonly</DebugType>
<!-- sourcelink: Declare that the Repository URL can be published to NuSpec -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- sourcelink: Embed source files that are not tracked by the source control manager to the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!-- sourcelink: Include PDB in the built .nupkg -->
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)'=='Docs' ">
<DebugType>pdbonly</DebugType>
</PropertyGroup>
<ItemGroup Condition=" '$(Configuration)'=='Release' And '$(OS)' == 'Windows_NT' ">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-63127-02" PrivateAssets="All" />
</ItemGroup>
Expand Down

0 comments on commit 1d34895

Please sign in to comment.