release: cargo-binstall v1.21.1 (#2616)
This is a release PR for cargo-binstall version 1.21.1 (performing a patch bump).
Use squash merge.
Upon merging, this will automatically create the tag
v1.21.1, build the CLI, create a GitHub release with the release notes below , and CI will publish to crates.io on merge of this PR.To trigger builds initially, close and then immediately re-open this PR once.
Edit release notes into the section below:
Release notes
Binstall is a tool to fetch and install Rust-based executables as binaries. It aims to be a drop-in replacement for
cargo installin most cases. Install it today withcargo install cargo-binstall, from the binaries below, or if you already have it, upgrade withcargo binstall cargo-binstall.In this release:
- Upgrade dependencies
Co-authored-by: github-actions github-actions@github.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
Cargo B(inary)Install
Binstall provides a low-complexity mechanism for installing Rust binaries as an alternative to building from source (via
cargo install) or manually downloading packages. This is intended to work with existing CI artifacts and infrastructure, and with minimal overhead for package maintainers.Binstall works by fetching the crate information from
crates.ioand searching the linkedrepositoryfor matching releases and artifacts, falling back to the quickinstall third-party artifact host, to alternate targets as supported, and finally tocargo installas a last resort.You may want to see this page as it was when the latest version was published.
Usage
Binstall aims to be a drop-in replacement for
cargo installin many cases, and supports similar options.For unattended use (e.g. in CI), use the
--no-confirmflag. For additional options please seecargo binstall --help.Installation
If you already have it
To upgrade cargo-binstall, use
cargo binstall cargo-binstall!Quickly
Here are one-liners for downloading and installing a pre-compiled
cargo-binstallbinary.Linux and macOS
or if you have homebrew installed:
Windows
Manually
Download the relevant package for your system below, unpack it, and move the
cargo-binstallexecutable into$HOME/.cargo/bin:(both archs)
From source
With a recent Rust installed:
In GitHub Actions
We provide a first-party, minimal action that installs Binstall:
For more features, we recommend the excellent taiki-e/install-action, which has dedicated support for selected tools and uses Binstall for everything else.
Companion tools
These are useful third-party tools which work well with Binstall.
cargo-updateWhile you can upgrade crates explicitly by running
cargo binstallagain,cargo-updatetakes care of updating all tools as needed. It automatically uses Binstall to install the updates if it is present.cargo-run-binBinstall and
cargo installboth install tools globally by default, which is fine for system-wide tools. When installing tooling for a project, however, you may prefer to both scope the tools to that project and control their versions in code. That’s wherecargo-run-bincomes in, with a dedicated section in your Cargo.toml and a short cargo subcommand. When Binstall is available, it installs from binary whenever possible… and you can even manage Binstall itself withcargo-run-bin!Unsupported crates
Binstall is generally smart enough to auto-detect artifacts in most situations. However, if a package fails to install, you can manually specify the
pkg-url,bin-dir, andpkg-fmtas needed at the command line, with values as documented in SUPPORT.md.Maintainers wanting to make their users’ life easier can add explicit Binstall metadata to
Cargo.tomlto locate the appropriate binary package for a given version and target.Signatures
We have initial, limited support for maintainers to specify a signing public key and where to find package signatures. With this enabled, Binstall will download and verify signatures for that package.
You can use
--only-signedto refuse to install packages if they’re not signed.If you like to live dangerously (please don’t use this outside testing), you can use
--skip-signaturesto disable checking or even downloading signatures at all.FAQ
Why use this?
Because
wget-ing releases is frustrating,cargo installtakes a not inconsequential portion of forever on constrained devices, and often putting together actual packages is overkill.Why use the cargo manifest?
Crates already have these, and they already contain a significant portion of the required information. Also, there’s this great and woefully underused (IMO)
[package.metadata]field.Is this secure?
Yes and also no?
We have initial support for verifying signatures, but not a lot of the ecosystem produces signatures at the moment. See #1 to discuss more on this.
We always pull the metadata from crates.io over HTTPS, and verify the checksum of the crate tar. We also enforce using HTTPS with TLS >= 1.2 for the actual download of the package files.
Compared to something like a
curl ... | shscript, we’re not running arbitrary code, but of course the crate you’re downloading a package for might itself be malicious!What do the error codes mean?
You can find a full description of errors including exit codes here: https://docs.rs/binstalk/latest/binstalk/errors/enum.BinstallError.html
Are debug symbols available?
Yes! Extra pre-built packages with a
.fullsuffix are available and contain split debuginfo, documentation files, and extra binaries like thedetect-wasiutility.Telemetry collection
Some crate installation strategies may collect anonymized usage statistics by default. Currently, only the name of the crate to be installed, its version, the target platform triple, and the collecting user agent are sent to endpoints under the
https://cargo-quickinstall-stats-server.fly.dev/record-installURL when thequickinstallartifact host is used. The maintainers of thequickinstallproject use this data to determine which crate versions are most worthwhile to build and host. The aggregated collected telemetry is publicly accessible at https://alsuren.grafana.net/public-dashboards/12d4ec3edf2548a1850a813e00592b53. Should you be interested on it, the backend code for these endpoints can be found at https://github.com/cargo-bins/cargo-quickinstall/tree/main/stats-server.If you prefer not to participate in this data collection, you can opt out by any of the following methods:
--disable-telemetryflag in the command line interface.BINSTALL_DISABLE_TELEMETRYenvironment variable totrue.quickinstallstrategy with--disable-strategies quick-install, or if specifying a list of strategies to use with--strategies, avoiding includingquickinstallin that list.quick-installto thedisabled-strategiesconfiguration key in the crate metadata (refer to the related support documentation for more details).If you have ideas/contributions or anything is not working the way you expect (in which case, please include an output with
--log-level debug) and feel free to open an issue or PR.