henon / Python.Included

A Python.NET based framework enabling .NET libraries to call into Python packages without depending on a local Python installation.
MIT License
321 stars 52 forks source link

Suggestion: Distribute `PDB` files alongside `DLL`s #41

Open JimiC opened 2 years ago

JimiC commented 2 years ago

Distributing the .pdb files will help us debug your library from within our code.

https://devblogs.microsoft.com/visualstudio/debugging-external-sources-with-visual-studio/

henon commented 2 years ago

I added <IncludeSymbols>true</IncludeSymbols> to the csproj files which generates a Python.Deployment.1.4.1.symbols.nupkg in addition to the Python.Deployment.1.4.1.nupkg package. However, it won't let me upload that as it competes with the 1.4.1 package without symbols.

henon commented 2 years ago

According to https://stackoverflow.com/questions/41713693/include-pdb-files-into-my-nuget-nupkg-files there is a way to include the PDBs with

<files>
    <file src="bin\$configuration$\$id$.pdb" target="lib\net452\" />
</files>

but I don't know where I should put that. Surely not in the csproj file, right?

JimiC commented 2 years ago

At some point your are creating a zip file on release. Include the pdb file in it.

Come to think of it again, I suppose that the nuget tool does the zipping, so the above suggestion is not applicable. Let me do a search on the matter.

henon commented 2 years ago

I use the Create package on build feature. When compiling the project it automatically generates the nugets. It is convenient. I guess using the command line with dotnet pack --include-symbols --include-source instead might solve it. I could probably upload them as separate debug packages like Python.Deployment.Debug.1.4.1.nupkg so you can switch at will.

JimiC commented 2 years ago

I added <IncludeSymbols>true</IncludeSymbols> to the csproj files which generates a Python.Deployment.1.4.1.symbols.nupkg in addition to the Python.Deployment.1.4.1.nupkg package. However, it won't let me upload that as it competes with the 1.4.1 package without symbols.

Yes. It won't allow you to upload a package that is already released because there are security risks or breaking changes by doing that. Same goes for npm where I have more knowledge of.

JimiC commented 2 years ago

Python.Deployment.Debug.1.4.1.nupkg

That's a reasonable solution.