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 312
312
# bootstrap)
313
313
#codegen-backends = ["llvm"]
314
314
315
+ # Flag indicating whether `libstd` calls an imported function to hande basic IO
316
+ # when targetting WebAssembly. Enable this to debug tests for the `wasm32-unknown-unknown`
317
+ # target, as without this option the test output will not be captured.
318
+ #wasm-syscall = false
319
+
315
320
# =============================================================================
316
321
# Options for specific targets
317
322
#
Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ pub struct Config {
107
107
pub debug_jemalloc : bool ,
108
108
pub use_jemalloc : bool ,
109
109
pub backtrace : bool , // support for RUST_BACKTRACE
110
+ pub wasm_syscall : bool ,
110
111
111
112
// misc
112
113
pub low_priority : bool ,
@@ -282,6 +283,7 @@ struct Rust {
282
283
test_miri : Option < bool > ,
283
284
save_toolstates : Option < String > ,
284
285
codegen_backends : Option < Vec < String > > ,
286
+ wasm_syscall : Option < bool > ,
285
287
}
286
288
287
289
/// TOML representation of how each build target is configured.
@@ -463,6 +465,7 @@ impl Config {
463
465
set ( & mut config. rust_dist_src , rust. dist_src ) ;
464
466
set ( & mut config. quiet_tests , rust. quiet_tests ) ;
465
467
set ( & mut config. test_miri , rust. test_miri ) ;
468
+ set ( & mut config. wasm_syscall , rust. wasm_syscall ) ;
466
469
config. rustc_parallel_queries = rust. experimental_parallel_queries . unwrap_or ( false ) ;
467
470
config. rustc_default_linker = rust. default_linker . clone ( ) ;
468
471
config. musl_root = rust. musl_root . clone ( ) . map ( PathBuf :: from) ;
Original file line number Diff line number Diff line change @@ -423,6 +423,9 @@ impl Build {
423
423
if self . config . profiler {
424
424
features. push_str ( " profiler" ) ;
425
425
}
426
+ if self . config . wasm_syscall {
427
+ features. push_str ( " wasm_syscall" ) ;
428
+ }
426
429
features
427
430
}
428
431
Original file line number Diff line number Diff line change @@ -1286,6 +1286,14 @@ impl Step for Crate {
1286
1286
cargo. env ( format ! ( "CARGO_TARGET_{}_RUNNER" , envify( & target) ) ,
1287
1287
build. config . nodejs . as_ref ( ) . expect ( "nodejs not configured" ) ) ;
1288
1288
} else if target. starts_with ( "wasm32" ) {
1289
+ // Warn about running tests without the `wasm_syscall` feature enabled.
1290
+ // The javascript shim implements the syscall interface so that test
1291
+ // output can be correctly reported.
1292
+ if !build. config . wasm_syscall {
1293
+ println ! ( "Libstd was built without `wasm_syscall` feature enabled: \
1294
+ test output may not be visible.") ;
1295
+ }
1296
+
1289
1297
// On the wasm32-unknown-unknown target we're using LTO which is
1290
1298
// incompatible with `-C prefer-dynamic`, so disable that here
1291
1299
cargo. env ( "RUSTC_NO_PREFER_DYNAMIC" , "1" ) ;
You can’t perform that action at this time.
0 commit comments