setup.sh: pin cargo-binstall by version and digest, not curl|bash of main - #30
Merged
Conversation
…main The cargo-binstall bootstrap piped install-from-binstall-release.sh from the upstream repository's main branch straight into bash: the one unpinned, unverified execution path in a script where every other tool is version-pinned. Now the release asset for the host platform is downloaded directly from the v1.21.1 release and verified against scripts/cargo-binstall.sha256 before it runs — the pattern js/componentize/wpt/component.sh set. A digest mismatch or an unrecorded asset fails closed; platforms without a pinned asset fall back to cargo install --locked (registry checksums). Bumping the version means re-recording the digests deliberately.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
scripts/setup.shpiped cargo-binstall'sinstall-from-binstall-release.shfrom the upstream repo'smainbranch straight into bash — the one unpinned, unverified execution path in a script where every other tool is version-pinned.Now
install_binstalldownloads the v1.21.1 release asset for the host platform directly (no bootstrap script), verifies it against the committedscripts/cargo-binstall.sha256, and fails closed on a digest mismatch or an unrecorded asset — the patternjs/componentize/wpt/component.shset. Platforms without a pinned asset fall back tocargo install --locked --version(registry checksums). Bumping the version means re-recording the digests deliberately.Verification:
~/.cargo/binand reports 1.21.1; this PR's own CI exercises the x86_64 path, since both jobs run./scripts/setup.shunziprestores the exec bitFixes #29.