Skip to content

Commit e9939e9

Browse files
committed
Merge rust-bitcoin/rust-bitcoin#1114: Add ci check for duplicate dependencies
cda097d Add ci check for duplicate dependencies (Tobin C. Harding) Pull request description: Add a call to `cargo tree --duplicates` in the ci script to ensure that we do not have any duplicated dependencies. Kudos to Kixunil for the idea (over in: rust-bitcoin/rust-bitcoin#1104) ACKs for top commit: apoelstra: ACK cda097d Kixunil: ACK cda097d Tree-SHA512: 77f07dd5c6794b5a59293bd62bda0fe61384a30cf8258e79aca9ce32090f869f0a13929b6a7a4c35e10fc653968b12ddd4c291df9ecd0962632017f59c81d025
2 parents 6a45ebf + b2c48d0 commit e9939e9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

contrib/test.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ if cargo --version | grep nightly; then
2222
NIGHTLY=true
2323
fi
2424

25+
# We should not have any duplicate dependencies. This catches mistakes made upgrading dependencies
26+
# in one crate and not in another (e.g. upgrade bitcoin_hashes in bitcoin but not in secp).
27+
duplicate_dependencies=$(cargo tree --target=all --all-features --duplicates | wc -l)
28+
if [ "$duplicate_dependencies" -ne 0 ]; then
29+
echo "Dependency tree is broken, contains duplicates"
30+
cargo tree --target=all --all-features --duplicates
31+
exit 1
32+
fi
33+
2534
echo "********* Testing std *************"
2635
# Test without any features other than std first
2736
cargo test --verbose --no-default-features --features="std"

0 commit comments

Comments
 (0)