Closed gshep closed 4 months ago
If you work with sp-io
, then you should not use the js
feature, since it clearly not a "Web" target. Instead, you should define a custom backend, which probably should use user-space CSPRNG seeded by random_seed
.
Hi,
I was playing with plonky2 for
wasm32-unknown-unknown
target without default features and found out thatgetrandom
erroneously pullsstd
in.Here is an example reproducing the issue.
Cargo.toml
```toml [package] name = "getrandom-test" version = "0.1.0" edition = "2021" [lib] crate-type = ["lib", "cdylib"] [dependencies] sp-io = { version = "30.0.0", default-features = false } getrandom = { version = "0.2", default-features = false, features = ["js"] } [features] default = ["std"] std = ["sp-io/std", "getrandom/std"] ```
src/lib.rs
```rust #![cfg_attr(not(feature = "std"), no_std)] pub const ERROR: getrandom::Error = getrandom::Error::UNSUPPORTED; extern crate sp_io; ```