mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-12-06 04:56:15 +08:00
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:
@@ -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
|
||||
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user