Skip to content

Commit 9a75636

Browse files
committed
Do not run lint-docs tests in stage 1 x test by default
1 parent a000297 commit 9a75636

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

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

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3431,24 +3431,22 @@ impl Step for LintDocs {
34313431
const IS_HOST: bool = true;
34323432

34333433
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
3434-
run.path("src/tools/lint-docs")
3434+
let stage = run.builder.top_stage;
3435+
// Lint docs tests might not work with stage 1, so do not run this test by default in
3436+
// `x test` below stage 2.
3437+
run.path("src/tools/lint-docs").default_condition(stage > 1)
34353438
}
34363439

34373440
fn make_run(run: RunConfig<'_>) {
3438-
// Bump the stage to 2, because the rustc book requires an in-tree compiler.
3439-
// At the same time, since this step is enabled by default, we don't want `x test` to fail
3440-
// in stage 1.
3441-
let stage = if run.builder.config.is_explicit_stage() || run.builder.top_stage >= 2 {
3442-
run.builder.top_stage
3443-
} else {
3444-
2
3445-
};
3441+
if run.builder.top_stage < 2 {
3442+
eprintln!("WARNING: lint-docs tests might not work below stage 2");
3443+
}
34463444

34473445
run.builder.ensure(LintDocs {
34483446
build_compiler: prepare_doc_compiler(
34493447
run.builder,
34503448
run.builder.config.host_target,
3451-
stage,
3449+
run.builder.top_stage,
34523450
),
34533451
target: run.target,
34543452
});

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2064,8 +2064,6 @@ mod snapshot {
20642064
[test] link-check <host>
20652065
[test] tier-check <host>
20662066
[test] rustc 0 <host> -> rust-analyzer 1 <host>
2067-
[doc] rustc (book) <host>
2068-
[test] rustc 1 <host> -> lint-docs 2 <host>
20692067
[build] rustc 0 <host> -> RustdocTheme 1 <host>
20702068
[test] rustdoc-theme 1 <host>
20712069
[test] RustdocUi <host>

0 commit comments

Comments
 (0)