Skip to content

fix: check the wheel's sha256 in install-wheel.sh - #89

Merged
shenxianpeng merged 1 commit into
mainfrom
claude/project-thread-huu4p1
Oct 22, 2026
Merged

shenxianpeng merged 1 commit into
mainfrom
claude/project-thread-huu4p1

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Summary

install-wheel.sh (served as https://cpp-linter.github.io/install-wheel.sh) downloaded the clang-format/clang-tidy wheel without checking it.

  • After the download it now compares the file with the digest (sha256:…) that the GitHub API lists for each release asset. On a mismatch, or when the release lists no digest, it deletes the file and fails. Every current clang-tools-wheel release has digests on all assets.
  • It uses sha256sum, or shasum -a 256 on macOS, and fails if neither is installed.
  • The fallback for machines without jq only matched compact JSON ("name":"…"), but the API returns "name": "…", so it never found a wheel. The patterns now allow the space, and the fallback also reads the digest.

Testing

  • With jq and without it (a PATH with no jq): downloading the latest clang-format and clang-tidy wheels for linux x86_64 works and prints the checked sha256; --list works without jq too.
  • verify_sha256 with a wrong digest deletes the file and exits 1; with no digest it exits 1.
  • shellcheck reports the same 15 existing notes as before, none on the new lines.

The script downloaded the wheel without checking it. It now compares the
file with the sha256 digest that the GitHub API lists for the release
asset, and deletes it and fails on a mismatch or when no digest is listed.

The fallback without jq also matched only compact JSON, while the API
returns it with a space after each colon, so it never found a wheel.
@netlify

netlify Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cpp-linter-github-io ready!

Name Link
🔨 Latest commit eff5618
🔍 Latest deploy log https://app.netlify.com/projects/cpp-linter-github-io/deploys/6ada73b2e028c97376f3a6db
😎 Deploy Preview https://deploy-preview-89--cpp-linter-github-io.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@shenxianpeng
shenxianpeng merged commit 0872634 into main Oct 22, 2026
7 checks passed
@shenxianpeng
shenxianpeng deleted the claude/project-thread-huu4p1 branch October 22, 2026 21:15
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.

1 participant