-
Notifications
You must be signed in to change notification settings - Fork 644
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
[NuGet.org Bug]: Symbol Server: Can't find pdbs bundled in nupkg via the Symbol Server API #9925
Comments
Suggested solution: when processing nupkg, copy out PDBs and make them available same way as when ingesting snupkg packages. Before snupkg were the preferred way to upload symbols, "everyone" was doing the embedded pdb in nupkg, including Sentry for many years. |
Thanks for the suggestion, @bruno-garcia. I think this proposal makes sense in many ways. The data shows that active packages favor .snupkg -- 15% use .snupkg and 12% use "PDB in .nupkg". In other words, both have similar adoption but .snupkg is on the rise and PDB is on the slight decline but still quite active. But as you say "PDB in .nupkg" is a documented alternative so perhaps it should have support that's just as good, or nearly as good, as .nupkg. Some kinks that we'd need to work out are:
Perhaps another option is to improve the debugger client to know about PDBs in the NuGet global package folder. This makes sense for cases when you're debugging a project that depends on these other DLLs (e.g. Google APIs) as package reference. But what if you're debugging an entry point without project context? For example windbg can read from a symbol server like NuGet.org's symbol server (theoretically). In cases like that the NuGet global packages folder may not be populated with the packages associated with the runtime dependencies you're looking at. There is also the perspective that other package sources may not want to implement the .snupkg ingestion flow but do want to implement a symbol server. In such cases they may very well want to ingest PDBs from .nupkg (or that cursed old .symbols.nupkg artifacts). Should we enhance the metadata in the NuGet V3 protocol to allow package sources to declare how they treat PDBs in .nupkg and/or .snupkg? It's possible this question extends beyond NuGet.org. |
PPDB has been default on all flavors of .NET for many years now, I imagine silently not ingesting would be OK. That said further analysis on % of pdbs affected before committing to this decision might be the safer route.
I imagine this isn't a common scenario but it's a fair point. I imagine it doesn't matter which one wins because the way this could happen is if an app is configured to write pdb to the bin folder and packages it, while also creating snupkg. So if one overrides the other, or if the nupkg extraction doesn't happen because before doing so it checks of snupkg already exists, either way would be fine.
tbqh I don't know why one would need to make symbols mutable. They come out of the compiler with the executable and if you can't change the executable, why do that for the symbols? Here again (prob due to my ignorance on the subject) I imagine it's fine if snupkg are mutable while the extracted ppdb are not. Or "push a snupkg to override it" if that's the behavior decided above.
The use case I'm thinking of (which is the one that affected my ability to debug things since I had no line numbers) was a live/prod app. Sentry captures the stack trace, and on the server (sentry itself, not a .NET app) looks up symbols via symbol servers.
I don't have strong opinions here, I imagine folks on the NuGet team will know best what's the ideal route here |
It would be interesting to consider how we could make .NET debuggable by default. Today, there are many gaps in the experience. See NuGet/Home#10793 for another relevant discussion.
I don't think we need additional metadata in the V3 protocol for this. In theory it is completely valid for a third-party NuGet server to ingest portable PDBs in a .nupkg:
|
Impact
I'm unable to use NuGet.org
Describe the bug
Unless packages are published via
snupkg
, using nuget.org's Symbol Server API doesn't result in finding symbols.See: getsentry/symbolicator#1437
Repro Steps
Use the documented alternative to symbol packages:
https://learn.microsoft.com/en-us/dotnet/standard/library-guidance/nuget#symbol-packages
In other words, instead of publishing a separate
snupkg
, copy thepdb
to the output directory to let it get copied into thenupkg
next to thedll
.Google uses this approach here: https://github.com/googleapis/google-cloud-dotnet/blob/2f193795dd1daaba3ad6dd1f0f6b0c20c6597e6a/tools/DotnetToolProperties.xml#L8
Expected Behavior
When a debugger (or a crash reporting service like Sentry tries to fetch the debug symbols for a DLL loaded from nuget.org, it finds them and downloads them.
Unfortunately that doesn't happen. When using
snupkg
, it works as expected.Screenshots
PDBs exist in the
nupkg
: https://nuget.info/packages/Google.Cloud.Storage.V1/4.10.0Additional Context and logs
We use the Microsoft Symbol Server format to fetch symbols (worked for the other symbols on the screenshot above);
Quotes from this comment
The text was updated successfully, but these errors were encountered: