Repository navigation
feat(release): install release archives with cargo binstall - #2764
Conversation
Each binary crate (decdn-cli, decdn-node, sponsord, sponsord-onramp) now carries [package.metadata.binstall] naming the archive release.yml attaches to the GitHub Release, so `cargo binstall <crate>` downloads it instead of compiling. decdn-cli needs an explicit pkg-url: its archive is named for the `decdn` binary, which no default binstall pattern matches. The fallback to third-party cargo-quickinstall builds is disabled; a target with no archive compiles from source. check-binstall-metadata.sh renders each crate's pkg-url, pkg-fmt and bin-dir for every target the build-binaries matrix ships and fails on drift, in the packaging job and pre-commit. decdn self-update names `cargo binstall` next to `cargo install` when it refuses a binary in a cargo bin directory. Co-Authored-By: Claude Opus 5.5 <[email protected]>
dcc8991 to
2e3c566
Compare
Gas snapshotNo gas changes vs base. |
There was a problem hiding this comment.
🟡 Changes recommended
The metadata guard silently skips valid flow-style matrix rows, allowing it to pass despite incorrect archive URLs and formats for unchecked targets.
1 open issue
What changed in this PR
This PR enables cargo binstall to install deCDN’s release archives instead of compiling supported targets, and adds checks to keep package metadata aligned with the release matrix.
Changes:
- Add archive metadata for all four binary crates, with Windows overrides where applicable and third-party builds disabled.
- Add a metadata guard, regression tests, and CI/pre-commit integration.
- Update installation guidance and self-update messages, including the current signature-verification limitation.
| File | Description |
|---|---|
SECURITY.md |
Documents binstall’s trust model and manual signature verification. |
README.md |
Updates installation and self-update guidance. |
crates/sponsord/Cargo.toml |
Adds sponsorship daemon archive metadata. |
crates/sponsord-onramp/Cargo.toml |
Adds onramp archive metadata. |
crates/node/README.md |
Documents installation with binstall. |
crates/node/Cargo.toml |
Adds node archive metadata and Windows overrides. |
crates/cli/tests/self_update_cli.rs |
Checks that update advice includes binstall. |
crates/cli/src/commands/self_update/mod.rs |
Names both Cargo installation commands in update advice. |
crates/cli/src/commands/self_update/install.rs |
Updates ownership comments to include binstall. |
crates/cli/README.md |
Documents installation with binstall. |
crates/cli/Cargo.toml |
Maps the CLI crate to decdn archives. |
CHANGELOG.md |
Records archive installation support. |
.pre-commit-config.yaml |
Registers the metadata guard. |
.github/workflows/ci.yml |
Runs the guard in the packaging job. |
.github/scripts/tests/test_check_binstall_metadata.py |
Adds metadata validation and parser regression tests. |
.github/scripts/check-binstall-metadata.sh |
Provides the guard’s shell entry point. |
.github/scripts/check_binstall_metadata.py |
Validates binstall metadata against the release matrix. |
Review effort: Balanced
Code coverage overviewLanguages: Rust, Solidity Rust / code-coverage/cargo-llvm-cov
View coverage of the 3 most impacted files.
Solidity / code-coverage/forge
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
The release-matrix line reader skipped any line inside `include:` that was
not `key: value`, so a flow-style row (`- {target: …, archive: zip}`) went
unchecked while the rows around it passed. Every non-blank line inside
`include:` must now be a `key: value` scalar of a block-style row, at the
row's key indent; a flow row, a nested map or list, a block scalar, an empty
value or a key before the first row is an error naming the line.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The guard filled pkg-url, pkg-fmt and bin-dir from one placeholder set, so
`{ bin }` in pkg-url passed while binstall fails to render it and compiles
from source. Each key now gets the placeholders binstall offers it: pkg-url
has no `{ bin }`, bin-dir has no archive placeholders, `{ format }` is the
archive format in one and the binary extension in the other, and a tgz
archive may be spelled `tgz` or `tar.gz`, as binstall tries both.
Windows overrides are keyed by exact target triple. cargo-binstall releases
before cfg support ignore a `cfg(target_os = …)` key and use the base
settings, so the guard now refuses one. It also refuses a non-list
`disabled-strategies`, which binstall cannot parse, and pins release.yml's
archive step lines, so renaming an archive or moving its binary there fails
too. release.yml joins the `scripts` path filter so the YAML cross-check of
the line reader runs when it changes.
Docs: the SECURITY.md binstall section says what binstall trusts and how to
verify the installed binary, since binstall keeps no archive. Install lines
and the self-update hint pass `--locked`, which binstall hands to its source
fallback. The self-update help text and ADR appendix name both cargo tools.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Review round (code, tests, comments, silent failures), addressed in e427162:
Not changed: pinning |

