Skip to content

Embed PDBs in the shipped DLLs and stop producing a symbols package - #4173

Merged
AArnott merged 1 commit into
masterfrom
embed-pdbs
Oct 8, 2026
Merged

AArnott merged 1 commit into
masterfrom
embed-pdbs

Conversation

@AArnott

@AArnott AArnott commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Release builds of StyleCop.Analyzers and StyleCop.Analyzers.CodeFixes now embed their portable PDBs (DebugType=embedded), and the package stops producing the legacy .symbols.nupkg.

Changes

  • DebugType=embedded for Release in both shipped projects. Debug builds keep separate portable PDBs (see Directory.Build.props), which coverlet uses.
  • Removed IncludeSymbols (and the IncludeSymbols=false override on the metadata package pack).
  • Removed the .pdb lines from StyleCop.Analyzers.nuspec, and the src/** lines too. Those source files only ever went into the symbols package. If we dropped IncludeSymbols but kept those lines, about 430 .cs files would end up in the main package.

Sizes (Release, master 53ce0bf)

File Before (separate PDB) Embedded Growth
StyleCop.Analyzers.dll 1,061,376 B (+ 555,152 B .pdb) 1,402,368 B +340,992 B (+32.1%)
StyleCop.Analyzers.CodeFixes.dll 419,840 B (+ 125,416 B .pdb) 478,720 B +58,880 B (+14.0%)
Both DLLs 1,481,216 B 1,881,088 B +399,872 B (+27.0%)
StyleCop.Analyzers.Unstable nupkg 508,693 B (no PDBs) 908,599 B +399,906 B (+78.6%)
.symbols.nupkg 1,635,433 B (no longer produced)
Metadata nupkg 4,169 B 4,169 B unchanged
  • Embedded PDBs are deflate-compressed: 555,152 → 340,953 B and 125,416 → 58,968 B, so they add 58.8% of the separate PDBs' size.
  • The total DLL growth (0.38 MiB, +27.0%) is within the agreed limits (under 10 MB and under 30%). Caveat: StyleCop.Analyzers.dll on its own grows +32.1%.
  • Each release now publishes 0.9 MB of packages instead of 2.1 MB.
  • The 9 satellite StyleCop.Analyzers.resources.dll files are resource-only and had no PDBs, so they don't change.

Interaction with #4123 (release workflow)

#4123's release.yml mentions .symbols.nupkg. Its validation step skips *.symbols.nupkg, its header comment says the legacy symbols package is attached to the GitHub release, and the push step passes --no-symbols. Once this PR merges, no .symbols.nupkg is produced, so that skip is a no-op. The comment and --no-symbols can be cleaned up in #4123; nothing there breaks.

CI verification

The nuget-packages artifact from this PR's run 37807524675 (Windows CI, Release) contains only StyleCop.Analyzers.Unstable (900,390 B, 20 files) and the metadata package (4,203 B). There's no .symbols.nupkg, no .pdb files and no src/. Both DLLs carry the embedded PDB (debug directory entry MPDB):

  • StyleCop.Analyzers.dll: 1,404,928 B
  • StyleCop.Analyzers.CodeFixes.dll: 480,256 B

These are slightly larger than in the table above because current master has more code than 53ce0bf.

… package

Release builds of StyleCop.Analyzers and StyleCop.Analyzers.CodeFixes now use DebugType=embedded. The package
no longer sets IncludeSymbols, so the legacy .symbols.nupkg (DLLs, PDBs and sources) is no longer produced, and
the nuspec no longer lists the .pdb files or the source files, which only ever went into that symbols package.

The embedded PDBs are deflate-compressed: the analyzer DLLs grow by 399,872 bytes (27%) in total.
@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.41%. Comparing base (f26d21b) to head (1606784).
⚠️ Report is 43 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4173   +/-   ##
=======================================
  Coverage   97.41%   97.41%           
=======================================
  Files        1118     1118           
  Lines      124962   124962           
  Branches     4203     4203           
=======================================
  Hits       121734   121734           
  Misses       2116     2116           
  Partials     1112     1112           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AArnott
AArnott marked this pull request as ready for review October 8, 2026 17:18
@AArnott
AArnott merged commit 5fa97a1 into master Oct 8, 2026
25 checks passed
@AArnott
AArnott deleted the embed-pdbs branch October 8, 2026 17:23
This was referenced Nov 11, 2026
This was referenced Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant