Skip to content

fix(release): patch the correct stanza's sha256 when updating darwin cask - #86

Closed
mpeter wants to merge 1 commit into
unbound-force:mainfrom
mpeter:fix/homebrew-cask-checksum-patch
Closed

fix(release): patch the correct stanza's sha256 when updating darwin cask#86
mpeter wants to merge 1 commit into
unbound-force:mainfrom
mpeter:fix/homebrew-cask-checksum-patch

Conversation

@mpeter

@mpeter mpeter commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Bug

sign-macos job's cask-patch AWK script scans forward from the darwin_arm64 marker for the next sha256 line to replace. But each stanza's sha256 line comes before its url line, so by the time the script matches darwin_arm64, that stanza's own sha256 is already behind it — the next sha256 it finds belongs to the following stanza (on_linux > on_intel, i.e. linux_amd64).

Confirmed on the published v0.5.0 cask: linux_amd64's checksum is 33683ca5..., which is actually the signed darwin_arm64 checksum from checksums.txt. Darwin's own line still carries ea3278e2..., the pre-signing hash. brew upgrade on Linux fails with a checksum mismatch as a result.

Fix

Track the most recently seen sha256 line number per stanza and patch that line when the darwin_arm64 marker is hit, instead of scanning forward.

Verified against the real v0.5.0 replicator.rb release asset with the actual signed ARM64_SHA from that run — the fixed script now leaves linux_amd64/linux_arm64 untouched and puts the signed hash on darwin's own line.

Not in scope of this PR

The already-published v0.5.0 tap entry (unbound-force/homebrew-tap) stays wrong until either it's hand-corrected or a new release re-runs this (now fixed) step. I don't have push access to homebrew-tap to fix it directly.

…cask

The cask template puts each stanza's sha256 line before its url line,
so scanning forward from the darwin_arm64 marker for the next sha256
grabbed the following stanza's (linux_amd64) line instead of darwin's
own. v0.5.0's published cask has the signed darwin checksum sitting on
the linux_amd64 line, and darwin still carries its stale unsigned hash.
@mpeter
mpeter requested a review from a team as a code owner August 22, 2026 04:28
@mpeter

mpeter commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #88, which includes the OpenSpec artifacts, fail-closed release-manifest validation, checked-in regression tests, and the final review-council fixes. Closing this narrower initial version to keep review focused on the complete change.

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