rust/src/tools
Matthias Krüger 57bb38b836
Rollup merge of #142297 - jieyouxu:needs-target-std, r=Kobzol
Implement `//@ needs-target-std` compiletest directive

Closes rust-lang/rust#141863.
Needed to unblock rust-lang/rust#139244 and rust-lang/rust#141856.

### Summary

This PR implements a `//@ needs-target-std` compiletest directive that gates test execution based on whether the target supports std or not. For some cases, this should be preferred over e.g. some combination of `//@ ignore-none`, `//@ ignore-nvptx` and more[^none-limit].

### Implementation limitation

Unfortunately, since there is currently [no reliable way to determine from metadata whether a given target supports std or not](https://github.com/rust-lang/rust/issues/142296), we have to resort to a hack. Bootstrap currently determines whether or not a target supports std by a naive target tuple substring comparison: a target supports std if its target tuple does *not* contain one of `["-none", "nvptx", "switch"]` substrings. This PR simply pulls that hack out into `build_helpers` to avoid reimplementing the same hack in compiletest, and uses that logic to inform `//@ needs-target-std`.

### Auxiliary changes

This PR additionally changes a few run-make tests to use `//@ needs-target-std` over an inconsistent combination of target-based `ignore`s. This should help with rust-lang/rust#139244.

---

r? bootstrap

[^none-limit]: Notably, `target_os = "none"` is **not** a sufficient condition for "target does not support std"
2025-06-11 13:48:11 +02:00
..
build-manifest Rollup merge of #142053 - heiher:loong32-none, r=wesleywiser 2025-06-08 17:17:53 -07:00
bump-stage0 Remove git_repository field from GitConfig 2025-04-23 10:41:20 +02:00
cargo@fc1518ef02 Update cargo 2025-06-06 14:51:35 +08:00
cargotest
clippy Rollup merge of #141603 - nnethercote:reduce-P, r=fee1-dead 2025-06-06 23:53:16 +02:00
collect-license-metadata
compiletest Implement //@ needs-target-std directive in compiletest 2025-06-10 22:16:09 +08:00
coverage-dump Update miniz_oxide dependency of coverage_dump 2025-05-10 18:35:20 +02:00
enzyme@a35f4f7731 update enzyme to handle range metadata 2025-02-28 03:53:22 -05:00
error_index_generator Move error_index_generator to the rustbook workspace 2025-02-17 10:58:15 -08:00
features-status-dump Remove backtrace dep from anyhow in features status dump tool 2025-05-01 07:45:47 -04:00
generate-copyright Rollup merge of #141789 - ferrocene:hoverbear/exclude-cargo-home-from-in-tree-consideration, r=clubby789 2025-06-01 19:35:44 +02:00
generate-windows-sys Update windows-bindgen to 0.61.0 2025-04-04 16:41:40 +00:00
html-checker
jsondocck jsondocck: Explain what KNOWN_DIRECTIVE_NAMES is doing 2025-06-05 11:33:38 +00:00
jsondoclint rustdoc: Output target feature information 2025-04-15 21:26:14 -05:00
libcxx-version
linkchecker bump html5ever to 0.29 with deps 2025-03-13 19:59:53 +03:00
lint-docs Avoid including text direction codepoints in lint messages 2025-05-27 15:57:41 +00:00
lld-wrapper
llvm-bitcode-linker Pass through of target features to llvm-bitcode-linker and handling them 2025-02-16 21:57:03 +01:00
miri Merge pull request #4389 from RalfJung/native-lib-search-order 2025-06-10 09:11:49 +00:00
miropt-test-tools
nix-dev-shell Deduplicate nix code 2025-04-17 00:01:04 -04:00
opt-dist Bump rustc-perf and update PGO crates 2025-05-29 09:00:36 +00:00
remote-test-client
remote-test-server
replace-version-placeholder
run-make-support run-make-support: support "ejecting" the underlying std command 2025-05-09 19:54:35 +08:00
rust-analyzer Merge from rust-lang/rust 2025-06-09 15:44:40 +03:00
rust-installer Rustfmt 2025-02-08 22:12:13 +00:00
rustbook rustbook: Bump versions of onig and onig_sys 2025-05-28 15:36:32 +03:00
rustc-perf@6a70166b92 Bump rustc-perf and update PGO crates 2025-05-29 09:00:36 +00:00
rustdoc librustdoc: 2024 edition! 🎊 2025-03-04 12:35:18 +02:00
rustdoc-gui Update browser-ui-test version to 0.20.2 2025-02-05 17:06:38 +01:00
rustdoc-gui-test Improve error output in case nodejs or npm is not installed for rustdoc-gui test suite 2025-05-01 17:42:22 +02:00
rustdoc-js tester.js: ignore displayTypeSignature if it is null 2025-03-27 16:00:44 -05:00
rustdoc-themes
rustfmt Rollup merge of #141603 - nnethercote:reduce-P, r=fee1-dead 2025-06-06 23:53:16 +02:00
suggest-tests Remove git_repository field from GitConfig 2025-04-23 10:41:20 +02:00
test-float-parse move test-float-parse tool into src/tools dir 2025-06-03 11:05:51 +03:00
tidy Auto merge of #141229 - tgross35:builtins-josh-subtree, r=Kobzol 2025-06-03 19:52:05 +00:00
tier-check
unicode-table-generator Remove unneeded parentheses. 2025-03-08 12:56:00 +01:00
unstable-book-gen Rollup merge of #141526 - jyn514:env-vars, r=petrochenkov 2025-05-27 01:29:21 +08:00
wasm-component-ld Update wasm-component-ld to 0.5.13 2025-04-23 14:37:17 -07:00
x Add src/tools/x to the main workspace 2025-03-13 12:18:32 -07:00
cherry-pick.sh
publish_toolstate.py Update toolstate maintainers 2025-01-23 09:55:21 -08:00