From ce717476ffc2d7ca1bc737942e778b8e0e813e05 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 11 Aug 2020 16:49:39 -0700 Subject: Add a script to verify the Platform Support page is up-to-date. --- src/bootstrap/builder.rs | 1 + src/bootstrap/test.rs | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) (limited to 'src/bootstrap') diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index e13a5f24653..4b0905bd6c1 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -404,6 +404,7 @@ impl<'a> Builder<'a> { test::CrateLibrustc, test::CrateRustdoc, test::Linkcheck, + test::TierCheck, test::Cargotest, test::Cargo, test::Rls, diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index bb5b9296c0a..11e2564305f 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -2043,3 +2043,47 @@ impl Step for Bootstrap { run.builder.ensure(Bootstrap); } } + +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub struct TierCheck { + pub compiler: Compiler, + target: TargetSelection, +} + +impl Step for TierCheck { + type Output = (); + const DEFAULT: bool = true; + const ONLY_HOSTS: bool = true; + + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { + run.path("src/tools/tier-check") + } + + fn make_run(run: RunConfig<'_>) { + let compiler = run.builder.compiler_for(run.builder.top_stage, run.host, run.host); + run.builder.ensure(TierCheck { compiler, target: run.host }); + } + + /// Tests the Platform Support page in the rustc book. + fn run(self, builder: &Builder<'_>) { + builder.ensure(compile::Std { compiler: self.compiler, target: self.target }); + let mut cargo = tool::prepare_tool_cargo( + builder, + self.compiler, + Mode::ToolRustc, + self.target, + "run", + "src/tools/tier-check", + SourceType::InTree, + &[], + ); + cargo.arg(builder.src.join("src/doc/rustc/src/platform-support.md")); + cargo.arg(&builder.rustc(self.compiler)); + if builder.is_verbose() { + cargo.arg("--verbose"); + } + + builder.info("platform support check"); + try_run(builder, &mut cargo.into()); + } +} -- cgit 1.4.1-3-g733a5