Skip to content

fix: install.sh sha256 URL + error handling - #10

Merged
wavekat-eason merged 1 commit into
mainfrom
fix/install-sh-sha-url
Apr 28, 2026
Merged

fix: install.sh sha256 URL + error handling#10
wavekat-eason merged 1 commit into
mainfrom
fix/install-sh-sha-url

Conversation

@wavekat-eason

Copy link
Copy Markdown
Contributor

Summary

Three install.sh bugs surfaced when v0.0.5 became the first release with all assets actually attached and a real user ran the curl|sh path:

  1. Wrong checksum URL. Script built `.tar.gz.sha256`, but `taiki-e/upload-rust-binary-action` uploads the checksum as `--.sha256` (no `.tar.gz`). Build the correct name explicitly.
  2. Swallowed fetch failures. `sha=$(fetch_stdout … | awk …)` masks curl's exit status — a 404 produced an empty `sha` and the confusing `checksum mismatch (expected , got …)` we saw in the wild. Capture the body first, then awk, then check non-empty.
  3. Variable shadowing in `verify_sha256`. POSIX `sh` has no `local`; `archive="$1"` clobbered the caller's `$archive`, so once feat: browser login + table views + colour + release-plz #1 and chore: release v0.0.2 #2 were fixed `tar` got a doubled path. Rename the locals.

Test plan

  • Verified locally against v0.0.5 on aarch64-apple-darwin: `WK_INSTALL_DIR=/tmp/x sh ./install.sh` succeeds and the installed `wk --version` runs.
  • After merge, install.sh attached to v0.0.6 (or whatever release-plz cuts next) should work end-to-end on macOS arm64/x86_64 and Linux x86_64/arm64.

🤖 Generated with Claude Code

The script built the checksum URL as <archive>.tar.gz.sha256, but
taiki-e/upload-rust-binary-action uploads it as <bin>-<tag>-<target>.sha256
(without the .tar.gz). Build the right name explicitly.

Also:
- Capture the checksum body before piping into awk so a 404 actually
  errors out instead of silently producing an empty sha and a
  confusing "checksum mismatch (expected , got …)" message.
- Rename the locals in verify_sha256 to avoid clobbering the caller's
  $archive (POSIX sh has no `local`); this was causing tar to receive
  a doubled-up path once the script got past the earlier failures.

Verified end-to-end against v0.0.5 on aarch64-apple-darwin.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wavekat-eason
wavekat-eason merged commit f2c3f5e into main Apr 28, 2026
1 check passed
@wavekat-eason
wavekat-eason deleted the fix/install-sh-sha-url branch April 28, 2026 03:51
@github-actions github-actions Bot mentioned this pull request Apr 28, 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.

1 participant