| author | bors <bors@rust-lang.org> 2026-06-01 11:40:34 UTC |
| committer | bors <bors@rust-lang.org> 2026-06-01 11:40:34 UTC |
| log | 968d50ad35115bc2c8c19cb9039f7ed3dfe56a81 |
| tree | 4e2a34557f328f8d81c78cc045bc9e68dab1c36f |
| parent | 4804ad7e93e1b31f4605b7083871d0d3d85a2afe |
| parent | 6535f0be6ed0669e83bd54cb2a6e931eda583491 |
Add bootstrap step for stdarch-verify
This PR hooks `library/stdarch/crates/stdarch-verify` crate into the bootstrap test runner as a step, so that we can run the stdarch-verify suite via x.py test.
Changes :
-> Added StdarchVerify in `src/bootstrap/src/core/build_steps/test.rs`
-> Added `test::StdarchVerify` in `src/bootstrap/src/core/builder/mod.rs`
Tests:
-> Running `./x.py test library/stdarch/crates/stdarch-verify` builds compiler and std successfully.
-> All three integration tests Passes:
tests/arm.rs
tests/mips.rs
tests/x86-intel.rs
-> Doc tests for `stdarch_verify` also Passes.
r? @Kobzol
try-job: x86_64-gnu-distcheck8 files changed, 70 insertions(+), 0 deletions(-)
src/bootstrap/src/core/build_steps/test.rs+48| ... | @@ -909,6 +909,54 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the | ... | @@ -909,6 +909,54 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the |
| 909 | } | 909 | } |
| 910 | } | 910 | } |
| 911 | 911 | ||
| 912 | /// Runs `library/stdarch/crates/stdarch-verify`'s tests which cross-check the | ||
| 913 | /// `core::arch` intrinsics for x86, Arm, and MIPS against the corresponding | ||
| 914 | /// vendor references (signatures, target features, and `assert_instr` mappings). | ||
| 915 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
| 916 | pub struct StdarchVerify; | ||
| 917 | |||
| 918 | impl Step for StdarchVerify { | ||
| 919 | type Output = (); | ||
| 920 | const IS_HOST: bool = true; | ||
| 921 | |||
| 922 | fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { | ||
| 923 | run.path("library/stdarch/crates/stdarch-verify") | ||
| 924 | } | ||
| 925 | |||
| 926 | fn is_default_step(_builder: &Builder<'_>) -> bool { | ||
| 927 | true | ||
| 928 | } | ||
| 929 | |||
| 930 | fn make_run(run: RunConfig<'_>) { | ||
| 931 | run.builder.ensure(StdarchVerify); | ||
| 932 | } | ||
| 933 | |||
| 934 | fn run(self, builder: &Builder<'_>) { | ||
| 935 | let host = builder.config.host_target; | ||
| 936 | let build_compiler = builder.compiler(0, host); | ||
| 937 | |||
| 938 | let cargo = tool::prepare_tool_cargo( | ||
| 939 | builder, | ||
| 940 | build_compiler, | ||
| 941 | Mode::ToolBootstrap, | ||
| 942 | host, | ||
| 943 | Kind::Test, | ||
| 944 | "library/stdarch/crates/stdarch-verify", | ||
| 945 | SourceType::InTree, | ||
| 946 | &[], | ||
| 947 | ); | ||
| 948 | |||
| 949 | run_cargo_test( | ||
| 950 | cargo, | ||
| 951 | &[], | ||
| 952 | &["stdarch-verify".to_string()], | ||
| 953 | Some("stdarch-verify"), | ||
| 954 | host, | ||
| 955 | builder, | ||
| 956 | ); | ||
| 957 | } | ||
| 958 | } | ||
| 959 | |||
| 912 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 960 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
| 913 | pub struct Clippy { | 961 | pub struct Clippy { |
| 914 | compilers: RustcPrivateCompilers, | 962 | compilers: RustcPrivateCompilers, |
src/bootstrap/src/core/build_steps/vendor.rs+1| ... | @@ -24,6 +24,7 @@ pub fn default_paths_to_vendor(builder: &Builder<'_>) -> Vec<(PathBuf, Vec<&'sta | ... | @@ -24,6 +24,7 @@ pub fn default_paths_to_vendor(builder: &Builder<'_>) -> Vec<(PathBuf, Vec<&'sta |
| 24 | ("compiler/rustc_codegen_cranelift/Cargo.toml", vec![]), | 24 | ("compiler/rustc_codegen_cranelift/Cargo.toml", vec![]), |
| 25 | ("compiler/rustc_codegen_gcc/Cargo.toml", vec![]), | 25 | ("compiler/rustc_codegen_gcc/Cargo.toml", vec![]), |
| 26 | ("library/Cargo.toml", vec![]), | 26 | ("library/Cargo.toml", vec![]), |
| 27 | ("library/stdarch/Cargo.toml", vec![]), | ||
| 27 | ("src/bootstrap/Cargo.toml", vec![]), | 28 | ("src/bootstrap/Cargo.toml", vec![]), |
| 28 | ("src/tools/rustbook/Cargo.toml", SUBMODULES_FOR_RUSTBOOK.into()), | 29 | ("src/tools/rustbook/Cargo.toml", SUBMODULES_FOR_RUSTBOOK.into()), |
| 29 | ("src/tools/rustc-perf/Cargo.toml", vec!["src/tools/rustc-perf"]), | 30 | ("src/tools/rustc-perf/Cargo.toml", vec!["src/tools/rustc-perf"]), |
src/bootstrap/src/core/builder/cli_paths/snapshots/x_test.snap+3| ... | @@ -181,6 +181,9 @@ expression: test | ... | @@ -181,6 +181,9 @@ expression: test |
| 181 | [Test] test::RustcBook | 181 | [Test] test::RustcBook |
| 182 | targets: [x86_64-unknown-linux-gnu] | 182 | targets: [x86_64-unknown-linux-gnu] |
| 183 | - Set({test::src/doc/rustc}) | 183 | - Set({test::src/doc/rustc}) |
| 184 | [Test] test::StdarchVerify | ||
| 185 | targets: [x86_64-unknown-linux-gnu] | ||
| 186 | - Set({test::library/stdarch/crates/stdarch-verify}) | ||
| 184 | [Test] test::RustdocJSStd | 187 | [Test] test::RustdocJSStd |
| 185 | targets: [x86_64-unknown-linux-gnu] | 188 | targets: [x86_64-unknown-linux-gnu] |
| 186 | - Suite(test::tests/rustdoc-js-std) | 189 | - Suite(test::tests/rustdoc-js-std) |
src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_library.snap+3| ... | @@ -18,3 +18,6 @@ expression: test library | ... | @@ -18,3 +18,6 @@ expression: test library |
| 18 | - Set({test::library/sysroot}) | 18 | - Set({test::library/sysroot}) |
| 19 | - Set({test::library/test}) | 19 | - Set({test::library/test}) |
| 20 | - Set({test::library/unwind}) | 20 | - Set({test::library/unwind}) |
| 21 | [Test] test::StdarchVerify | ||
| 22 | targets: [x86_64-unknown-linux-gnu] | ||
| 23 | - Set({test::library/stdarch/crates/stdarch-verify}) |
src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage.snap+3| ... | @@ -180,6 +180,9 @@ expression: test --skip=coverage | ... | @@ -180,6 +180,9 @@ expression: test --skip=coverage |
| 180 | [Test] test::RustcBook | 180 | [Test] test::RustcBook |
| 181 | targets: [x86_64-unknown-linux-gnu] | 181 | targets: [x86_64-unknown-linux-gnu] |
| 182 | - Set({test::src/doc/rustc}) | 182 | - Set({test::src/doc/rustc}) |
| 183 | [Test] test::StdarchVerify | ||
| 184 | targets: [x86_64-unknown-linux-gnu] | ||
| 185 | - Set({test::library/stdarch/crates/stdarch-verify}) | ||
| 183 | [Test] test::RustdocJSStd | 186 | [Test] test::RustdocJSStd |
| 184 | targets: [x86_64-unknown-linux-gnu] | 187 | targets: [x86_64-unknown-linux-gnu] |
| 185 | - Suite(test::tests/rustdoc-js-std) | 188 | - Suite(test::tests/rustdoc-js-std) |
src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests.snap+3| ... | @@ -144,6 +144,9 @@ expression: test --skip=tests | ... | @@ -144,6 +144,9 @@ expression: test --skip=tests |
| 144 | [Test] test::RustcBook | 144 | [Test] test::RustcBook |
| 145 | targets: [x86_64-unknown-linux-gnu] | 145 | targets: [x86_64-unknown-linux-gnu] |
| 146 | - Set({test::src/doc/rustc}) | 146 | - Set({test::src/doc/rustc}) |
| 147 | [Test] test::StdarchVerify | ||
| 148 | targets: [x86_64-unknown-linux-gnu] | ||
| 149 | - Set({test::library/stdarch/crates/stdarch-verify}) | ||
| 147 | [Test] test::RustdocTheme | 150 | [Test] test::RustdocTheme |
| 148 | targets: [x86_64-unknown-linux-gnu] | 151 | targets: [x86_64-unknown-linux-gnu] |
| 149 | - Set({test::src/tools/rustdoc-themes}) | 152 | - Set({test::src/tools/rustdoc-themes}) |
src/bootstrap/src/core/builder/mod.rs+1| ... | @@ -910,6 +910,7 @@ impl<'a> Builder<'a> { | ... | @@ -910,6 +910,7 @@ impl<'a> Builder<'a> { |
| 910 | test::CargoMiri, | 910 | test::CargoMiri, |
| 911 | test::Clippy, | 911 | test::Clippy, |
| 912 | test::CompiletestTest, | 912 | test::CompiletestTest, |
| 913 | test::StdarchVerify, | ||
| 913 | test::CrateRunMakeSupport, | 914 | test::CrateRunMakeSupport, |
| 914 | test::CrateBuildHelper, | 915 | test::CrateBuildHelper, |
| 915 | test::RustdocJSStd, | 916 | test::RustdocJSStd, |
src/tools/tidy/src/deps.rs+8| ... | @@ -132,6 +132,12 @@ pub(crate) const WORKSPACES: &[WorkspaceInfo<'static>] = &[ | ... | @@ -132,6 +132,12 @@ pub(crate) const WORKSPACES: &[WorkspaceInfo<'static>] = &[ |
| 132 | )), | 132 | )), |
| 133 | submodules: &[], | 133 | submodules: &[], |
| 134 | }, | 134 | }, |
| 135 | WorkspaceInfo { | ||
| 136 | path: "library/stdarch", | ||
| 137 | exceptions: EXCEPTIONS_STDARCH, | ||
| 138 | crates_and_deps: None, | ||
| 139 | submodules: &[], | ||
| 140 | }, | ||
| 135 | WorkspaceInfo { | 141 | WorkspaceInfo { |
| 136 | path: "compiler/rustc_codegen_cranelift", | 142 | path: "compiler/rustc_codegen_cranelift", |
| 137 | exceptions: EXCEPTIONS_CRANELIFT, | 143 | exceptions: EXCEPTIONS_CRANELIFT, |
| ... | @@ -254,6 +260,8 @@ const EXCEPTIONS_RUSTBOOK: ExceptionList = &[ | ... | @@ -254,6 +260,8 @@ const EXCEPTIONS_RUSTBOOK: ExceptionList = &[ |
| 254 | // tidy-alphabetical-end | 260 | // tidy-alphabetical-end |
| 255 | ]; | 261 | ]; |
| 256 | 262 | ||
| 263 | const EXCEPTIONS_STDARCH: ExceptionList = &[]; | ||
| 264 | |||
| 257 | const EXCEPTIONS_CRANELIFT: ExceptionList = &[]; | 265 | const EXCEPTIONS_CRANELIFT: ExceptionList = &[]; |
| 258 | 266 | ||
| 259 | const EXCEPTIONS_GCC: ExceptionList = &[ | 267 | const EXCEPTIONS_GCC: ExceptionList = &[ |