@@ -10,6 +10,8 @@ use crate::{build_docs, sh, workspace, DenyWarnings, Result, NIGHTLY};
10
10
11
11
const WASM_TIMEOUT_ENV_KEY : & str = "WASM_BINDGEN_TEST_TIMEOUT" ;
12
12
const WASM_TIMEOUT_VALUE : & str = "120" ;
13
+ const RUSTFLAGS : & str = "RUSTFLAGS" ;
14
+ const GETRANDOM_BACKEND : & str = "--cfg getrandom_backend=\" wasm_js\" " ;
13
15
14
16
#[ derive( Args ) ]
15
17
pub struct CiArgs {
@@ -330,6 +332,7 @@ fn run_wasm_checks(cmd: Option<WasmFeatureSet>) -> Result<()> {
330
332
cmd ! ( sh, "rustup run stable cargo clippy --target wasm32-unknown-unknown" )
331
333
. args ( arg_set. split_whitespace ( ) )
332
334
. args ( [ "--" , "-D" , "warnings" ] )
335
+ . env ( RUSTFLAGS , GETRANDOM_BACKEND )
333
336
. env ( WASM_TIMEOUT_ENV_KEY , WASM_TIMEOUT_VALUE )
334
337
. run ( )
335
338
} ;
@@ -394,10 +397,12 @@ fn run_wasm_pack_tests(cmd: Option<WasmFeatureSet>) -> Result<()> {
394
397
cmd ! ( sh, "pwd" ) . env ( WASM_TIMEOUT_ENV_KEY , WASM_TIMEOUT_VALUE ) . run ( ) ?; // print dir so we know what might have failed
395
398
cmd ! ( sh, "wasm-pack test --node -- " )
396
399
. args ( arg_set. split_whitespace ( ) )
400
+ . env ( RUSTFLAGS , GETRANDOM_BACKEND )
397
401
. env ( WASM_TIMEOUT_ENV_KEY , WASM_TIMEOUT_VALUE )
398
402
. run ( ) ?;
399
403
cmd ! ( sh, "wasm-pack test --firefox --headless --" )
400
404
. args ( arg_set. split_whitespace ( ) )
405
+ . env ( RUSTFLAGS , GETRANDOM_BACKEND )
401
406
. env ( WASM_TIMEOUT_ENV_KEY , WASM_TIMEOUT_VALUE )
402
407
. run ( )
403
408
} ;
0 commit comments