Release builds should use cargo build --locked for consistent releases and optimal build cache utilisation.
Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:
The lock file is missing.
Cargo attempted to change the lock file due to a different dependency resolution.
It may be used in environments where deterministic builds are desired, such as in CI pipelines.
Release builds should use
cargo build --locked
for consistent releases and optimal build cache utilisation.