File tree 4 files changed +19
-0
lines changed
4 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 305
305
# result (broken, compiling, testing) into this JSON file.
306
306
#save-toolstates = "/path/to/toolstates.json"
307
307
308
+ # Flag indicating whether `libstd` calls an imported function to hande basic IO
309
+ # when targetting WebAssembly. Enable this to debug tests for the `wasm32-unknown-unknown`
310
+ # target, as without this option the test output will not be captured.
311
+ #wasm-syscall = false
312
+
308
313
# =============================================================================
309
314
# Options for specific targets
310
315
#
Original file line number Diff line number Diff line change @@ -1240,6 +1240,14 @@ impl Step for Crate {
1240
1240
cargo. env ( format ! ( "CARGO_TARGET_{}_RUNNER" , envify( & target) ) ,
1241
1241
build. config . nodejs . as_ref ( ) . expect ( "nodejs not configured" ) ) ;
1242
1242
} else if target. starts_with ( "wasm32" ) {
1243
+ // Warn about running tests without the `wasm_syscall` feature enabled.
1244
+ // The javascript shim implements the syscall interface so that test
1245
+ // output can be correctly reported.
1246
+ if !build. config . wasm_syscall {
1247
+ println ! ( "Libstd was built without `wasm_syscall` feature enabled: \
1248
+ test output may not be visible.") ;
1249
+ }
1250
+
1243
1251
// On the wasm32-unknown-unknown target we're using LTO which is
1244
1252
// incompatible with `-C prefer-dynamic`, so disable that here
1245
1253
cargo. env ( "RUSTC_NO_PREFER_DYNAMIC" , "1" ) ;
Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ pub struct Config {
106
106
pub debug_jemalloc : bool ,
107
107
pub use_jemalloc : bool ,
108
108
pub backtrace : bool , // support for RUST_BACKTRACE
109
+ pub wasm_syscall : bool ,
109
110
110
111
// misc
111
112
pub low_priority : bool ,
@@ -281,6 +282,7 @@ struct Rust {
281
282
quiet_tests : Option < bool > ,
282
283
test_miri : Option < bool > ,
283
284
save_toolstates : Option < String > ,
285
+ wasm_syscall : Option < bool > ,
284
286
}
285
287
286
288
/// TOML representation of how each build target is configured.
@@ -461,6 +463,7 @@ impl Config {
461
463
set ( & mut config. rust_dist_src , rust. dist_src ) ;
462
464
set ( & mut config. quiet_tests , rust. quiet_tests ) ;
463
465
set ( & mut config. test_miri , rust. test_miri ) ;
466
+ set ( & mut config. wasm_syscall , rust. wasm_syscall ) ;
464
467
config. rustc_parallel_queries = rust. experimental_parallel_queries . unwrap_or ( false ) ;
465
468
config. rustc_default_linker = rust. default_linker . clone ( ) ;
466
469
config. musl_root = rust. musl_root . clone ( ) . map ( PathBuf :: from) ;
Original file line number Diff line number Diff line change @@ -420,6 +420,9 @@ impl Build {
420
420
if self . config . profiler {
421
421
features. push_str ( " profiler" ) ;
422
422
}
423
+ if self . config . wasm_syscall {
424
+ features. push_str ( " wasm_syscall" ) ;
425
+ }
423
426
features
424
427
}
425
428
You can’t perform that action at this time.
0 commit comments