Merge rust-bitcoin/rust-bitcoin#4084: documentation: update instructions for building lock files

948647a9dd update documentation for changing lockfiles; change script to support mac nanaive cp function (jeremiah)

Pull request description:

  1. Updates `CONTRIBUTING.md` with latest instructions on using `just` to create new lock files. See discussion [here](https://github.com/rust-bitcoin/rust-bitcoin/pull/4045/files).
  2. For the command `cp`,  `--force` is not an option on the Mac. Changed to `-f` which as far as I can tell is equivalent.

  ```
  ➜  rust-bitcoin git:(jr_update_contrib) ✗ cp --force
  cp: illegal option -- -
  ```

ACKs for top commit:
  tcharding:
    ACK 948647a9dd
  Kixunil:
    ACK 948647a9dd
  apoelstra:
    ACK 948647a9dd95bedbb8c34f0b9548e859bfc723b1; successfully ran local tests

Tree-SHA512: a9486ec323b15a9cfa78cd70332e153881537ec8fd26e6e23f8b61ed2272251271299723e9aa390542044588357ec072eb1559cd5e32cb707757f58361a6fb05
This commit is contained in:
merge-script 2025-02-23 14:39:44 +00:00
commit 38e9bf841e
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
2 changed files with 5 additions and 8 deletions

View File

@ -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: If your change requires a dependency to be upgraded you must do the following:
1. Modify `Cargo.toml` 1. Modify `Cargo.toml`
2. Copy `Cargo-minimal.lock` to `Cargo.lock` 2. Run `just update-lock-files`, if necessary install `just` first with `cargo install just`.
3. Trigger cargo to update the required entries in the lock file - use `--precise` using the minimum version number that works 3. Test your change
4. Test your change 4. Commit both `Cargo-minimal.lock` and `Cargo-recent.lock` together with `Cargo.toml` and your code changes
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
### Unsafe code ### Unsafe code

View File

@ -5,7 +5,7 @@
set -euo pipefail set -euo pipefail
for file in Cargo-minimal.lock Cargo-recent.lock; do for file in Cargo-minimal.lock Cargo-recent.lock; do
cp --force "$file" Cargo.lock cp -f "$file" Cargo.lock
cargo check cargo check
cp --force Cargo.lock "$file" cp -f Cargo.lock "$file"
done done