What
cargo binstall <crate>now installs the signed release archive instead of compiling.decdn-cli,decdn-node,sponsordandsponsord-onrampeach carry[package.metadata.binstall]. Each one names<bin>-<version>-<target>.tar.gz(.zipon Windows) under tagv<version>, with the binary at the archive root.decdn-clineeds an explicitpkg-url. Its archive is named for thedecdnbinary, and binstall's default patterns use the crate name. The other three would resolve without one, but setting it explicitly means a rename can't silently fall back to binstall's pattern guessing.disabled-strategies = ["quick-install"]: binstall never installs a third-party cargo-quickinstall build. A target with no archive compiles from source (sponsord* off Linux, decdn-node on Windows ARM64)..github/scripts/check-binstall-metadata.sh, run in thepackagingjob and pre-commit. It reads release.yml'sbuild-binariesmatrix and renders each crate'spkg-url,pkg-fmtandbin-dirfor every target it ships, including overrides. It fails on any mismatch, and on binstall metadata for a crate the matrix doesn't build.decdn self-updaterefuses a binary in~/.cargo/bin. That message used to name onlycargo install --locked decdn-cli, which is wrong advice for a binstall user. It now names both commands.Follow-up PR: minisign each archive and add
[package.metadata.binstall.signing], so binstall verifies what it installs. Until then binstall checks only TLS to GitHub; SECURITY.md says so.Reviewer notes
check_workspace_manifests.py(same wrapper, version guard andmain).Verification
cargo binstall --manifest-path crates/cli --strategies crate-meta-data --root <tmp> --no-confirm decdn-cliinstalleddecdn 0.2.0. The same forcrates/nodeinstalleddecdn-node 0.2.0.--targets x86_64-pc-windows-msvc,aarch64-pc-windows-msvcandaarch64-apple-darwinall resolved to the release archive (decdn.exefrom the zip on Windows).aarch64-pc-windows-msvc, which has no archive, fails with "Fallback to cargo-install is disabled" and doesn't fetch a third-party build..github/scripts/check-binstall-metadata.sh:binstall metadata OK (15 archives across 6 targets), which matches release.yml'sEXPECTED_ARCHIVES. Mutations on the real repo fail it: a renamed matrix binary, andquick-installremoved from one crate.uvx --with pyyaml pytest .github/scripts/tests scripts/tests: 337 passed (23 new).cargo nextest run -p decdn-cli --test self_update_cli: 4 passed.cargo clippy -p decdn-cli --all-targetsis clean.pre-commit runon the changed files passes. The cargo-deny RUSTSEC-2026-0387 finding is pre-existing and warn-only.Always:
pre-commit run(changed files)CARGO_BUILD_WARNINGS=deny cargo clippy --workspace --all-targets --all-features(left to CI; onlydecdn-cliRust changed, and it was clippy'd locally)cargo nextest run(left to CI; ran the touchedself_update_clisuite)Only if touched:
CHANGELOG.mdentry added🤖 Generated with Claude Code