mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-02 13:07:37 +00:00
![]() Implement `needs-subprocess` directive, and cleanup a bunch of tests to use `needs-{subprocess,threads}` ### Summary Closes #128295. - Implements `//@ needs-subprocess` directive in compiletest as requested in #128295. However, compiletest is a host tool, so we can't just try to spawn process because that spawns the process on *host*, not the *target*, under cross-compilation scenarios. - The short-term solution is to add *Yet Another* list of allow-list targets. - The long-term solution is to first check if a `$target` supports std, then try to run a binary to do run-time capability detection *on the target*. But that is tricky because you have to build-and-run a binary *for the target*. - This PR picks the short-term solution, because the long-term solution is highly non-trivial, and it's already an improvement over individual `ignore-*`s all over the place. - Opened an issue about the long-term solution in #135928. - Documents `//@ needs-subprocess` in rustc-dev-guide. - Replace `ignore-{wasm,wasm32,emscripten,sgx}` with `needs-{subprocess,threads}` where suitable in tests. - Some drive-by test changes as I was trying to figure out if I could use `needs-{subprocess,threads}` and found some bits needlessly distracting. Count of tests that use `ignore-{wasm,wasm32,emscripten,sgx}` before and after this PR: | State | `ignore-sgx` | `ignore-wasm` | `ignore-emscripten` | | - | - | - | - | | Before this PR | 96 | 88 | 207 | | After this PR | 36 | 38 | 61 | <details> <summary>Commands used to find out locally</summary> ``` --- before [17:40] Joe:rust (fresh) | rg --no-ignore -l "ignore-sgx" tests | wc -l 96 [17:40] Joe:rust (fresh) | rg --no-ignore -l "ignore-wasm" tests | wc -l 88 [17:40] Joe:rust (fresh) | rg --no-ignore -l "ignore-emscripten" tests | wc -l 207 --- after [17:39] Joe:rust (needs-subprocess-thread) | rg --no-ignore -l "ignore-sgx" tests | wc -l 36 [17:39] Joe:rust (needs-subprocess-thread) | rg --no-ignore -l "ignore-wasm" tests | wc -l 38 [17:39] Joe:rust (needs-subprocess-thread) | rg --no-ignore -l "ignore-emscripten" tests | wc -l 61 ``` </details> ### Review advice - Best reviewed commit-by-commit. - Non-trivial test changes (not mechanically simple replacements) are split into individual commits to help with review. Their individual commit messages give some basic description of the changes. - I *could* split some test changes out into another PR, but I found that I needed to change some tests to `needs-threads`, some to `needs-subprocess`, and some needed to use *both*, so they might conflict and become very annoying. --- r? ``@ghost`` (need to run try jobs) try-job: x86_64-msvc-1 try-job: i686-msvc-1 try-job: i686-mingw try-job: x86_64-mingw-1 try-job: x86_64-apple-1 try-job: aarch64-apple try-job: aarch64-gnu try-job: test-various try-job: armhf-gnu |
||
---|---|---|
.. | ||
auxiliary | ||
drop_elaboration_with_errors.rs | ||
drop_elaboration_with_errors.stderr | ||
drop_order_if_let_rescope.rs | ||
drop_order.rs | ||
drop-foreign-fundamental.rs | ||
drop-foreign-fundamental.stderr | ||
drop-if-let-binding.rs | ||
drop-on-empty-block-exit.rs | ||
drop-on-ret.rs | ||
drop-order-comparisons.e2021.fixed | ||
drop-order-comparisons.e2021.stderr | ||
drop-order-comparisons.rs | ||
drop-struct-as-object.rs | ||
drop-struct-as-object.stderr | ||
drop-trait-enum.rs | ||
drop-trait-generic.rs | ||
drop-trait.rs | ||
drop-uninhabited-enum.rs | ||
drop-with-type-ascription-1.rs | ||
drop-with-type-ascription-2.rs | ||
dropck_legal_cycles.rs | ||
dropck-eyepatch-extern-crate.rs | ||
dropck-eyepatch-manuallydrop.rs | ||
dropck-eyepatch-reorder.rs | ||
dropck-eyepatch.rs | ||
dynamic-drop-async.rs | ||
dynamic-drop.rs | ||
if-let-rescope-borrowck-suggestions.rs | ||
if-let-rescope-borrowck-suggestions.stderr | ||
issue-979.rs | ||
issue-2734.rs | ||
issue-2735-2.rs | ||
issue-2735-3.rs | ||
issue-2735.rs | ||
issue-10028.rs | ||
issue-17718-const-destructors.rs | ||
issue-21486.rs | ||
issue-23338-ensure-param-drop-order.rs | ||
issue-23611-enum-swap-in-drop.rs | ||
issue-30018-nopanic.rs | ||
issue-35546.rs | ||
issue-48962.rs | ||
issue-90752-raw-ptr-shenanigans.rs | ||
issue-90752.rs | ||
issue-100276.rs | ||
issue-103107.rs | ||
issue-110682.rs | ||
lint-if-let-rescope-gated.edition2021.stderr | ||
lint-if-let-rescope-gated.rs | ||
lint-if-let-rescope-with-macro.rs | ||
lint-if-let-rescope-with-macro.stderr | ||
lint-if-let-rescope.fixed | ||
lint-if-let-rescope.rs | ||
lint-if-let-rescope.stderr | ||
lint-tail-expr-drop-order-borrowck.rs | ||
lint-tail-expr-drop-order-borrowck.stderr | ||
lint-tail-expr-drop-order-gated.rs | ||
lint-tail-expr-drop-order.rs | ||
lint-tail-expr-drop-order.stderr | ||
missing-drop-method.rs | ||
missing-drop-method.stderr | ||
no-drop-flag-size.rs | ||
nondrop-cycle.rs | ||
norm-ice-106444.rs | ||
recursion-check-on-erroneous-impl.rs | ||
recursion-check-on-erroneous-impl.stderr | ||
repeat-drop-2.rs | ||
repeat-drop-2.stderr | ||
repeat-drop.rs | ||
static-issue-17302.rs | ||
tail_expr_drop_order-on-coroutine-unwind.rs | ||
tail_expr_drop_order-on-coroutine-unwind.stderr | ||
tail_expr_drop_order-on-recursive-boxed-fut.rs | ||
tail_expr_drop_order-on-thread-local.rs | ||
tail-expr-drop-order-negative.edition2024.stderr | ||
tail-expr-drop-order-negative.rs | ||
tail-expr-drop-order.rs | ||
terminate-in-initializer.rs | ||
use_inline_dtor.rs |