Keep the toolchain verifier and its pin file LF in every checkout

A follow-up from the review of the pinned downloads: a checkout that
converts line endings (Windows with core.autocrlf) would hand sh and
sha256sum a carriage return at the end of every line of
scripts/verify-toolchain.sh and scripts/toolchain.sha256. The Windows job
passes today; .gitattributes makes that independent of the runner's git
configuration, and the supply-chain test checks the two lines.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
Malte Ubl
2026-11-08 09:05:00 -08:00
co-authored by Claude Code
parent c5849158e7
commit 2d0e27507e
2 changed files with 14 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
# The toolchain verifier and its pin file are read by sh and sha256sum on every
# platform, Windows checkouts included: keep their line endings as committed.
scripts/verify-toolchain.sh text eol=lf
scripts/toolchain.sha256 text eol=lf
+10
View File
@@ -75,6 +75,16 @@ test("the pin file has one well-formed line per archive", () => {
);
});
test("the verifier and the pin file keep LF line endings in every checkout", () => {
// A Windows checkout that converts line endings must not hand sh and
// sha256sum a carriage return at the end of every line.
const attributes = read(".gitattributes").split(/\r?\n/);
for (const path of ["scripts/verify-toolchain.sh", pinFile]) {
expect(attributes, path).toContain(`${path} text eol=lf`);
expect(read(path), path).not.toContain("\r");
}
});
test("every download of a toolchain archive is checked against the pin file", () => {
// A file that fetches from one of these origins must also run the verifier.
const origins =