Check if the `Cargo.lock` is up to date without building anything

cargo update -w --locked
  • The -w / --workspace is thety key element that shall make the Cargo.lock bump be as minimal as possible, much like cargo check/build/... do :slight_smile:

  • On older Cargo, I guess you could achieve the same by using -p your-own-package.

  • When dealing with multiple workspaces:

    find . -type f -name 'Cargo.lock' -print0 \
    | while IFS=$'\0' read -r -d '' file; do
        (set -x; cd "$(dirname "$file")" && cargo update -w --locked)
    done
    
  • When wanting to update (minimally), I recommend instead to replace --locked with -v: -w -v.