From 880d7d463e7286a30d835352599eff909967c037 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 10:47:15 +0000 Subject: [PATCH] buildcheck tests: write fixtures with newline="" so the suite passes on a CRLF checkout On a Windows checkout with core.autocrlf, one test of the shared buildcheck suite has failed since the suite exists: test_sharedfiles.RepoEntryTest.test_the_repository_name_is_replaced_by_a_placeholder AssertionError: b'...{repo}/issues\r\n' != b'...{repo}/issues\n' The checker is not at fault: sharedfiles.content() reads bytes and write_manifest() writes with newline="\n", both byte-exact on purpose, because a CRLF difference between repositories is exactly what the checksum must find. It is the fixture writers in the tests that omit newline=, so Python translates \n to \r\n on Windows while the assertions compare LF bytes. Every text-mode writer in the tests now passes newline="" (the three in test_sharedfiles.py, and the one in test_nativedeps.py in java-llama.cpp); normalising inside content() would hide the real difference instead. test_sharedfiles.py is a shared file, so the same change lands in java-llama.cpp, BitcoinAddressFinder, srcmorph and streambuffer, each with its manifest rewritten by check-shared-files.py --write. Until all four are merged the shared-files job warns about the siblings' default branches, as documented; it does not fail. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01AytmJF9faEiQEVt6eetQS2 --- .github/buildcheck/tests/test_nativedeps.py | 2 +- .github/buildcheck/tests/test_sharedfiles.py | 6 +++--- .github/shared-files.sha256 | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/buildcheck/tests/test_nativedeps.py b/.github/buildcheck/tests/test_nativedeps.py index f059f72cd..876fd4ad6 100644 --- a/.github/buildcheck/tests/test_nativedeps.py +++ b/.github/buildcheck/tests/test_nativedeps.py @@ -207,7 +207,7 @@ def test_checks_every_library_of_a_variant_directory(self): f.write(elf64(["libggml-base.so", "libc.so.6"], runpath="$ORIGIN", glibc=["GLIBC_2.17"])) with open(os.path.join(cpu, "libggml-base.so"), "wb") as f: f.write(elf64(["libc.so.6"], glibc=["GLIBC_2.27"])) - with open(os.path.join(cpu, "jllama-files.txt"), "w", encoding="utf-8") as f: + with open(os.path.join(cpu, "jllama-files.txt"), "w", encoding="utf-8", newline="") as f: f.write("libggml.so\nlibggml-base.so\n") self.assertEqual(nativedeps.main(["x", root]), 0) # a module, not only the main library, is held to the floor diff --git a/.github/buildcheck/tests/test_sharedfiles.py b/.github/buildcheck/tests/test_sharedfiles.py index 4bc286d6b..2fe0d9d5f 100644 --- a/.github/buildcheck/tests/test_sharedfiles.py +++ b/.github/buildcheck/tests/test_sharedfiles.py @@ -37,7 +37,7 @@ def setUp(self): f.write(b"a") def manifest(self, text): - with open(os.path.join(self.root, sharedfiles.MANIFEST), "w", encoding="utf-8") as f: + with open(os.path.join(self.root, sharedfiles.MANIFEST), "w", encoding="utf-8", newline="") as f: f.write(text) def run_main(self, *args, others=None): @@ -114,7 +114,7 @@ def setUp(self): self.write(WORKFLOW) def write(self, text): - with open(os.path.join(self.root, ".github/workflows/w.yml"), "w", encoding="utf-8") as f: + with open(os.path.join(self.root, ".github/workflows/w.yml"), "w", encoding="utf-8", newline="") as f: f.write(text) def test_a_job_entry_hashes_the_job_alone(self): @@ -157,7 +157,7 @@ def setUp(self): self.addCleanup(patcher.stop) def write(self, path, text): - with open(os.path.join(self.root, path), "w", encoding="utf-8") as f: + with open(os.path.join(self.root, path), "w", encoding="utf-8", newline="") as f: f.write(text) def test_the_repository_name_is_replaced_by_a_placeholder(self): diff --git a/.github/shared-files.sha256 b/.github/shared-files.sha256 index eeef34320..fae60f7ba 100644 --- a/.github/shared-files.sha256 +++ b/.github/shared-files.sha256 @@ -19,7 +19,7 @@ ff2aaec95e53916ea340a0a291bf0f57e0011522aedb486622b1fb1cac136865 .github/buildc 561efd3f26d7728e475c8ce83c10b4761a6703b585b7b2a7ab052df10f73166c .github/buildcheck/tests/helpers.py 4985f25fa177bd79a79335742adfd0da0431e101124b4e7e214906b56ae903de .github/buildcheck/tests/test_workflow.py cbe504ad081ba31ec16e11c11f879c64179ca7741bf0b1d1318a7fc969ed67dd .github/buildcheck/tests/test_releasegate.py -5cece4a0c48e006de32b6ad8c3c675ac349150c2503a0e21b475564eb1a57267 .github/buildcheck/tests/test_sharedfiles.py +fe36042fbd5444f0b454ad1304cdafde901dd8cec57cfaba7c7086d996dfee27 .github/buildcheck/tests/test_sharedfiles.py 7fe208dd33184b4543328f97b339c95e23c408b120e6bfa6095de4182aeb9a19 .github/check-release-gate.py 1604ccdea83998814a3c1f98f746272222039867b0c7d692355e61495c1c648b .github/check-shared-files.py e5f1679dc7151b2676b2f587860bbaa17e1b89b44a5a4e9703eb3499248c4a06 .github/buildcheck/versions.py