Skip to content

Commit 8e5a401

Browse files
Fix WASM compile test on CI (#972)
* Fix WASM compile test on CI A transitive dependency updated `getrandom`. * rustflags
1 parent a95c047 commit 8e5a401

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.cargo/config.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,9 @@ xtask = "run --package xtask --"
33

44
# circle seems to install cargo packages via ssh:// rather than https://
55
[net]
6-
git-fetch-with-cli = true
6+
git-fetch-with-cli = true
7+
8+
# WebAssembly support per https://docs.rs/getrandom/0.3.3/getrandom/#opt-in-backends
9+
# See examples/validation-wasm-demo/Cargo.toml
10+
[target.wasm32-unknown-unknown]
11+
rustflags = ['--cfg', 'getrandom_backend="wasm_js"']

examples/validation-wasm-demo/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ crate-type = ["cdylib"]
88

99
[dependencies]
1010
apollo-compiler.path = "../../crates/apollo-compiler"
11-
# https://docs.rs/getrandom/0.2.15/getrandom/index.html#webassembly-support
12-
getrandom = { version = "0.2", features = ["js"] }
11+
# https://docs.rs/getrandom/0.3.3/getrandom/index.html#webassembly-support
12+
# Works together with the rustflags configuration in `.cargo/config.toml`
13+
getrandom = { version = "0.3", features = ["wasm_js"] }
1314
wasm-bindgen = "0.2.100"

0 commit comments

Comments
 (0)