Skip to content

buildcheck tests: write fixtures with newline="" so the suite passes on a CRLF checkout (4-repo sync) - #491

Merged
bernardladenthin merged 1 commit into
mainfrom
claude/hopeful-pascal-9jlbqb
Oct 9, 2026
Merged

bernardladenthin merged 1 commit into
mainfrom
claude/hopeful-pascal-9jlbqb

Conversation

@bernardladenthin

@bernardladenthin bernardladenthin commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • One test of the shared buildcheck suite has failed on every Windows checkout with core.autocrlf since the suite exists: test_sharedfiles.RepoEntryTest.test_the_repository_name_is_replaced_by_a_placeholder compares b'...{repo}/issues\r\n' against b'...\n'. Linux (CI) is green, so this is developer experience, not release safety -- but a permanently red suite behind a documented command (python3 -m unittest discover -s .github/buildcheck/tests -t .github in CLAUDE.md) teaches people to ignore failures, the opposite of what every other guard here is for.
  • The checker is not at fault, so it is not touched. sharedfiles.content() reads with "rb" and write_manifest() writes with newline="\n", both byte-exact on purpose: a CRLF difference between repositories is exactly what the checksum must find, and normalising line endings in content() would hide it. The fixture writers in the tests 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 (lines 40, 117, 160) and, in this repository only, the one in test_nativedeps.py (line 210). They are the only four text-mode writers in the suite (checked with a grep over tests/*.py); every other fixture is written "wb".
  • Cross-repo by construction. test_sharedfiles.py is line 22 of .github/shared-files.sha256, so the change goes to all four repositories with the manifest rewritten by check-shared-files.py --write in each -- which is how this was found: a change in one repository alone fails test_this_repository_matches_its_manifest and reds the shared-files job, i.e. the gate worked. Sibling PRs on the same branch name: bernardladenthin/BitcoinAddressFinder#381, bernardladenthin/srcmorph#218, bernardladenthin/streambuffer#174. Until all four are merged, the shared-files job of each warns that a sibling's default branch lists the file with a different hash; that is the documented behaviour of a sync landing in four steps, not a failure.

Test plan

  • python3 -m unittest discover -s .github/buildcheck/tests -t .github green in all four repositories (here 103, the CRLF-sensitive test included; it is the Linux half -- the Windows half is the reporter's checkout, where the suite went 102/103 before).
  • python3 .github/check-shared-files.py reports nothing in each repository against the local siblings, and the four copies of test_sharedfiles.py are byte-identical (sha256 fe36042f…).
  • The only other change per repository is the one manifest line.
  • CI green on this branch (the shared-files job may warn about the siblings until they land).

Related issues / PRs

Sibling PRs with the same change: bernardladenthin/BitcoinAddressFinder#381, bernardladenthin/srcmorph#218, bernardladenthin/streambuffer#174.

Checklist

  • I have read CONTRIBUTING.md and CODE_OF_CONDUCT.md
  • My commits follow Conventional Commits. They use the repository's usual imperative style instead.
  • No security-sensitive changes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AytmJF9faEiQEVt6eetQS2

…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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AytmJF9faEiQEVt6eetQS2
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@bernardladenthin
bernardladenthin merged commit b691325 into main Oct 9, 2026
26 of 60 checks passed
@bernardladenthin
bernardladenthin deleted the claude/hopeful-pascal-9jlbqb branch October 9, 2026 11:08

This branch had an error being deployed

1 failed and 1 active deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants