From c96908f25ce38f485bcbbc3c785f2885df13d01f Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Wed, 22 Mar 2017 12:13:52 -0400 Subject: [PATCH] [bundle] Include mono's debug symbols Microsoft has (several?) [symbol servers][0], which is a repository "somewhere" which contains debug symbols, so that when a stack trace containing e.g. BCL stack frames is sent to Microsoft, there is a way to correlate that back to filename and line number source for further investigation. Xamarin.Android has not partaken in this mechanism, in large part because we did most of our building on Linux and macOS machines which generate `.mdb` debug symbols, while symbol servers require `.pdb`. That constraint is now behind us; with 76be1fb1 and the use of Mono 4.9 for builds, our builds now generate Portable `.pdb` files, which *should* (hopefully) be usable on Microsoft's symbol servers. However, to transmit them to Microsoft's servers, we need to actually *retain* them. At present, they're not: because of `bundle*.zip` use, the `mscorlib.dll` that we include in the final product may have been built much earlier than the rest of the product, and we don't have any other mechanism to retain the `mscorlib.pdb` file. Let's change that: update `mono-runtimes.targets` so that the created debug symbol files are included in the produced `bundle*.zip`, and bump the corresponding `$(XABundleFileName)` version number. This will ensure that we retain the debug symbols for our BCL assemblies, allowing us to actually have something to upload. [0]: https://msdn.microsoft.com/en-us/library/cc667410.aspx --- build-tools/bundle/bundle-path.targets | 2 +- .../mono-runtimes/mono-runtimes.targets | 109 +++++++++++++----- 2 files changed, 82 insertions(+), 29 deletions(-) diff --git a/build-tools/bundle/bundle-path.targets b/build-tools/bundle/bundle-path.targets index 7b03d8c7119..7dfcc9e4226 100644 --- a/build-tools/bundle/bundle-path.targets +++ b/build-tools/bundle/bundle-path.targets @@ -24,7 +24,7 @@ - bundle-v12-$(Configuration)-$(HostOS)-libzip=$(_LibZipHash),llvm=$(_LlvmHash),mono=$(_MonoHash).zip + bundle-v13-$(Configuration)-$(HostOS)-libzip=$(_LibZipHash),llvm=$(_LlvmHash),mono=$(_MonoHash).zip diff --git a/build-tools/mono-runtimes/mono-runtimes.targets b/build-tools/mono-runtimes/mono-runtimes.targets index a94e5227e3b..f73dde1dfdf 100644 --- a/build-tools/mono-runtimes/mono-runtimes.targets +++ b/build-tools/mono-runtimes/mono-runtimes.targets @@ -11,11 +11,11 @@ @@ -51,7 +51,7 @@ _InstallBcl; _InstallCilStrip; _InstallMonoDoc; - _InstallMonoSymbolicate; + _InstallMonoUtilities; _ConfigureCrossRuntimes; _BuildCrossRuntimes; _InstallCrossRuntimes; @@ -62,12 +62,57 @@ <_BclAssembly Include="@(MonoProfileAssembly)" /> + <_BclExcludeDebugSymbols Include="System.Windows.dll" /> + <_BclExcludeDebugSymbols Include="System.Xml.Serialization.dll" /> <_BclProfileItems Include="@(_BclAssembly->'$(_MonoProfileDir)\%(Identity)')" /> + <_BclProfileItems + Condition=" '$(_DebugFileExt)' == '.mdb' " + Include="@(_BclAssembly->'$(_MonoProfileDir)\%(Identity).mdb')" + Exclude="@(_BclExcludeDebugSymbols->'$(_MonoProfileDir)\%(Identity).mdb')" + /> + <_BclProfileItems + Condition=" '$(_DebugFileExt)' == '.pdb' " + Include="@(_BclAssembly->'$(_MonoProfileDir)\%(Filename).pdb')" + Exclude="@(_BclExcludeDebugSymbols->'$(_MonoProfileDir)\%(Filename).pdb')" + /> <_BclInstalledItem Include="@(_BclAssembly->'$(OutputPath)\lib\xbuild-frameworks\MonoAndroid\v1.0\%(Identity)')" /> + <_BclInstalledItem + Condition=" '$(_DebugFileExt)' == '.mdb' " + Include="@(_BclAssembly->'$(OutputPath)\lib\xbuild-frameworks\MonoAndroid\v1.0\%(Identity).mdb')" + Exclude="@(_BclExcludeDebugSymbols->'$(OutputPath)\lib\xbuild-frameworks\MonoAndroid\v1.0\%(Identity).mdb')" + /> + <_BclInstalledItem + Condition=" '$(_DebugFileExt)' == '.pdb' " + Include="@(_BclAssembly->'$(OutputPath)\lib\xbuild-frameworks\MonoAndroid\v1.0\%(Filename).pdb')" + Exclude="@(_BclExcludeDebugSymbols->'$(OutputPath)\lib\xbuild-frameworks\MonoAndroid\v1.0\%(Filename).pdb')" + /> + + + <_MonoUtility Include="mono-symbolicate.exe" /> + + + <_MonoUtilitySource Include="@(_MonoUtility->'$(_MonoOutputDir)\%(Identity)')" /> + <_MonoUtilityDest Include="@(_MonoUtility->'$(_MandroidDir)\%(Identity)')" /> + <_MonoUtilitySource + Condition=" '$(_DebugFileExt)' == '.mdb'" + Include="@(_MonoUtility->'$(_MonoOutputDir)\%(Identity).mdb')" + /> + <_MonoUtilityDest + Condition=" '$(_DebugFileExt)' == '.mdb'" + Include="@(_MonoUtility->'$(_MandroidDir)\%(Identity).mdb')" + /> + <_MonoUtilitySource + Condition=" '$(_DebugFileExt)' == '.pdb'" + Include="@(_MonoUtility->'$(_MonoOutputDir)\%(Filename).pdb')" + /> + <_MonoUtilityDest + Condition=" '$(_DebugFileExt)' == '.pdb'" + Include="@(_MonoUtility->'$(_MandroidDir)\%(Filename).pdb')" + /> + + <_MonoCilStripSource Include="$(_MonoOutputDir)\mono-cil-strip.exe" /> + <_MonoCilStripDest Include="$(_MandroidDir)\cil-strip.exe" /> + <_MonoCilStripSource + Condition=" '$(_DebugFileExt)' == '.mdb' " + Include="$(_MonoOutputDir)\mono-cil-strip.exe.mdb" + /> + <_MonoCilStripDest + Condition=" '$(_DebugFileExt)' == '.mdb' " + Include="$(_MonoOutputDir)\cil-strip.exe.mdb" + /> + <_MonoCilStripSource + Condition=" '$(_DebugFileExt)' == '.pdb' " + Include="$(_MonoOutputDir)\mono-cil-strip.pdb" + /> + <_MonoCilStripDest + Condition=" '$(_DebugFileExt)' == '.pdb' " + Include="$(_MandroidDir)\cil-strip.pdb" + /> + + Inputs="@(_MonoCilStripSource)" + Outputs="@(_MonoCilStripDest)"> - + - - <_FSharp Include="$(_SourceTopDir)\$(_FSharpCorePackagePath)\lib\portable-net45+monoandroid10+monotouch10+xamarinios10\FSharp.Core*" /> - <_Assemblies Include="$(_MonoProfileDir)\*.dll" /> <_Facades Include="$(_MonoProfileDir)\Facades\*.dll" /> - - - - + +