From 4f2dd29f1823a763415bbf408a9413134a4a009a Mon Sep 17 00:00:00 2001 From: xonx <119700621+xonx4l@users.noreply.github.com> Date: Sun, 3 May 2026 10:51:07 +0000 Subject: [PATCH] Add bootstrap step for stdarch-verify and update license metadata --- license-metadata.json | 2 +- src/bootstrap/src/core/build_steps/test.rs | 52 +++++++++++++++++++ .../builder/cli_paths/snapshots/x_test.snap | 3 ++ .../cli_paths/snapshots/x_test_library.snap | 3 ++ .../snapshots/x_test_skip_coverage.snap | 3 ++ .../snapshots/x_test_skip_tests.snap | 3 ++ src/bootstrap/src/core/builder/mod.rs | 1 + 7 files changed, 66 insertions(+), 1 deletion(-) diff --git a/license-metadata.json b/license-metadata.json index e8e13fa8d859c..1df9849e45589 100644 --- a/license-metadata.json +++ b/license-metadata.json @@ -271,4 +271,4 @@ ], "type": "root" } -} +} \ No newline at end of file diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index 8732681bcbf84..c1b003c771fe7 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -904,6 +904,58 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the } } +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct StdarchVerify { + build_compiler: Compiler, + target: TargetSelection, +} + +impl Step for StdarchVerify { + type Output = (); + const IS_HOST: bool = true; + + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { + run.path("library/stdarch/crates/stdarch-verify") + } + + fn is_default_step(_builder: &Builder<'_>) -> bool { + true + } + + fn make_run(run: RunConfig<'_>) { + let builder = run.builder; + let build_compiler = get_compiler_to_test(builder, run.target); + builder.ensure(StdarchVerify { build_compiler, target: run.target }); + } + + fn run(self, builder: &Builder<'_>) { + let build_compiler = self.build_compiler; + let target = self.target; + + builder.std(build_compiler, target); + + let cargo = tool::prepare_tool_cargo( + builder, + build_compiler, + Mode::ToolStd, + target, + Kind::Test, + "library/stdarch/crates/stdarch-verify", + SourceType::InTree, + &[], + ); + + run_cargo_test( + cargo, + &[], + &["stdarch-verify".to_string()], + Some("stdarch-verify"), + target, + builder, + ); + } +} + #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Clippy { compilers: RustcPrivateCompilers, diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test.snap index 25ff1e64e76b4..60e8a219585c6 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test.snap @@ -181,6 +181,9 @@ expression: test [Test] test::RustcBook targets: [x86_64-unknown-linux-gnu] - Set({test::src/doc/rustc}) +[Test] test::StdarchVerify + targets: [x86_64-unknown-linux-gnu] + - Set({test::library/stdarch/crates/stdarch-verify}) [Test] test::RustdocJSStd targets: [x86_64-unknown-linux-gnu] - Suite(test::tests/rustdoc-js-std) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_library.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_library.snap index dfc397597a877..f97bb839c1e73 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_library.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_library.snap @@ -18,3 +18,6 @@ expression: test library - Set({test::library/sysroot}) - Set({test::library/test}) - Set({test::library/unwind}) +[Test] test::StdarchVerify + targets: [x86_64-unknown-linux-gnu] + - Set({test::library/stdarch/crates/stdarch-verify}) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage.snap index 2f1ee9386ed72..fb83986445bea 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_coverage.snap @@ -180,6 +180,9 @@ expression: test --skip=coverage [Test] test::RustcBook targets: [x86_64-unknown-linux-gnu] - Set({test::src/doc/rustc}) +[Test] test::StdarchVerify + targets: [x86_64-unknown-linux-gnu] + - Set({test::library/stdarch/crates/stdarch-verify}) [Test] test::RustdocJSStd targets: [x86_64-unknown-linux-gnu] - Suite(test::tests/rustdoc-js-std) diff --git a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests.snap b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests.snap index 8f5e842d28a15..3737272dd83a4 100644 --- a/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests.snap +++ b/src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests.snap @@ -144,6 +144,9 @@ expression: test --skip=tests [Test] test::RustcBook targets: [x86_64-unknown-linux-gnu] - Set({test::src/doc/rustc}) +[Test] test::StdarchVerify + targets: [x86_64-unknown-linux-gnu] + - Set({test::library/stdarch/crates/stdarch-verify}) [Test] test::RustdocTheme targets: [x86_64-unknown-linux-gnu] - Set({test::src/tools/rustdoc-themes}) diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs index bc402313367fd..2e640220efd8e 100644 --- a/src/bootstrap/src/core/builder/mod.rs +++ b/src/bootstrap/src/core/builder/mod.rs @@ -910,6 +910,7 @@ impl<'a> Builder<'a> { test::CargoMiri, test::Clippy, test::CompiletestTest, + test::StdarchVerify, test::CrateRunMakeSupport, test::CrateBuildHelper, test::RustdocJSStd,