Skip to content

brew install fails — formula uses one (wrong) sha256 for all four platforms #10

Description

@zhiyue

Problem

brew install dgrr/tgcli/tgcli fails the checksum check:

Error: Formula reports different checksum:  45ffef5266f1dcae812600ae6e8eadd2942096f93fbfe28d218beac13d6010ca
       SHA-256 checksum of downloaded file: ebf5832b5251714cad2f8ec024651af995aacca6f3de9ea5d2681ed833276cd9

Root cause

Formula/tgcli.rb in dgrr/homebrew-tgcli (currently master, version "0.3.0") declares the same sha256 for all four platform binaries:

on_macos do
  on_arm   { url ".../tgcli-darwin-arm64"; sha256 "45ffef5266...c13d6010ca" }
  on_intel { url ".../tgcli-darwin-amd64"; sha256 "45ffef5266...c13d6010ca" }
end
on_linux do
  on_arm   { url ".../tgcli-linux-arm64";  sha256 "45ffef5266...c13d6010ca" }
  on_intel { url ".../tgcli-linux-amd64";  sha256 "45ffef5266...c13d6010ca" }
end

Four different-architecture binaries can't share one checksum — and 45ffef5266... in fact matches none of the released assets, so the install fails on every platform.

Actual checksums of the v0.3.0 release assets

asset real sha256
tgcli-darwin-arm64 ebf5832b5251714cad2f8ec024651af995aacca6f3de9ea5d2681ed833276cd9
tgcli-darwin-amd64 a0c95d1aebfb8953c22bbf8ef4ab3299d569eab14d87506be4c8ae56e16db526
tgcli-linux-arm64 13d43fd33cffd51094c7d4fd4e198c8b6dfe4b5503afd21f808bcc0e4cd38b0b
tgcli-linux-amd64 e15b73cdf171c5141a44442969dfaded77ec183ea837f16b125d96e57c2f1987

(via shasum -a 256 tgcli-<platform> on the GitHub release downloads)

Also

The formula is still pinned to v0.3.0 while the latest release is v0.3.7, so even after the checksums are fixed it would install an outdated version.

Suggested fix

In whatever step generates tgcli.rb, compute each asset's checksum independently (shasum -a 256 <asset>) and fill the four sha256 fields separately, and bump version on each release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions