Skip to content

Commit 6535f0b

Browse files
committed
Add bootstrap step for stdarch-verify
1 parent 59bc26c commit 6535f0b

8 files changed

Lines changed: 70 additions & 0 deletions

File tree

src/bootstrap/src/core/build_steps/test.rs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,54 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
904904
}
905905
}
906906

907+
/// Runs `library/stdarch/crates/stdarch-verify`'s tests which cross-check the
908+
/// `core::arch` intrinsics for x86, Arm, and MIPS against the corresponding
909+
/// vendor references (signatures, target features, and `assert_instr` mappings).
910+
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
911+
pub struct StdarchVerify;
912+
913+
impl Step for StdarchVerify {
914+
type Output = ();
915+
const IS_HOST: bool = true;
916+
917+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
918+
run.path("library/stdarch/crates/stdarch-verify")
919+
}
920+
921+
fn is_default_step(_builder: &Builder<'_>) -> bool {
922+
true
923+
}
924+
925+
fn make_run(run: RunConfig<'_>) {
926+
run.builder.ensure(StdarchVerify);
927+
}
928+
929+
fn run(self, builder: &Builder<'_>) {
930+
let host = builder.config.host_target;
931+
let build_compiler = builder.compiler(0, host);
932+
933+
let cargo = tool::prepare_tool_cargo(
934+
builder,
935+
build_compiler,
936+
Mode::ToolBootstrap,
937+
host,
938+
Kind::Test,
939+
"library/stdarch/crates/stdarch-verify",
940+
SourceType::InTree,
941+
&[],
942+
);
943+
944+
run_cargo_test(
945+
cargo,
946+
&[],
947+
&["stdarch-verify".to_string()],
948+
Some("stdarch-verify"),
949+
host,
950+
builder,
951+
);
952+
}
953+
}
954+
907955
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
908956
pub struct Clippy {
909957
compilers: RustcPrivateCompilers,

src/bootstrap/src/core/build_steps/vendor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pub fn default_paths_to_vendor(builder: &Builder<'_>) -> Vec<(PathBuf, Vec<&'sta
2424
("compiler/rustc_codegen_cranelift/Cargo.toml", vec![]),
2525
("compiler/rustc_codegen_gcc/Cargo.toml", vec![]),
2626
("library/Cargo.toml", vec![]),
27+
("library/stdarch/Cargo.toml", vec![]),
2728
("src/bootstrap/Cargo.toml", vec![]),
2829
("src/tools/rustbook/Cargo.toml", SUBMODULES_FOR_RUSTBOOK.into()),
2930
("src/tools/rustc-perf/Cargo.toml", vec!["src/tools/rustc-perf"]),

src/bootstrap/src/core/builder/cli_paths/snapshots/x_test.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ expression: test
181181
[Test] test::RustcBook
182182
targets: [x86_64-unknown-linux-gnu]
183183
- Set({test::src/doc/rustc})
184+
[Test] test::StdarchVerify
185+
targets: [x86_64-unknown-linux-gnu]
186+
- Set({test::library/stdarch/crates/stdarch-verify})
184187
[Test] test::RustdocJSStd
185188
targets: [x86_64-unknown-linux-gnu]
186189
- Suite(test::tests/rustdoc-js-std)

src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_library.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ expression: test library
1818
- Set({test::library/sysroot})
1919
- Set({test::library/test})
2020
- 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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ expression: test --skip=coverage
180180
[Test] test::RustcBook
181181
targets: [x86_64-unknown-linux-gnu]
182182
- Set({test::src/doc/rustc})
183+
[Test] test::StdarchVerify
184+
targets: [x86_64-unknown-linux-gnu]
185+
- Set({test::library/stdarch/crates/stdarch-verify})
183186
[Test] test::RustdocJSStd
184187
targets: [x86_64-unknown-linux-gnu]
185188
- Suite(test::tests/rustdoc-js-std)

src/bootstrap/src/core/builder/cli_paths/snapshots/x_test_skip_tests.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ expression: test --skip=tests
144144
[Test] test::RustcBook
145145
targets: [x86_64-unknown-linux-gnu]
146146
- Set({test::src/doc/rustc})
147+
[Test] test::StdarchVerify
148+
targets: [x86_64-unknown-linux-gnu]
149+
- Set({test::library/stdarch/crates/stdarch-verify})
147150
[Test] test::RustdocTheme
148151
targets: [x86_64-unknown-linux-gnu]
149152
- Set({test::src/tools/rustdoc-themes})

src/bootstrap/src/core/builder/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,7 @@ impl<'a> Builder<'a> {
910910
test::CargoMiri,
911911
test::Clippy,
912912
test::CompiletestTest,
913+
test::StdarchVerify,
913914
test::CrateRunMakeSupport,
914915
test::CrateBuildHelper,
915916
test::RustdocJSStd,

src/tools/tidy/src/deps.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ pub(crate) const WORKSPACES: &[WorkspaceInfo<'static>] = &[
132132
)),
133133
submodules: &[],
134134
},
135+
WorkspaceInfo {
136+
path: "library/stdarch",
137+
exceptions: EXCEPTIONS_STDARCH,
138+
crates_and_deps: None,
139+
submodules: &[],
140+
},
135141
WorkspaceInfo {
136142
path: "compiler/rustc_codegen_cranelift",
137143
exceptions: EXCEPTIONS_CRANELIFT,
@@ -254,6 +260,8 @@ const EXCEPTIONS_RUSTBOOK: ExceptionList = &[
254260
// tidy-alphabetical-end
255261
];
256262

263+
const EXCEPTIONS_STDARCH: ExceptionList = &[];
264+
257265
const EXCEPTIONS_CRANELIFT: ExceptionList = &[];
258266

259267
const EXCEPTIONS_GCC: ExceptionList = &[

0 commit comments

Comments
 (0)