From e23e75757f7ba411ca282444b4e5be1435c73382 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Wed, 8 Jul 2026 09:28:55 -0400 Subject: [PATCH] Force lf line endings for managed source to fix SourceLink PDB checksums 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/runtime#129023 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .gitattributes | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitattributes b/.gitattributes index bf494b31916fe9..b7335e3dfff63f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -27,8 +27,13 @@ *.cmd text eol=crlf *.bat text eol=crlf -*.cs text diff=csharp -*.vb text +# Force managed source files to lf in the working tree so the source-document +# checksums the compiler records in portable PDBs match the lf blobs SourceLink +# serves from GitHub raw URLs. Without eol=lf, Windows build checkouts produce +# crlf source, making strict SourceLink/PDB byte verification fail even though +# the content matches after line-ending normalization. See dotnet/runtime#129023. +*.cs text eol=lf diff=csharp +*.vb text eol=lf *.resx text *.c text *.cpp text @@ -53,8 +58,8 @@ *.m text *.asm text *.erl text -*.fs text -*.fsx text +*.fs text eol=lf +*.fsx text eol=lf *.hs text *.csproj text