diff options
| author | bors <bors@rust-lang.org> | 2024-03-12 00:03:54 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-12 00:03:54 +0000 |
| commit | dc2ffa405407ffb3654658c50ab3dfda124fbdfd (patch) | |
| tree | 0050efb1fe19fbec8dcb00148b1a011e1617dc16 /tests/ui/process | |
| parent | 4a0cc881dcc4d800f10672747f61a94377ff6662 (diff) | |
| parent | cf6d6050f7d1ea62c9aae54ddd345106b6e31382 (diff) | |
| download | rust-dc2ffa405407ffb3654658c50ab3dfda124fbdfd.tar.gz rust-dc2ffa405407ffb3654658c50ab3dfda124fbdfd.zip | |
Auto merge of #122036 - alexcrichton:test-wasm-with-wasi, r=oli-obk
Test wasm32-wasip1 in CI, not wasm32-unknown-unknown This commit changes CI to no longer test the `wasm32-unknown-unknown` target and instead test the `wasm32-wasip1` target. There was some discussion of this in a [Zulip thread], and the motivations for this PR are: * Runtime failures on `wasm32-unknown-unknown` print nothing, meaning all you get is "something failed". In contrast `wasm32-wasip1` can print to stdout/stderr. * The unknown-unknown target is missing lots of pieces of libstd, and while `wasm32-wasip1` is also missing some pieces (e.g. threads) it's missing fewer pieces. This means that many more tests can be run. Overall my hope is to improve the debuggability of wasm failures on CI and ideally be a bit less of a maintenance burden. This commit specifically removes the testing of `wasm32-unknown-unknown` and replaces it with testing of `wasm32-wasip1`. Along the way there were a number of other archiectural changes made as well, including: * A new `target.*.runtool` option can now be specified in `config.toml` which is passed as `--runtool` to `compiletest`. This is used to reimplement execution of WebAssembly in a less-wasm-specific fashion. * The default value for `runtool` is an ambiently located WebAssembly runtime found on the system, if any. I've implemented logic for Wasmtime. * Existing testing support for `wasm32-unknown-unknown` and Emscripten has been removed. I'm not aware of Emscripten testing being run any time recently and otherwise `wasm32-wasip1` is in theory the focus now. * I've added a new `//@ needs-threads` directive for `compiletest` and classified a bunch of wasm-ignored tests as needing threads. In theory these tests can run on `wasm32-wasi-preview1-threads`, for example. * I've tried to audit all existing tests that are either `ignore-emscripten` or `ignore-wasm*`. Many now run on `wasm32-wasip1` due to being able to emit error messages, for example. Many are updated with comments as to why they can't run as well. * The `compiletest` output matching for `wasm32-wasip1` automatically uses "match a subset" mode implemented in `compiletest`. This is because WebAssembly runtimes often add extra information on failure, such as the `unreachable` instruction in `panic!`, which isn't able to be matched against the golden output from native platforms. * I've ported most existing `run-make` tests that use custom Node.js wrapper scripts to the new run-make-based-in-Rust infrastructure. To do this I added `wasmparser` as a dependency of `run-make-support` for the various wasm tests to use that parse wasm files. The one test that executed WebAssembly now uses `wasmtime`-the-CLI to execute the test instead. I have not ported over an exception-handling test as Wasmtime doesn't implement this yet. * I've updated the `test` crate to print out timing information for WASI targets as it can do that (gets a previously ignored test now passing). * The `test-various` image now builds a WASI sysroot for the WASI target and additionally downloads a fixed release of Wasmtime, currently the latest one at 18.0.2, and uses that for testing. [Zulip thread]: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Have.20wasm.20tests.20ever.20caused.20problems.20on.20CI.3F/near/424317944
Diffstat (limited to 'tests/ui/process')
22 files changed, 21 insertions, 26 deletions
diff --git a/tests/ui/process/core-run-destroy.rs b/tests/ui/process/core-run-destroy.rs index 42bb35edf3b..338203657bd 100644 --- a/tests/ui/process/core-run-destroy.rs +++ b/tests/ui/process/core-run-destroy.rs @@ -5,7 +5,7 @@ #![allow(deprecated)] #![allow(unused_imports)] //@ compile-flags:--test -//@ ignore-emscripten no processes +//@ ignore-wasm32 no processes //@ ignore-sgx no processes //@ ignore-vxworks no 'cat' and 'sleep' //@ ignore-fuchsia no 'cat' diff --git a/tests/ui/process/fds-are-cloexec.rs b/tests/ui/process/fds-are-cloexec.rs index a5ede2ee04d..e7b000b2c49 100644 --- a/tests/ui/process/fds-are-cloexec.rs +++ b/tests/ui/process/fds-are-cloexec.rs @@ -1,7 +1,7 @@ //@ run-pass //@ ignore-windows //@ ignore-android -//@ ignore-emscripten no processes +//@ ignore-wasm32 no processes //@ ignore-haiku //@ ignore-sgx no processes diff --git a/tests/ui/process/issue-13304.rs b/tests/ui/process/issue-13304.rs index 06aad569169..6dbf0caaaec 100644 --- a/tests/ui/process/issue-13304.rs +++ b/tests/ui/process/issue-13304.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_mut)] -//@ ignore-emscripten no processes +//@ ignore-wasm32 no processes //@ ignore-sgx no processes use std::env; diff --git a/tests/ui/process/issue-14456.rs b/tests/ui/process/issue-14456.rs index 9146588aa4b..fd6da8a5fc4 100644 --- a/tests/ui/process/issue-14456.rs +++ b/tests/ui/process/issue-14456.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_mut)] -//@ ignore-emscripten no processes +//@ ignore-wasm32 no processes //@ ignore-sgx no processes use std::env; diff --git a/tests/ui/process/issue-14940.rs b/tests/ui/process/issue-14940.rs index 3c8de7cfccc..13fb18154a0 100644 --- a/tests/ui/process/issue-14940.rs +++ b/tests/ui/process/issue-14940.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no processes +//@ ignore-wasm32 no processes //@ ignore-sgx no processes use std::env; diff --git a/tests/ui/process/issue-16272.rs b/tests/ui/process/issue-16272.rs index 484c3ea4116..bf26769d494 100644 --- a/tests/ui/process/issue-16272.rs +++ b/tests/ui/process/issue-16272.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no processes +//@ ignore-wasm32 no processes //@ ignore-sgx no processes use std::process::Command; diff --git a/tests/ui/process/issue-20091.rs b/tests/ui/process/issue-20091.rs index 27986277fad..b6d94661b75 100644 --- a/tests/ui/process/issue-20091.rs +++ b/tests/ui/process/issue-20091.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(stable_features)] - -//@ ignore-emscripten no processes +//@ ignore-wasm32 no processes //@ ignore-sgx no processes #![feature(os)] diff --git a/tests/ui/process/multi-panic.rs b/tests/ui/process/multi-panic.rs index e8aa7f59f85..02b69903654 100644 --- a/tests/ui/process/multi-panic.rs +++ b/tests/ui/process/multi-panic.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no processes +//@ ignore-wasm32 no processes //@ ignore-sgx no processes //@ needs-unwind diff --git a/tests/ui/process/no-stdio.rs b/tests/ui/process/no-stdio.rs index 86e177617e5..05b1e52b799 100644 --- a/tests/ui/process/no-stdio.rs +++ b/tests/ui/process/no-stdio.rs @@ -1,6 +1,6 @@ //@ run-pass //@ ignore-android -//@ ignore-emscripten no processes +//@ ignore-wasm32 no processes //@ ignore-sgx no processes #![feature(rustc_private)] diff --git a/tests/ui/process/println-with-broken-pipe.rs b/tests/ui/process/println-with-broken-pipe.rs index bfbea280f0b..1df8c765cbd 100644 --- a/tests/ui/process/println-with-broken-pipe.rs +++ b/tests/ui/process/println-with-broken-pipe.rs @@ -1,7 +1,7 @@ //@ run-pass //@ check-run-results //@ ignore-windows -//@ ignore-emscripten +//@ ignore-wasm32 //@ ignore-fuchsia //@ ignore-horizon //@ ignore-android diff --git a/tests/ui/process/process-envs.rs b/tests/ui/process/process-envs.rs index 6f8a591b7d4..15285960d16 100644 --- a/tests/ui/process/process-envs.rs +++ b/tests/ui/process/process-envs.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no processes +//@ ignore-wasm32 no processes //@ ignore-sgx no processes //@ ignore-vxworks no 'env' //@ ignore-fuchsia no 'env' diff --git a/tests/ui/process/process-exit.rs b/tests/ui/process/process-exit.rs index 7cf1f2bccc3..a75a7306cbc 100644 --- a/tests/ui/process/process-exit.rs +++ b/tests/ui/process/process-exit.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_imports)] -//@ ignore-emscripten no processes +//@ ignore-wasm32 no processes //@ ignore-sgx no processes use std::env; diff --git a/tests/ui/process/process-panic-after-fork.rs b/tests/ui/process/process-panic-after-fork.rs index 0115dbd27ef..bae121576bd 100644 --- a/tests/ui/process/process-panic-after-fork.rs +++ b/tests/ui/process/process-panic-after-fork.rs @@ -1,9 +1,7 @@ //@ run-pass //@ no-prefer-dynamic -//@ ignore-wasm32-bare no libc //@ ignore-windows -//@ ignore-sgx no libc -//@ ignore-emscripten no processes +//@ ignore-wasm32 no processes //@ ignore-sgx no processes //@ ignore-fuchsia no fork diff --git a/tests/ui/process/process-remove-from-env.rs b/tests/ui/process/process-remove-from-env.rs index abacccf5a8a..21fff4fd45d 100644 --- a/tests/ui/process/process-remove-from-env.rs +++ b/tests/ui/process/process-remove-from-env.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no processes +//@ ignore-wasm32 no processes //@ ignore-sgx no processes //@ ignore-vxworks no 'env' //@ ignore-fuchsia no 'env' diff --git a/tests/ui/process/process-sigpipe.rs b/tests/ui/process/process-sigpipe.rs index 64d0bbc2b41..11f363d625f 100644 --- a/tests/ui/process/process-sigpipe.rs +++ b/tests/ui/process/process-sigpipe.rs @@ -13,7 +13,6 @@ // (instead of running forever), and that it does not print an error // message about a broken pipe. -//@ ignore-emscripten no threads support //@ ignore-vxworks no 'sh' //@ ignore-fuchsia no 'sh' diff --git a/tests/ui/process/process-spawn-nonexistent.rs b/tests/ui/process/process-spawn-nonexistent.rs index 2f45dace2f9..1cd32866299 100644 --- a/tests/ui/process/process-spawn-nonexistent.rs +++ b/tests/ui/process/process-spawn-nonexistent.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no processes +//@ ignore-wasm32 no processes //@ ignore-sgx no processes //@ ignore-fuchsia ErrorKind not translated diff --git a/tests/ui/process/process-spawn-with-unicode-params.rs b/tests/ui/process/process-spawn-with-unicode-params.rs index 26b3899df96..4d2ba49eeac 100644 --- a/tests/ui/process/process-spawn-with-unicode-params.rs +++ b/tests/ui/process/process-spawn-with-unicode-params.rs @@ -7,7 +7,7 @@ // non-ASCII characters. The child process ensures all the strings are // intact. -//@ ignore-emscripten no processes +//@ ignore-wasm32 no processes //@ ignore-sgx no processes //@ ignore-fuchsia Filesystem manipulation privileged diff --git a/tests/ui/process/process-status-inherits-stdin.rs b/tests/ui/process/process-status-inherits-stdin.rs index 210968a6ce5..39eef34c5f8 100644 --- a/tests/ui/process/process-status-inherits-stdin.rs +++ b/tests/ui/process/process-status-inherits-stdin.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no processes +//@ ignore-wasm32 no processes //@ ignore-sgx no processes use std::env; diff --git a/tests/ui/process/signal-exit-status.rs b/tests/ui/process/signal-exit-status.rs index 5efef8a6121..a6acea47636 100644 --- a/tests/ui/process/signal-exit-status.rs +++ b/tests/ui/process/signal-exit-status.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no processes +//@ ignore-wasm32 no processes //@ ignore-sgx no processes //@ ignore-windows //@ ignore-fuchsia code returned as ZX_TASK_RETCODE_EXCEPTION_KILL, FIXME (#58590) diff --git a/tests/ui/process/sigpipe-should-be-ignored.rs b/tests/ui/process/sigpipe-should-be-ignored.rs index cd6bda27646..44785bee7f8 100644 --- a/tests/ui/process/sigpipe-should-be-ignored.rs +++ b/tests/ui/process/sigpipe-should-be-ignored.rs @@ -4,7 +4,7 @@ // Be sure that when a SIGPIPE would have been received that the entire process // doesn't die in a ball of fire, but rather it's gracefully handled. -//@ ignore-emscripten no processes +//@ ignore-wasm32 no processes //@ ignore-sgx no processes use std::env; diff --git a/tests/ui/process/tls-exit-status.rs b/tests/ui/process/tls-exit-status.rs index 5a81c7708fe..cddcf369da0 100644 --- a/tests/ui/process/tls-exit-status.rs +++ b/tests/ui/process/tls-exit-status.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:nonzero //@ exec-env:RUST_NEWRT=1 -//@ ignore-emscripten no processes +//@ ignore-wasm32 no processes use std::env; diff --git a/tests/ui/process/try-wait.rs b/tests/ui/process/try-wait.rs index 948ce63c76c..b6d026d802f 100644 --- a/tests/ui/process/try-wait.rs +++ b/tests/ui/process/try-wait.rs @@ -1,9 +1,8 @@ //@ run-pass #![allow(stable_features)] -//@ ignore-emscripten no processes +//@ ignore-wasm32 no processes //@ ignore-sgx no processes - #![feature(process_try_wait)] use std::env; |
