Skip to content

Avoid emitting FSI multiemit PDBs without debug info - #20394

Open
Happypig375 wants to merge 2 commits into
dotnet:mainfrom
Happypig375:fix-fsi-multiemit-debug-symbols
Open

Avoid emitting FSI multiemit PDBs without debug info#20394
Happypig375 wants to merge 2 commits into
dotnet:mainfrom
Happypig375:fix-fsi-multiemit-debug-symbols

Conversation

@Happypig375

Copy link
Copy Markdown
Member

Description

FSI's multi-assembly emit path always supplied WriteILBinaryInMemory with a portable PDB path, even after --debug- cleared TcConfig.debuginfo. As a result, every submission generated PDB bytes, wrote them to the session's temporary symbol directory, and loaded the assembly through Assembly.Load(byte[], byte[]) when no debugging information was requested.

This restores the debuginfo gate that existed before #14537 moved FSI symbols to disk:

  • --multiemit+ --debug- now passes no PDB path, generates no PDB, and follows the existing Assembly.Load(byte[]) branch.
  • --multiemit+ --debug+ continues to generate, persist, and load portable PDB data.

This addresses the symbol-generation performance item in #17306. The downstream report is bryanedds/Nu#1090, where enabling native debugging through launchSettings.json amplified FSI code-reload time by a reported 5-10x.

Root cause

PR #14537 enabled CoreCLR script debugging and changed pdbfile from a tcConfig.debuginfo-conditioned option to an unconditional temporary path. WriteILBinaryInMemory uses the presence of that path as its PDB-generation switch, so --debug- no longer prevented symbol work in multi-emit mode.

Validation

  • Proved the new debug-off artifact test red on unmodified origin/main: 1 test run, 1 failed because the session symbol directory contained FSI-ASSEMBLY-MULTI-1.pdb.
  • Fixed paired regression tests: 2 run, 2 passed (--debug- emits no PDB; --debug+ still emits one).
  • build.cmd -noVisualStudio -c Release -nobl: succeeded locally (639.5s incremental fixed build).

A stable automated timing benchmark was not added because the reported multiplier depends on Visual Studio's mixed managed/native debugger. The regression test directly asserts that the unnecessary per-submission symbol artifact is eliminated.

Checklist

  • Test cases added
  • Performance benchmarks added in case of performance changes (debugger-dependent; rationale above)
  • Release notes entry updated

@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

❗ Release notes required

You can open this PR in browser to add release notes: open in github.dev


✅ Found changes and release notes in following paths:

Change path Release notes path Description
`src/Compiler` docs/release-notes/.FSharp.Compiler.Service/11.0.100.md

@github-actions github-actions Bot added the AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files label Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

1 participant