Closed Ujang360 closed 9 months ago
Yes, the getrandom crate could do various things, not all of which are std.
Anything else? I'll publish this version if no.
Anything else? I'll publish this version if no.
Wow that was fast! Nothing else, and yes
please 🙏🏽
done
Thank you very much @burdges
Problem Background
I'm developing a
no_std
library that requires schnorrkel. I includedschnorrkel = { version = "0.11.2", default-features = false }
in theCargo.toml
file, but this test failed because of the lines bellow got triggered:https://github.com/w3f/schnorrkel/blob/38035b50f49ecc40e10831bb8c11b59c143b7aa9/src/lib.rs#L237-L251
So I added the
getrandom
features, likeschnorrkel = { version = "0.11.2", default-features = false, features = ["getrandom"] }
. But, thegetrandom
feature enablesrand/std_rng
, which then breaks the#![no_std]
build.😢
Proposed Fix
On my local test, removing
rand/std_rng
ingetrandom
feature solves the problem.https://github.com/w3f/schnorrkel/blob/38035b50f49ecc40e10831bb8c11b59c143b7aa9/Cargo.toml#L55
Dependencies Tree Before Removing
rand/std_rng
command: cargo tree -e features,no-dev,no-build
Dependencies Tree After Removing
rand/std_rng
command: cargo tree -e features,no-dev,no-build
Extra Note
This is my test commands: