Skip to content

Write SHA-512 sibling in binary mode for cross-platform byte-identical output#317

Merged
SeanTAllen merged 1 commit into
mainfrom
fix-sha512-sibling-newline-portability
Apr 15, 2026
Merged

Write SHA-512 sibling in binary mode for cross-platform byte-identical output#317
SeanTAllen merged 1 commit into
mainfrom
fix-sha512-sibling-newline-portability

Conversation

@SeanTAllen
Copy link
Copy Markdown
Member

Python's default text mode on Windows translates \n to \r\n on write, so Windows-built archives would get CRLF-terminated .sha512 siblings while Linux and macOS produce LF. The file is meant to be the byte sequence <hex>\n and future consumers (see ponylang/ponyup#405) will byte-compare, so the asymmetry is a latent portability bug.

Switches to binary mode with explicit ASCII bytes and adds a short comment explaining why.

Defensive for corral specifically (no Windows release job today), but applied for cross-repo consistency — the same script is duplicated across corral, ponyup, ponyc, and changelog-tool pending centralization. Mirrors the fix in ponylang/ponyc#5233.

…l output

Python text mode on Windows translates '\n' to '\r\n' on write, which
would yield CRLF-terminated siblings for Windows archives while
Linux/macOS produce LF. Consumers byte-compare the file, so the
asymmetry is a latent portability bug. Mirrors ponylang/ponyc#5233.
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Apr 15, 2026
@SeanTAllen SeanTAllen merged commit d32fbca into main Apr 15, 2026
16 checks passed
@SeanTAllen SeanTAllen deleted the fix-sha512-sibling-newline-portability branch April 15, 2026 01:56
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Apr 15, 2026
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