Skip to content

Commit 968d50a

Browse files
committed
Auto merge of #153957 - xonx4l:stdarch-verify, r=Kobzol,bjorn3
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-distcheck
2 parents 4804ad7 + 6535f0b commit 968d50a

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
@@ -909,6 +909,54 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
909909
}
910910
}
911911

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+
912960
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
913961
pub struct Clippy {
914962
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)