From 948647a9dd95bedbb8c34f0b9548e859bfc723b1 Mon Sep 17 00:00:00 2001 From: jeremiah Date: Wed, 19 Feb 2025 18:26:12 -0500 Subject: [PATCH] update documentation for changing lockfiles; change script to support mac nanaive cp function --- CONTRIBUTING.md | 9 +++------ contrib/update-lock-files.sh | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 451376049..c759dfa3e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -209,12 +209,9 @@ in Bitcoin Core, with the following exceptions: If your change requires a dependency to be upgraded you must do the following: 1. Modify `Cargo.toml` -2. Copy `Cargo-minimal.lock` to `Cargo.lock` -3. Trigger cargo to update the required entries in the lock file - use `--precise` using the minimum version number that works -4. Test your change -5. Copy `Cargo.lock` to `Cargo-minimal.lock` -6. Update `Cargo-recent.lock` if it is also behind -7. Commit both lock files together with `Cargo.toml` and your code changes +2. Run `just update-lock-files`, if necessary install `just` first with `cargo install just`. +3. Test your change +4. Commit both `Cargo-minimal.lock` and `Cargo-recent.lock` together with `Cargo.toml` and your code changes ### Unsafe code diff --git a/contrib/update-lock-files.sh b/contrib/update-lock-files.sh index 02ba1f7c8..90b186506 100755 --- a/contrib/update-lock-files.sh +++ b/contrib/update-lock-files.sh @@ -5,7 +5,7 @@ set -euo pipefail for file in Cargo-minimal.lock Cargo-recent.lock; do - cp --force "$file" Cargo.lock + cp -f "$file" Cargo.lock cargo check - cp --force Cargo.lock "$file" + cp -f Cargo.lock "$file" done