-
Notifications
You must be signed in to change notification settings - Fork 69
Source Index and pack .pdb files into regular .nupkg #131
Comments
So I think the steps would be to take the output of the build and generate a source linked pdb using the pdb from the .symbols package. When we unzip and rezip the package to tweak extra stuff, we should include the pdb source linked pdb in there pointing to the github sha. |
Note that including the pdbs in the .nupkg where VS can find them turns the corresponding dlls into “My Code”. By default VS has Just My Code and break on user-unhandled exceptions enabled. This will cause the debugger to break on exceptions that cross "My Code" boundaries. We found this out because we were including the symbols in the System.Data.SqlClient.nupkg, see dotnet/efcore#987 |
I just published a working version of |
Hoping to provide better examples of using Is there an API that I can access to get a list of files to compile in a project.json? If yes, I may be able to incorporate in
For example |
I just announced a stable SourceLink.exe and added documentation on how to use it. Also be sure to check out the demo that demonstrates taking advantage of the source index at design time. I would love to make progress on this ticket. /cc @pranavkm @davidfowl |
At the Microsoft MVP Summit, I spoke with several key individuals today and we've come up with a great plan for source indexing. The primary push right now is to get debugging to work cross-platform. The portable pdb format recently became 1.0 and Roslyn Open issues:
Simply including the portable pdb files with the nuget packages is a great first step. |
cc @rynowak for symbro. |
We can change the title of this to I've added pull requests that should get you guys started for both aspnet.mvc aspnet/Mvc#5860 and EntityFramework dotnet/efcore#7726. It was been agreed upon to include Portable PDB files in the nupkgs for source link support. Check out the fresh new documentation here: https://github.com/ctaggart/SourceLink cc @davidfowl |
Just to get @DamianEdwards @Eilon @shanselman & others up to speed:
It should be easy to add. It only needs to run on the build server. Happy to help whoever does the work. I'm also wanting to onboard the SourceLink project to the .NET Foundation & have submitted to do so. |
Let me also point out that VS 2017 supports Embedded Portable PDBs. This feature ( |
|
We don't currently ship PDBs anywhere at all - I think that's probably required for this suggestion to be useful, is that correct? |
@Eilon That is correct. Embedding in the dll sounds like a good option. It is simple to test and to switch to. The objections about shipping pdb files before were:
With Portable PDB files and the new dotnet/nuget tooling, these issues have been addressed. The files are much smaller & the dotnet/nuget tooling shares the downloads in ~/.nuget. It should be simple to test this change to see how much bigger the nupkg files get. Simply switch to embedded PDB files and try it with I think the increased file size is justified to enable source link support, but please discuss with the decision makers. @yishaigalatzer is who I've talked to before about this. |
Do we know the approximate increase in file size? Even if it's fairly significant, I'd probably still advocate for embedding PDBs because having to manage PDBs is JUST THE WORST. :) I suppose I could just try it, but then I'd have to do work and mumble mumble I'm lazy mumble |
A simple test with Microsoft.AspNetCore.Authentication showed an increase from 62 KB to 73 KB for embedding the PDB. An increase of 17% in size. This seems completely reasonable to me given the benefits :). |
Is @AndriySvyryd's comment above still correct?
If yes, how do we help users focus on what they're developing when that's their preference? |
@gregg-miskelly For opinion on JMC. I wonder if it would make sense to distinguish Debug (My Code) vs Release (not My Code) bits. |
As long as dll/exe is optimized compiled, and 'Tools->Options->Debugging->Suppress JIT Optimizations on Module Loads' is in its default (unchecked) state -- no, since the code is JIT optimized it would still be considered non-user code. |
dotnet/efcore#987 happened at the end of October 2014. I know we had a short (let's hope) period where we accidentally shipped non-optimized bits. Anyone remember if the time frames overlap? If the System.Data.SqlClient bits were optimized, we need to figure out why VS treated them as My Code. Or @gregg-miskelly, are you describing a different behaviour than we would have seen way back then? |
@dougbu versions of VS before 2015 had Suppress JIT optimizations on by default. |
Excellent 🥇 |
@anurse does your experiment just embed regular PDBs in the DLL, or does it include source links and/or embedded source? |
O, change of plans, sorry for the confusion. We (ASP.NET team) discussed this further with the .NET team and decided to not include the PDBs in the NUPKGs or shared runtime, but to instead include them on a symbol server that will have everything needed for debugging. We're tracking that work item here: #850 Ultimately, our goal is to have a great debugging experience for everyone, and I think this new approach will achieve that. This is a very fluid space with a lot of ever-changing variables, but I think we're getting closer to a great solution. |
You didn't even do the experiment to see how well it works. You decided against it without giving reasons why. You chose a solution that does not work currently for the rest of the .NET community who can't publish to symbol servers. |
Sorry about that, let me elaborate. We are working on getting symbol server support for additional debugging scenarios in the .NET Core 2.1 timeframe. So, by publishing PDBs to those servers, debuggers will be able to pull down the PDBs and you get a great debugger experience. The PDBs already have source linking enabled, so you can step straight into GitHub sources (wherever that specific feature is supported). Can you clarify the remark about "the rest of the .NET community"? This issue applies only to the PDBs for ASP.NET/EF Core, unless I've misunderstood some requirements. |
Symbol Servers 👎My experience with Symbol Servers is usually not a great experience. What makes using Symbol Servers a better experience then including the pdb files in the nupkg? If you put the pdb files in the nupkg, you don't need Symbol Servers. It is one less system to deal with (host, configure, manage). hostThere are lots of options to host nuget feeds, including services like MyGet and AppVeyor in addition to NuGet Gallery. I am not aware of Symbol Server services. configureUsing nuget clients like nuget.exe and paket you can specify a list of sources. I am not aware of any solution like that for symbol servers. manageTo clean up disk space, it is pretty easy to delete nupkg files that are versioned. You can easily delete all of the prerelease versions before the last stable release. If you use Symbol Servers, how do you go about removing all of the corresponding pdb files? |
Because this is just a question for the .NET/ASP.NET/EF Core packages, there's just one symbol server, the Microsoft one. At least when using VS, the symbols are cached in a folder of your choice, so it's easy to clear them all out (but perhaps not as easy to clear out just a subset): One of the downsides of including the PDBs in the NUPKGs is the increased size and that most of the time they aren't used. Keep in mind that most DLLs in the .NET Core release are themselves doubled (one MSIL DLL, and one crossgen'ed DLL), so there are also two PDBs (one for each DLL). |
Note that we are not saying that people should not put PDBs into their main Nuget packages. Indeed we suggest that they do precisely because we do NOT have a story for 3rd parties to use a symbol server (we have plans, but they are not ready). However this particular work item is of much narrower scope. It is whether ASP.NET (and certainly the .NET Framework) should package its PDBS into their nuget packages. Now the ASP.NET and .NET Framework team are a bit different than most other in the .NET community because
Note that other package managers (e.g. for Linux etc), have come to the same conclusion (that having separate packages for symbols is good), for undoubtedly the same reason (only dev scenarios need the symbols, but the are large, so why make everyone pay for something that few need (pay for play). |
Can we agree that the .NET community should put source linked PDBs into their main NuGet packages until there is a better solution? I think you are already saying this, but I just want to confirm. I think with these projects finally enabling source link, it will be a major win and other major .NET projects will finally adopt it too. These Microsoft projects lead by example. With your clear explanation of why Microsoft is different and is using a symbol server, that should be good enough to help spur adoption. |
@ctaggart I think that's the direction NuGet is going, either there or with the |
I agree with @ctaggart point that people besides Microsoft should be
We strongly encourage people to take these steps. Ultimately we want to have a secure symbol server story that everyone can use, but that that is far enough away that people should NOT wait. They should be including PDBs now. |
Wherever we ship DLLs that are used in customer apps, we need to include the portable PDB along side it.
We need to include portable PDBs in:
And we need to do this in:
Original text:
From aspnet/dnx#380
The plan would be to create a single nupkg rather than a *.nupkg and *.symbols.nupkg as part of our build and use SourceLink to support having pdbs sit in the package.
The text was updated successfully, but these errors were encountered: