Cecil does not generate portable PDB checksum #610

Open
opened 2019-08-20 16:42:17 -05:00 by ltrzesniewski · 7 comments
ltrzesniewski commented 2019-08-20 16:42:17 -05:00 (Migrated from github.com)

Currently, Cecil does not generate a PdbChecksum debug directory entry in the assembly it writes when it produces a portable PDB file.

This entry is validated by the NuGet gallery when you try to submit a symbol package (.snupkg file), making it impossible to upload such packages for assemblies processed by Cecil.

Here's the information needed to implement this feature:

I may try to implement this in the future unless someone else is interested. 😉

Related issue: https://github.com/ltrzesniewski/InlineIL.Fody/issues/12
/cc @sakno

Currently, Cecil does not generate a `PdbChecksum` debug directory entry in the assembly it writes when it produces a portable PDB file. This entry is validated by the NuGet gallery when you try to submit a symbol package (`.snupkg` file), making it impossible to upload such packages for assemblies processed by Cecil. Here's the information needed to implement this feature: - [`PdbChecksum` entry specification](https://github.com/dotnet/corefx/blob/master/src/System.Reflection.Metadata/specs/PE-COFF.md#portable-pdb-checksum) - [Validation code used by NuGet](https://github.com/NuGet/NuGet.Jobs/blob/44cf1f870bcbc07a6e9936603e02e6d1b3373e46/src/Validation.Symbols/SymbolsValidatorService.cs#L186-L253) (you can easily extract this method if you remove telemetry and output message code, and reference `System.Reflection.Metadata`) - [Docs about symbol package constraints](https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg#nugetorg-symbol-package-constraints) I may try to implement this in the future unless someone else is interested. 😉 Related issue: https://github.com/ltrzesniewski/InlineIL.Fody/issues/12 /cc @sakno
Starnick commented 2020-02-15 19:20:29 -06:00 (Migrated from github.com)

I was just investigating snupkg support for my nuget libraries and ran into this too :(

I was just investigating snupkg support for my nuget libraries and ran into this too :(
ltrzesniewski commented 2020-02-16 06:31:05 -06:00 (Migrated from github.com)

FWIW I didn't try to implement this as apparently @jbevain started to work on it in #617.

FWIW I didn't try to implement this as apparently @jbevain started to work on it in #617.
Starnick commented 2020-02-17 17:40:27 -06:00 (Migrated from github.com)

@jbevain Is this PR done, just waiting to be merged?

@jbevain Is this PR done, just waiting to be merged?
jbevain commented 2020-02-18 12:51:08 -06:00 (Migrated from github.com)

Heh, no otherwise it would be merged :)

The PR in its current state re-orders some internal implementation detail to write the debug symbols before writing the assembly as this requires computing the pdb checksum before writing it in the assembly.

Heh, no otherwise it would be merged :) The PR in its current state re-orders some internal implementation detail to write the debug symbols before writing the assembly as this requires computing the pdb checksum before writing it in the assembly.
clairernovotny commented 2020-05-29 13:27:43 -05:00 (Migrated from github.com)

As a workaround for NuGet, and better than snupkg IMO, is to include the PDB in the main NuPkg. You can do that like this:
https://github.com/clairernovotny/DeterministicBuilds/blob/master/Directory.Build.props#L10

As a workaround for NuGet, and better than snupkg IMO, is to include the PDB in the main NuPkg. You can do that like this: https://github.com/clairernovotny/DeterministicBuilds/blob/master/Directory.Build.props#L10
sakno commented 2020-05-29 14:07:49 -05:00 (Migrated from github.com)

@clairernovotny , currently I'm using embedded PDB <DebugType>embedded</DebugType> as a workaround.

@clairernovotny , currently I'm using embedded PDB `<DebugType>embedded</DebugType>` as a workaround.
clairernovotny commented 2020-05-29 14:17:10 -05:00 (Migrated from github.com)

@sakno that works too

@sakno that works too
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-jbevain/cecil#610
No description provided.