cargo
will use Cargo.lock
to decide which dependencies to download and build.cargo update
is effectively equivalent to removing Cargo.lock
and then running cargo build
if there wasn't a cargo clean
in-between. It updates Cargo.lock
with more recent compatible versions of packages in the repo.cargo
features are supposed to be additive. This has been known to break no_std
applications.Cargo.toml
. See here for more information about what a compatible version means. I.e. if not using Cargo.lock
, cargo
will check if a newer version exists (both on disk and from the repo) before deciding what version of a crate to (possibly download and) build.cargo
works on a DAG, crates whose deps were updated as a result of cargo update
(which can happen if their Cargo.toml
s use caret versioning) will be rebuilt as well.cargo
will use the most up-to-date version from the repository.Cargo.lock
), cargo
will use the existing crate version on-disk already to satisfy the wildcard, even if its a less recent version.Cargo.lock
when I observed this behavior? See CargoDump.cargo
doesn't download/build crates if it doesn't have to. This can be demonstrated by taking a repo with dependencies still intact, making a copy of Cargo.lock
, running cargo update
, cargo build
, and then replacing the updated Cargo.lock
with the old one.Cargo.lock
already exists, cargo
will simply hard link the binary under target
to the existing old binary to "build" it.Last Updated: 2019-10-30