Add a test to check bitcoin_hashes dependency#1104
Add a test to check bitcoin_hashes dependency#1104tcharding wants to merge 1 commit intorust-bitcoin:masterfrom
bitcoin_hashes dependency#1104Conversation
Recently we updated the `bitcoin_hashes` dependency without first doing so in `secp256k1`. Since `bitcoin_hashes` is an optional dependency of secp this did not show up in our CI run and was reported by a user. To prevent this from happening again we can add a test that creates two arbitrary objects, one from the `rust-bitcoin` `bitcoin_hashes` dependency and one from the `rust-secp256k1` `bitcoin_hashes` dependency then assert that they are comparable. If different versions of `bitcoin_hashes` are being used then the compiler will complain.
Ah! Good idea! 💡 |
|
Sadly, this doesn't solve the issue because when this test fails it's already too late - incompatible release of |
|
We can test rust-bitcoin with pre-release versions of rust-secp. But without this patch even that won't help. |
|
Using this check involves a bunch of manual work. |
🤔 Hmm... But surely this does help to a certain extent. For instance, if Alternatively, if the current It may be that I'm biting way more than I can chew here 😅 , because I've not got much experience with release management, but that is how I understood this check. Am I missing something? I'd love to know if there's a flaw there! Also, @tcharding, may I suggest that we add an error message here explaining briefly why it's necessary for these two to match? Otherwise, I think the failure of this check might be a bit cryptic to a new-comer like me! 😁 |
|
Ah! I think I just understood what you meant, though! The problem arises whenever there is a bump in I think this check would still be helpful for this case in the sense that it will not be possible to upgrade both So this check would've failed at 1e46eea. |
This is creative. I like it. |
The issue this test solves is updating |
The test never runs, it fails at build time if the types are from different versions. The error message looks like this: And also the file has Is that sufficient? |
Oh! I see. This is definitely explicit enough, I think. Thanks for clarifying that @tcharding! 👍 |
|
OK, so this is summary of what I understand now, LMK if I'm wrong:
I agree that such test is valuable, I just have two objections to the way it's impemented:
|
|
oo, I like the idea of running |
Ah! Didn't know this existed! Yeah, I agree: using that would be better because it's a generalization of what this is trying to achieve. Is it always the case that library mismatches are a no-go? I guess the collision/conflict wrt Could something along the lines of |
Probably there are cases where it's fine, but we can explicitly whitelist those. |
|
Closing in favour of #1114 |
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: #1104) ACKs for top commit: apoelstra: ACK cda097d Kixunil: ACK cda097d Tree-SHA512: 77f07dd5c6794b5a59293bd62bda0fe61384a30cf8258e79aca9ce32090f869f0a13929b6a7a4c35e10fc653968b12ddd4c291df9ecd0962632017f59c81d025
…ndencies 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
Draft because will not pass CI until we release secp256 v0.24.0
Recently we updated the
bitcoin_hashesdependency without first doingso in
secp256k1. Sincebitcoin_hashesis an optional dependency ofsecp this did not show up in our CI run and was reported by a user.
To prevent this from happening again we can add a test that creates two
arbitrary objects, one from the
rust-bitcoinbitcoin_hashesdependency and one from the
rust-secp256k1bitcoin_hashesdependencythen assert that they are comparable. If different versions of
bitcoin_hashesare being used then the compiler will complain.