Skip to content

Commit c10e7dd

Browse files
committed
Move RustdocTheme to rustdoc_tests
1 parent 70b63a6 commit c10e7dd

File tree

2 files changed

+40
-41
lines changed

2 files changed

+40
-41
lines changed

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

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -200,44 +200,6 @@ impl Step for HtmlCheck {
200200
.run(builder);
201201
}
202202
}
203-
204-
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
205-
pub struct RustdocTheme {
206-
pub compiler: Compiler,
207-
}
208-
209-
impl Step for RustdocTheme {
210-
type Output = ();
211-
const DEFAULT: bool = true;
212-
const ONLY_HOSTS: bool = true;
213-
214-
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
215-
run.path("src/tools/rustdoc-themes")
216-
}
217-
218-
fn make_run(run: RunConfig<'_>) {
219-
let compiler = run.builder.compiler(run.builder.top_stage, run.target);
220-
221-
run.builder.ensure(RustdocTheme { compiler });
222-
}
223-
224-
fn run(self, builder: &Builder<'_>) {
225-
let rustdoc = builder.bootstrap_out.join("rustdoc");
226-
let mut cmd = builder.tool_cmd(Tool::RustdocTheme);
227-
cmd.arg(rustdoc.to_str().unwrap())
228-
.arg(builder.src.join("src/librustdoc/html/static/css/rustdoc.css").to_str().unwrap())
229-
.env("RUSTC_STAGE", self.compiler.stage.to_string())
230-
.env("RUSTC_SYSROOT", builder.sysroot(self.compiler))
231-
.env("RUSTDOC_LIBDIR", builder.sysroot_target_libdir(self.compiler, self.compiler.host))
232-
.env("CFG_RELEASE_CHANNEL", &builder.config.channel)
233-
.env("RUSTDOC_REAL", builder.rustdoc(self.compiler))
234-
.env("RUSTC_BOOTSTRAP", "1");
235-
cmd.args(linker_args(builder, self.compiler.host, LldThreads::No));
236-
237-
cmd.delay_failure().run(builder);
238-
}
239-
}
240-
241203
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
242204
pub struct CrateBuildHelper {
243205
host: TargetSelection,

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

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ use std::path::PathBuf;
77
use super::test_helpers::run_cargo_test;
88
use crate::Mode;
99
use crate::core::build_steps::compile;
10-
use crate::core::build_steps::tool::{self, SourceType};
11-
use crate::core::builder::{Builder, RunConfig, ShouldRun, Step};
10+
use crate::core::build_steps::tool::{self, SourceType, Tool};
11+
use crate::core::builder::{Builder, Compiler, RunConfig, ShouldRun, Step};
1212
use crate::core::config::TargetSelection;
13-
use crate::utils::helpers::{dylib_path, dylib_path_var};
13+
use crate::utils::helpers::{LldThreads, dylib_path, dylib_path_var, linker_args};
1414

1515
/// Rustdoc is special in various ways, which is why this step is different from `Crate`.
1616
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -168,3 +168,40 @@ impl Step for CrateRustdocJsonTypes {
168168
);
169169
}
170170
}
171+
172+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
173+
pub struct RustdocTheme {
174+
pub compiler: Compiler,
175+
}
176+
177+
impl Step for RustdocTheme {
178+
type Output = ();
179+
const DEFAULT: bool = true;
180+
const ONLY_HOSTS: bool = true;
181+
182+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
183+
run.path("src/tools/rustdoc-themes")
184+
}
185+
186+
fn make_run(run: RunConfig<'_>) {
187+
let compiler = run.builder.compiler(run.builder.top_stage, run.target);
188+
189+
run.builder.ensure(RustdocTheme { compiler });
190+
}
191+
192+
fn run(self, builder: &Builder<'_>) {
193+
let rustdoc = builder.bootstrap_out.join("rustdoc");
194+
let mut cmd = builder.tool_cmd(Tool::RustdocTheme);
195+
cmd.arg(rustdoc.to_str().unwrap())
196+
.arg(builder.src.join("src/librustdoc/html/static/css/rustdoc.css").to_str().unwrap())
197+
.env("RUSTC_STAGE", self.compiler.stage.to_string())
198+
.env("RUSTC_SYSROOT", builder.sysroot(self.compiler))
199+
.env("RUSTDOC_LIBDIR", builder.sysroot_target_libdir(self.compiler, self.compiler.host))
200+
.env("CFG_RELEASE_CHANNEL", &builder.config.channel)
201+
.env("RUSTDOC_REAL", builder.rustdoc(self.compiler))
202+
.env("RUSTC_BOOTSTRAP", "1");
203+
cmd.args(linker_args(builder, self.compiler.host, LldThreads::No));
204+
205+
cmd.delay_failure().run(builder);
206+
}
207+
}

0 commit comments

Comments
 (0)