A cargo subcommand for checking and applying updates to installed executables
A cargo subcommand for checking and applying updates to installed executables
A cargo subcommand for checking and applying updates to installed executables
Firstly, ensure you have CMake and the Required Libraries™.
Then proceed as usual:
cargo install cargo-updateIf that doesn't work:
PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig,LIBSSH2_SYS_USE_PKG_CONFIG=whatever,brew, and re-try with LDFLAGS="-L/usr/local/opt/[email protected]/lib" CPPFLAGS="-I/usr/local/opt/[email protected]/include",openssl installed twice via brew,--features vendored-openssl,--features vendored-libgit2.--features vendored-libcurl.If it still doesn't work, slam open an issue or comment on one of the existing relevant ones.
| Dependency | Debian package | Fedora package | MSYS2 package |
|---|---|---|---|
libgit2 |
libgit2-dev |
libgit2-devel |
mingw-w64-x86_64-libgit2 |
libcurl |
libcurl4-*-dev |
libcurl-devel |
libcurl-devel |
libssh2 |
libssh-dev |
libssh2-devel |
mingw-w64-x86_64-libssh2 |
openssl |
libssl-dev |
openssl-devel |
mingw-w64-x86_64-openssl |
pkgconf (some platforms) |
pkgconf |
pkgconf |
mingw-w64-x86_64-pkgconf |
libsecret (non-Apple UNIX; optional, dynamically loaded as libsecret-1.so.0) |
libsecret-1-0 |
libsecret |
— |
cargo install-update -a — check for newer versions and update all installed packages.
cargo install-update crate1 crate2 ... — check for newer versions and update selected packages, will not install new packages.
For more information and examples see the manual.
cargo install-update-config -t unstable -f feature1 -d false crate — when building crate, do so with the unstable toolchain with feature1 and no default features.
For more information and examples see the manual.
cargo-update will update itself seamlessly on Linux and Windows.
On Windows the following strategy is applied:
cargo install will "replace" it and not duplicate the entry in .crates.toml)Some crates, like clippy and rustfmt, have moved from Crates.io to being a rustup component.
If you'd installed them beforehand, then added them via rustup component, they might not have been removed from the list of crates installed via cargo install,
and you might come across errors such as
…In that case, run cargo install --list to verify that they're still there and cargo uninstall them,
which will deregister the cargo versions and leave you with the rustup ones.
cargosSince 0.42.0,
cargo install cratename checks for newer versions and installs them if they exist, instead of erroring out like it does usually.
Cargo allows replacing entire registries at a time.
For example, this stanza in ~/.cargo/config will replace the default crates.io registry with the Shanghai Jiao Tong Universty's mirror:
[source.crates-io]
replace-with = "sjtu"
[source.sjtu]
registry = "https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index"cargo-update resolves this to the deepest registry, and passes --registry sjtu to cargo install.
This worked until roughly nightly-2019-08-10, but since nightly-2019-09-10 due to a Cargo regression (or feature, but it's breaking without a major version bump, so)
--registry looks into a different key, requiring this additional stanza to ensure correct updates:
[registries.sjtu]
index = "https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index"Confer the initial implementation, rewrite, final broken testcase and final debug implementation threads (h/t @DCJanus for help debugging and testcases, also dealing with me as I slowly spiraled into insanity).
All providers as of Cargo 1.85.1 (default cargo:token-but-it-doesn't-read-the-environment, cargo:token, cargo:token-from-stdout, cargo:wincred (Win32), cargo:macos-keychain (Apple), cargo:libsecret (non-Apple UNIX), provider protocol (not cargo:-prefixed)) are implemented.
The provider protocol does not care about "cache", "expiration", or "operation_independent", always behaving as-if "never"/_/true.
It never gets the optional {"registry": {"headers": ...}} field.
To all who support further development on Patreon, in particular:
No open issues yet, or sync has not completed.