Skip to content

Force lf line endings for managed source to fix SourceLink PDB checksums#130358

Closed
steveisok wants to merge 1 commit into
dotnet:mainfrom
steveisok:sourcelink-eol-lf
Closed

Force lf line endings for managed source to fix SourceLink PDB checksums#130358
steveisok wants to merge 1 commit into
dotnet:mainfrom
steveisok:sourcelink-eol-lf

Conversation

@steveisok

Copy link
Copy Markdown
Member

Managed source files used .gitattributes 'text', which stores lf blobs but checks out crlf on Windows build agents. The compiler records the crlf source-document checksums in portable PDBs, while SourceLink points at GitHub raw URLs that serve the lf blobs. Strict SourceLink/PDB byte verification then fails for official packages even though the content matches after line-ending normalization.

Add eol=lf for .cs/.vb/.fs/.fsx so every checkout (including Windows CI) uses lf, matching the bytes SourceLink serves.

Contributes to #129023

Managed source files used .gitattributes 'text', which stores lf blobs but
checks out crlf on Windows build agents. The compiler records the crlf
source-document checksums in portable PDBs, while SourceLink points at GitHub
raw URLs that serve the lf blobs. Strict SourceLink/PDB byte verification then
fails for official packages even though the content matches after line-ending
normalization.

Add eol=lf for .cs/.vb/.fs/.fsx so every checkout (including Windows CI) uses
lf, matching the bytes SourceLink serves.

Fixes dotnet#129023

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 8, 2026 13:39
@steveisok
steveisok requested a review from a team July 8, 2026 13:40
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the repository’s root .gitattributes to ensure managed source files always use LF line endings in the working tree, making portable PDB source-document checksums consistent with the LF bytes served by SourceLink.

Changes:

  • Force eol=lf for *.cs, *.vb, *.fs, and *.fsx checkouts (including on Windows agents).
  • Preserve existing diff configuration for C# (diff=csharp) while adding eol=lf.
  • Add an explanatory comment block documenting the SourceLink/PDB checksum rationale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants