-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Proposal] Remove MDB and non-portable PDB support #2230
Comments
I'm all for this given this is the future of cross-platform symbols. Although it does possibly remove the ability to debug and step into code via packed NuGet symbols, this seems like something we shouldn't wait to implement on our end? Further Resources: https://github.com/dotnet/core/blob/master/Documentation/diagnostics/portable_pdb.md |
One discovery holding us back here, currently our Xamarin.Forms template has this in the NetStandard project: <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup> This was added because it broke debugging with UWP??? This doesn't make sense, @joj is going to investigate further. |
Fixes: dotnet#2230 We currently spend some time during builds converting symbol files if `DebugType=Full` or `DebugType=PdbOnly` is used. These are older symbol formats, and we have already done the work to use `DebugType=Portable` everywhere in the Xamarin templates. My thought is to just remove support for these symbols by default unless `$(AndroidLegacySymbols)` is set to `True`. This way if a problem comes up, developers can opt-in to the old behavior. Eventually we may phase out support completely, but it may not matter to leave it in. I updated various tests here to make sure we continue to test both `Full` and `Portable` in `DebuggingTest.cs`. Other changes: * I found the `_CollectMdbFiles` MSBuild target is completely unused. It should have been removed in 2ea31e6, but we can remove it now. * I found a place `$(AllowedReferenceRelatedFileExtensions)` was adding duplicate values. We should have removed this in e390702.
Fixes: dotnet#2230 We currently spend some time during builds converting symbol files if `DebugType=Full` or `DebugType=PdbOnly` is used. These are older symbol formats, and we have already done the work to use `DebugType=Portable` everywhere in the Xamarin templates. My thought is to just remove support for these symbols by default unless `$(AndroidLegacySymbols)` is set to `True`. This way if a problem comes up, developers can opt-in to the old behavior. Eventually we may phase out support completely, but it may not matter to leave it in. I updated various tests here to make sure we continue to test both `Full` and `Portable` in `DebuggingTest.cs`. Other changes: * I found the `_CollectMdbFiles` MSBuild target is completely unused. It should have been removed in 2ea31e6, but we can remove it now. * I found a place `$(AllowedReferenceRelatedFileExtensions)` was adding duplicate values. We should have removed this in e390702.
Fixes: dotnet#2230 We currently spend some time during builds converting symbol files if `DebugType=Full` or `DebugType=PdbOnly` is used. These are older symbol formats, and we have already done the work to use `DebugType=Portable` everywhere in the Xamarin templates. My thought is to just remove support for these symbols by default unless `$(AndroidLegacySymbols)` is set to `True`. This way if a problem comes up, developers can opt-in to the old behavior. Eventually we may phase out support completely, but it may not matter to leave it in. I updated various tests here to make sure we continue to test both `Full` and `Portable` in `DebuggingTest.cs`. Other changes: * I found the `_CollectMdbFiles` MSBuild target is completely unused. It should have been removed in 2ea31e6, but we can remove it now. * I found a place `$(AllowedReferenceRelatedFileExtensions)` was adding duplicate values. We should have removed this in e390702.
Fixes: dotnet#2230 We currently spend some time during builds converting symbol files if `DebugType=Full` or `DebugType=PdbOnly` is used. These are older symbol formats, and we have already done the work to use `DebugType=Portable` everywhere in the Xamarin templates. My thought is to just remove support for these symbols by default unless `$(AndroidLegacySymbols)` is set to `True`. This way if a problem comes up, developers can opt-in to the old behavior. Eventually we may phase out support completely, but it may not matter to leave it in. I updated various tests here to make sure we continue to test both `Full` and `Portable` in `DebuggingTest.cs`. ~~ XA0122 ~~ I added a new warning, for cases where a PCL `<ProjectReference/>` have `DebugType=Full` set. This seems like the only likely cause a user could hit an issue. I added a test for this scenario. Other changes: * I found the `_CollectMdbFiles` MSBuild target is completely unused. It should have been removed in 2ea31e6, but we can remove it now. * I found a place `$(AllowedReferenceRelatedFileExtensions)` was adding duplicate values. We should have removed this in e390702.
Fixes: dotnet#2230 We currently spend some time during builds converting symbol files if `DebugType=Full` or `DebugType=PdbOnly` is used. These are older symbol formats, and we have already done the work to use `DebugType=Portable` everywhere in the Xamarin templates. My thought is to just remove support for these symbols by default unless `$(AndroidLegacySymbols)` is set to `True`. This way if a problem comes up, developers can opt-in to the old behavior. Eventually we may phase out support completely, but it may not matter to leave it in. I updated various tests here to make sure we continue to test both `Full` and `Portable` in `DebuggingTest.cs`. ~~ XA0122 ~~ I added a new warning, for cases where a PCL `<ProjectReference/>` have `DebugType=Full` set. This seems like the only likely cause a user could hit an issue. I added a test for this scenario. Other changes: * I found the `_CollectMdbFiles` MSBuild target is completely unused. It should have been removed in 2ea31e6, but we can remove it now. * I found a place `$(AllowedReferenceRelatedFileExtensions)` was adding duplicate values. We should have removed this in e390702.
Will not be supported in .NET 6: aab69af. |
Currently, let's say you have a "Hello World" Xamarin.Android application project on Windows.
You might have the following properties in your
HelloWorld.csproj
:NOTE: the latest template puts
DebugType=portable
hereWhen built, what will currently happen:
HelloWorld.dll
is compiledHelloWorld.dll.mdb
is the generated symbol fileConvertDebuggingFiles
MSBuild task (runspdb2mdb
) that is taking ~50ms for "Hello World". (I have seen it take up to 4 seconds, in cases whereMono.Android.dll.mdb
existed, see [build] DebugType=portable across all projects #2215)*.mdb
files in_CollectMdbFiles
and_CopyMdbFiles
targetsAs you can see, it is a lot of work to support this file format. Making sure all our of project templates have
DebugType=portable
is the first step.What happens in VS for Mac?
The VS for Mac templates are not yet shared with the VS Windows templates, and they are specifying
DebugType=full
by defaut.However, Mono is building portable
*.pdb
files with this setting.ConvertDebuggingFiles
andpdb2mdb
aren't running at all.What should we change?
The first thought, is that
Xamarin.Android.Common.targets
should do this by default:This would make Xamarin.Android projects always use portable
*.pdb
files by default.DebugType=portable
is set by SDK-style NetStandard projects by default. It works for bothDebug
andRelease
builds.We would also remove:
*.mdb
filesConvertDebuggingFiles
andpdb2mdb
If we encounter a "non-portable" pdb file, it will also be skipped and a new warning emitted.
Benefits
These changes cleanup our MSBuild targets and remove code (reduce technical debt).
It will also improve build times. How much? This is an estimate, but I'm seeing 50-100ms in past SmartHotel360 build logs looking for and copying
*.mdb
files. I think this time is spent even on builds with no changes. I see 300ms being spent onConvertDebuggingFiles
, but this only happens when assemblies are changing.Concerns
The main concern here is existing NuGet packages, and what will happen.
*.mdb
file is encountered, it will just be ignored*.pdb
file is encountered we will emit a warning and ignore itSo I think the only thing that someone could lose here is the ability to debug and step into code inside an existing NuGet package.
See: NuGet/Home#6104
The text was updated successfully, but these errors were encountered: