Skip to content

Work around metadata-only PDB emit failures - #385

Merged
jaredpar merged 2 commits into
mainfrom
jaredpar-metadata-only-pdb-workaround
Aug 28, 2026
Merged

Work around metadata-only PDB emit failures#385
jaredpar merged 2 commits into
mainfrom
jaredpar-metadata-only-pdb-workaround

Conversation

@jaredpar

Copy link
Copy Markdown
Owner

Metadata-only compilations can retain PDB-specific emit options that current Roslyn mishandles, causing EmitToMemory failures or invalid CodeView metadata. Roslyn PR dotnet/roslyn#85028 fixes this upstream, but that fix is not yet available in a package complog can reference.

This temporarily normalizes metadata-only EmitOptions while CompilerLogReader rehydrates a compilation:

  • clears the PDB path because metadata-only output has no associated PDB
  • replaces embedded debug information with portable PDB format to avoid the current Roslyn guard
  • keeps the workaround local to reader option deserialization so it remains transparent to callers

Adds regression coverage demonstrating the upstream Roslyn failure and links the related issue and fix.

Testing

  • dotnet test src\Basic.CompilerLog.UnitTests\Basic.CompilerLog.UnitTests.csproj --framework net10.0 --no-restore --blame-hang --blame-hang-timeout 60s

Suppress PDB-specific emit options when reading metadata-only compiler logs until the Roslyn fix is available.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 89ca8e5d-3064-43bd-b395-4556f6630e14
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.85%. Comparing base (4c99388) to head (b76bb6d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #385      +/-   ##
==========================================
+ Coverage   95.83%   95.85%   +0.01%     
==========================================
  Files          54       54              
  Lines        6174     6175       +1     
  Branches      710      710              
==========================================
+ Hits         5917     5919       +2     
  Misses        138      138              
+ Partials      119      118       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jaredpar
jaredpar merged commit 3403b93 into main Aug 28, 2026
6 of 8 checks passed
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