-
Notifications
You must be signed in to change notification settings - Fork 71
Enable bitcoin_hashes v0.14.0
#76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
cc @afilini |
|
ACK, that would be helpful for me, all the other libs like rust-bitcoin and bdk have already upgraded to hashes 0.14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be nice for me even just for cleanness sake.
Cargo.toml
Outdated
| # Enabling the "rand" feature by default to run the benches | ||
| bip39 = { path = ".", features = ["rand"] } | ||
| bitcoin_hashes = ">=0.12,<0.14" # enable default features for test | ||
| bitcoin_hashes = ">=0.12,<=0.14" # enable default features for test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must be >= 0.12, <0.15, otherwise 0.14.1 will be unusable even though it'd be compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wow, TIL. Will fix, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to go right ahead and 'trust don't verify'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The verification is easy, just evaluate 0 < 1 expression in your head. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I thought we were talking about 0.14 working for 0.14.0 but not for 0.14.1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.14 implies 0.14.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I have no idea what you were talking about in your original comment then. <= 14 is equivalent to < 15
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not. 0.14 == 0.14.0
0.14.1 > 0.14.0
0.14.1 < 0.15.0
And the above implies 0.14.1 > 0.14 which is a negation of 0.14.1 <= 0.14
So for <= 14 to be equivalent to < 15 we require all x to satisfy x <= 0.14 <-> x <0.15 and we have a counter example for x = 0.14.1. QED
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get it now. Seems the confusion started when I wrote "I'm going to go right ahead and 'trust don't verify'." and I have no clue what I was thinking then. Your original review comment is actually perfectly clean.
Just call me retarded :)
Cargo.toml
Outdated
|
|
||
| # Unexported dependnecies | ||
| bitcoin_hashes = { version = ">=0.12, <=0.13", default-features = false } | ||
| bitcoin_hashes = { version = ">=0.12, <=0.14", default-features = false } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also needs to be <0.15, it was already broken.
46ef0ed to
2b47d40
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 2b47d40
|
Oh this PR is no good anyway, |
|
Raised #79 to discuss the MSRV bump. Converting to draft until that resolves. |
|
Is this a MSRV bump? Anyone who wants an older MSRV can use an older version of As someone who currently has two copies of |
|
@kayabaNerve that line wouldn't be great, better jut use |
|
Precise updates get overriden upon the next call to update. A line in the toml, next to the line adding this very crate as a dependency, would pin it. That's why I said what I said. It's irrelevant to the larger point I don't believe this is a MSRV break and should be able to move forward regardless though. |
MSRV doesn't get bumped on update if you use recent cargo. But yes, this is not MSRV break in the sense that it'd justify major version. |
|
Could you take this PR out of draft and merge and release please? 😄 Seems like a simple change and I need it for the reason @tcharding outlined. |
I second this. The simplest fix is resting on the shelf for more than a year now. Maintainer, please do the v2.2.1 release. |
|
Ping @tcharding @stevenroose, please let's merge, it's a simple change and very much needed. Thanks |
|
I'm not a maintainer here sorry mate. If you have a direct link to Steven you could hassle him. |
|
@tcharding I guess the first step would be for you to rebase it (there are conflicts) and take it out of draft. |
1ca2e1b to
26683c2
Compare
|
No sweat, done. |
|
Oh this cannot be undrafted because of the MSRV bump. At the risk of being rude, and @stevenroose you can slap me in person when you see me next, I'd suggest one of the following:
I'm not the don of the rust-bitcoin org but I do feel in someway responsible that we have crates in the org that are not maintained. I don't know the solution to that problem. No one is required to do anything round here, so props to Steven for writing the crate, and all due respect. |
5994a4c to
1357566
Compare
bitcoin_hashes v0.14.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would like to clarify if the README.md changes were intentional before merging, I have a strong suspicion that they weren't and the described pinning isn't sufficient.
1357566 to
e30b544
Compare
@apoelstra can you add @elsirion and @tnull as a maintainers please. @stevenroose has confirmed this by signal message with me. He has added them both as owners on crates.io already. @tnull said he would message you directly on signal also about this. For anyone reading @stevenroose does not check GitHub notifications so will likely not read this message any time soon. You'll just have to believe me that I talked with him. |
This via signal from @tnull to me. |
Docs were fixed, still need to test MSRV though, so no full ACK yet.
Good eye, thanks. I've added 4 MSRV jobs which is pretty ugly but should get the coverage we want. |
Can confirm I was added now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good, one nit, one comment.
|
|
||
| When using older version of Rust, you might have to pin the versions of several crates, for an up-to-date list refer to [`contrib/test.sh`](contrib/test.sh): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Spurious whitespace here.
contrib/test.sh
Outdated
| fi | ||
|
|
||
| # Pin dependencies as required if we are using MSRV toolchain. | ||
| if cargo --version | grep "1\.48"; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No super strong opinion, but in LDK we use such a pattern (just an example, see https://github.com/lightningdevkit/rust-lightning/blob/0.2/ci/ci-tests.sh):
RUSTC_MINOR_VERSION=$(rustc --version | awk '{ split($2,a,"."); print a[2] }')
# The backtrace v0.3.75 crate relies on rustc 1.82
[ "$RUSTC_MINOR_VERSION" -lt 82 ] && cargo update -p backtrace --precise "0.3.74" --verboseSeems this could be a bit cleaner/less error prone if we start handling even more different rust versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just hope that once we hit rust version 1.480 in 45 years we won't be testing 1.48 anymore 😆
b3f9c4d to
a20b9fa
Compare
|
Used new syntax as suggested and fixed up the github action job names. |
1a83c40 to
ec024a8
Compare
|
And used valid Rust versions, will fix pinning ... |
ec024a8 to
649c990
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems CI is still broken due to dependency/pinning foo.
|
Is any one waiting on this that wants to work it out? I f**king hate pinning. |
Hmm, honestly not so much the actual changes, but having the additional CI coverage would be nice. But no huge rush rn. |
e3144d2 to
d80f73a
Compare
|
Instead of pinning I found a lock file that works for 1.41 and 1.48 and committed those, then used the 1.48 lock file for all the MSRV versions tested. |
d80f73a to
ead6f20
Compare
Hardware devices like the smallest binary possible, currently if one builds with `rust-bitcoin v0.32` and `rust-bip39` they get two versions of `bitcoin_hashes` in the dependency graph because we don't support `bitcoin_hashes v0.14`. Note that using `bitcoin_hashes 0.14` bumps the MSRV to Rust v1.56.1
ead6f20 to
56f25a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of pinning I found a lock file that works for 1.41 and 1.48 and committed those, then used the 1.48 lock file for all the MSRV versions tested.
Hmm, not quite sure if I prefer that approach, especially given that we point users to test.sh for pinning instructions to make this work under a specific MSRV. And now, we don't pin there. If you prefer not to deal with the the pinning part, we can just land this (maybe only the first commit)? And I can take it from there.
| - `bitcoin_hashes v0.13`: MSRV `v1.48.0` | ||
| - `bitcoin_hashes v0.14`: MSRV `v1.56.0` | ||
|
|
||
| When using older version of Rust, you might have to pin the versions of several crates, for an up-to-date list refer to [`contrib/test.sh`](contrib/test.sh): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We refer here to test.sh for pinning instructions, and now there aren't any anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh dear, good eye. Thanks man, will fix.
20a77f1 to
14b4f8c
Compare
Great, I have zero interest in pinning or in this crate at all so I"d really appreciate not having to touch this PR anymore. Thanks for the offer. I've remove the second patch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, LGTM mod one comment regarding the added pins.sh.
Can revisit extending MSRV test coverage in CI as a follow-up sometime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems this file isn't used anywhere? Can we drop it for now?

Hardware devices like the smallest binary possible, currently if one builds with latest
rust-bitcoinandrust-bip39they get two versions ofbitcoin_hashesin the dependency graph because we don't support the latestbitcoin_hashes.Note using the latest version causes the MSRV to increase to
Rust v0.56.1.