Skip to content

Commit 634e212

Browse files
fix getrandom by fixating feature when building for wasm
1 parent 53eb412 commit 634e212

File tree

2 files changed

+84
-6
lines changed

2 files changed

+84
-6
lines changed

Cargo.lock

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ categories = ["cryptography", "no-std"]
1313
keywords = ["rustls", "tls"]
1414
edition = "2021"
1515
rust-version = "1.75"
16-
resolver = "1" # Hack to enable the `custom` feature of `getrandom`
16+
resolver = "2"
1717

1818
# Ensure all dependencies + feats are mapped to crate features for correct usage
1919
# default features often have std breaking no_std and potentially other unwanted
@@ -54,21 +54,27 @@ rand_core = { version = "0.6.4", default-features = false, features = [
5454
rustls = { version = "0.23.19", default-features = false }
5555
webpki = { package = "rustls-webpki", version = "0.102.8", default-features = false, optional = true }
5656

57+
[target.'cfg(target_arch = "wasm32")'.dependencies]
58+
getrandom = { version = "0.2", features = [
59+
"js"
60+
] }
61+
5762
[dev-dependencies]
63+
bytes = { version = "1.9.0", default-features = false }
5864
# workaround to build on no_std targets
5965
getrandom = { version = "0.2", features = [
60-
"custom",
66+
"custom"
6167
] }
6268
itertools = "0.13.0"
69+
rsa = { version = "0.9.7", default-features = false, features = [
70+
"sha2",
71+
] }
72+
rustls = { version = "0.23.19", default-features = false, features = ["std"] }
6373
sha2 = { version = "0.10.8", default-features = false, features = ["oid"] }
6474
x509-cert = { version = "0.2.5", default-features = false, features = [
6575
"builder",
6676
"pem"
6777
] }
68-
rsa = { version = "0.9.7", default-features = false, features = [
69-
"sha2",
70-
] }
71-
bytes = { version = "1.9.0", default-features = false }
7278

7379
[features]
7480
default = ["std", "tls12", "zeroize", "full"]

0 commit comments

Comments
 (0)