Write SHA256SUMS.txt with LF so shasum -c works - #2384
Conversation
Out-File on Windows emits CRLF whatever the encoding, and shasum -c on macOS/Linux then takes the trailing carriage return as part of the FILENAME. Every entry reports "No such file or directory / FAILED open or read" -- which is exactly what a tampered or truncated download looks like, so the output says "something is wrong with this release" when nothing is. The hashes were always correct. The file simply could not be used by the tool it exists for, on the two platforms where that tool is the default -- including the audience for the linux-x64 tarball. WriteAllText with an explicit LF join also drops any BOM, which would break the first entry the same way. Anchored on $PWD because [IO.File]::WriteAllText resolves relative paths against .NET's current directory rather than PowerShell's location. SHA256SUMS-linux.txt is written by sha256sum on the Linux job and was never affected. Fixes #2383
|
Reviewed. The fix itself is correct and well-reasoned — One gap:
$checksums | Out-File -FilePath releases/SHA256SUMS.txt -Encoding utf8That's the same No other correctness/security issues found — this is a CI-only change with no SQL surface, so the T-SQL/Lite-Darling-parity conventions don't apply here. |
Both were found by asking what in this release is verified by anything other than reading the diff. The checksum fix was half-applied (#2384 fixed the release workflow, not the nightly), and the dispatch-ref bug meant the release candidate I built to soak was not the branch I dispatched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Fixes #2383, found verifying the v3.5.0 assets.
Out-Fileon Windows emits CRLF whatever the encoding, soshasum -con macOS/Linux takes the trailing carriage return as part of the filename and reports every entry asNo such file or directory / FAILED open or read. That is what a tampered or truncated download looks like — the hashes were always right, the file just could not be used by the tool it exists for, on the two platforms where that tool is the default.WriteAllTextwith an explicit LF join also avoids a BOM, which would break the first entry identically.Anchored on
$PWDdeliberately:[IO.File]::WriteAllTextresolves relative paths against .NET's current directory rather than PowerShell's location, so the barereleases/SHA256SUMS.txtthe old line used would not reliably land in the same place. That divergence is the trap in swappingOut-Filefor the .NET API.SHA256SUMS-linux.txtis written bysha256sumon the Linux job and was never affected — it verifies as published.Caveat: the step is gated on
github.event_name == 'release', so this cannot be exercised by CI and lands unverified until the next release publishes. Worth actually runningshasum -cagainst that release's checksum file rather than assuming.