Skip to content

Commit 948eb5e

Browse files
committed
Fix check compiletest with in-tree libstd and add tests for it
1 parent 749708b commit 948eb5e

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

src/bootstrap/src/core/build_steps/check.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ impl Step for Compiletest {
375375
);
376376

377377
if mode != Mode::ToolBootstrap {
378-
builder.ensure(Rustc::new(self.target, builder));
378+
builder.std(compiler, self.target);
379379
}
380380

381381
let mut cargo = prepare_tool_cargo(
@@ -399,6 +399,10 @@ impl Step for Compiletest {
399399
let _guard = builder.msg_check("compiletest artifacts", self.target, None);
400400
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
401401
}
402+
403+
fn metadata(&self) -> Option<StepMetadata> {
404+
Some(StepMetadata::check("compiletest", self.target))
405+
}
402406
}
403407

404408
macro_rules! tool_check_step {

src/bootstrap/src/core/builder/tests.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,6 +1391,30 @@ mod snapshot {
13911391
");
13921392
}
13931393

1394+
#[test]
1395+
fn check_compiletest() {
1396+
let ctx = TestCtx::new();
1397+
insta::assert_snapshot!(
1398+
ctx.config("check")
1399+
.path("compiletest")
1400+
.render_steps(), @"[check] compiletest <host>");
1401+
}
1402+
1403+
#[test]
1404+
fn check_compiletest_stage1_libtest() {
1405+
let ctx = TestCtx::new();
1406+
insta::assert_snapshot!(
1407+
ctx.config("check")
1408+
.path("compiletest")
1409+
.args(&["--set", "build.compiletest-use-stage0-libtest=false"])
1410+
.render_steps(), @r"
1411+
[build] llvm <host>
1412+
[build] rustc 0 <host> -> rustc 1 <host>
1413+
[build] rustc 1 <host> -> std 1 <host>
1414+
[check] compiletest <host>
1415+
");
1416+
}
1417+
13941418
#[test]
13951419
fn test_exclude() {
13961420
let ctx = TestCtx::new();

0 commit comments

Comments
 (0)