Skip to content

Commit b336188

Browse files
committed
Merge rust-bitcoin#5028: Use recent lock file when checking API files
e8c42a7 Use recent lock file when checking API files (Tobin C. Harding) Pull request description: Recently we added `--locked` to all the `cargo` invocations in the script to check API text files. But if one has an updated lock file (newer than recent) then this achieves nothing. I.e., if one has run `cargo` _without_ `--locked` then the local lock file will have deps that are too new (*cough* serde I'm looking at you). Copy the recent lock file into place when the script is run locally but preserve the lock file state once the script is finished running. ACKs for top commit: apoelstra: ACK e8c42a7; successfully ran local tests Tree-SHA512: 032238d30db2afa87c44b5a77e870b0052e96c2bdf76b18ba00a642c929ef859a7da9966213e0d21c572e34039a137cb5876af45f3f3481c44b0640384e38fb7
2 parents f2e544e + e8c42a7 commit b336188

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

contrib/check-for-api-changes.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,18 @@ main() {
2424
need_nightly
2525
need_cargo_public_api
2626

27+
# If script is running in CI the recent lock file is copied into place
28+
# already by the github action job. Locally be kind to the environment.
29+
if [ "${GITHUB_ACTIONS:-}" != "true" ]; then
30+
[ -f "Cargo.lock" ] && mv Cargo.lock Cargo.lock.tmp
31+
cp Cargo-recent.lock Cargo.lock
32+
fi
33+
2734
# Just check crates that are stabilising.
2835
generate_api_files "units"
2936

37+
[ -f "Cargo.lock.tmp" ] && mv Cargo.lock.tmp Cargo.lock
38+
3039
check_for_changes
3140
}
3241

0 commit comments

Comments
 (0)