Skip to content
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

Hot Fix: Enable "rand/std_rng" feature #460

Merged
merged 2 commits into from
Jun 24, 2022

Conversation

tcharding
Copy link
Member

@tcharding tcharding commented Jun 24, 2022

Hot fix because currently attempting to use secp256 v0.23.0 as a dependency throws a secp build error.

We recently upgraded the rand dependency and we use it behind code feature gated on "rand-std". In that code we use thread_rng but this is only available if the "std_rng" feature is turned on, however in non-dev builds we do not enable this feature, we have a "rand-std" feature that enables "rand/std", it should also enable "std_rng".

Enable "rand/std_rng" in the "rand-std" feature.

I threw a version bump patch on this too in case we want to merge and release this fix (assuming I'm not mistaken about the 0.23.0 release), its Friday afternoon right now for me so if you want to forge ahead feel free to do what ever needs doing, don't wait for me and this PR :)

We recently upgraded the rand dependency and we use it behind code
feature gated on "rand-std". In that code we use `thread_rng` but this
is only available if the "std_rng" feature is turned on, however in
non-dev builds we do not enable this feature, we have a "rand-std"
feature that enables "rand/std", it should also enable "std_rng".

Enable "rand/std_rng" in the "rand-std" feature.
@tcharding
Copy link
Member Author

This fail shows we either need to work out how to build a Rust library without using the dev-dependencies (I did a quick search and couldn't see a way) or we need to build rust-bitcoin with the a rust-secp256k1 release-candidate.

We just applied a hot fix to the 0.23.0 released code to fix the
features enabled in `rand` when our "rand-std" feature is enabled. This
requires a bump of the patch version for release.

Bump the version and add a changelog entry.
@sanket1729
Copy link
Member

we either need to work out how to build a Rust library without using the dev-dependencies (I did a quick search and couldn't see a way)

I am surprised to learn this :(

@tcharding
Copy link
Member Author

I literally only looked for two minutes, I rekon there should be a way to achieve this. I did try to build a release version hoping that would trigger the error but no dice.

@apoelstra
Copy link
Member

I'm not surprised, this is one of many longstanding cargo design issues.

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 4e44abc

@apoelstra apoelstra merged commit 8d84857 into rust-bitcoin:master Jun 24, 2022
@tcharding tcharding deleted the 06-24-fix-rand-dependency branch June 28, 2022 01:50
@tcharding tcharding changed the title HOT FIX: Enable "rand/std_rng" feature Hot Fix: Enable "rand/std_rng" feature Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants