Skip to content

Commit fc6e763

Browse files
committed
Rollup merge of #44616 - alexcrichton:rustdoc-fix-again-whee, r=Mark-Simulacrum
rustbuild: Fix test "test rustdoc" invocation Previously it would use the librustc output directory which would cause rustdoc to get entirely recompiled, whereas the intention is that it uses the already-compiled artifacts from building rustdoc itself, using the tool output directory
2 parents 9730a36 + 3da54fb commit fc6e763

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/bootstrap/check.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1118,10 +1118,11 @@ impl Step for Rustdoc {
11181118
let compiler = builder.compiler(builder.top_stage, self.host);
11191119
let target = compiler.host;
11201120

1121-
builder.ensure(RemoteCopyLibs { compiler, target });
1122-
1123-
let mut cargo = builder.cargo(compiler, Mode::Librustc, target, test_kind.subcommand());
1124-
compile::rustc_cargo(build, &compiler, target, &mut cargo);
1121+
let mut cargo = tool::prepare_tool_cargo(builder,
1122+
compiler,
1123+
target,
1124+
test_kind.subcommand(),
1125+
"src/tools/rustdoc");
11251126
let _folder = build.fold_output(|| {
11261127
format!("{}_stage{}-rustdoc", test_kind.subcommand(), compiler.stage)
11271128
});

src/bootstrap/tool.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,21 @@ impl Step for ToolBuild {
9494
let _folder = build.fold_output(|| format!("stage{}-{}", compiler.stage, tool));
9595
println!("Building stage{} tool {} ({})", compiler.stage, tool, target);
9696

97-
let mut cargo = prepare_tool_cargo(builder, compiler, target, path);
97+
let mut cargo = prepare_tool_cargo(builder, compiler, target, "build", path);
9898
build.run(&mut cargo);
9999
build.cargo_out(compiler, Mode::Tool, target).join(exe(tool, &compiler.host))
100100
}
101101
}
102102

103-
fn prepare_tool_cargo(
103+
pub fn prepare_tool_cargo(
104104
builder: &Builder,
105105
compiler: Compiler,
106106
target: Interned<String>,
107+
command: &'static str,
107108
path: &'static str,
108109
) -> Command {
109110
let build = builder.build;
110-
let mut cargo = builder.cargo(compiler, Mode::Tool, target, "build");
111+
let mut cargo = builder.cargo(compiler, Mode::Tool, target, command);
111112
let dir = build.src.join(path);
112113
cargo.arg("--manifest-path").arg(dir.join("Cargo.toml"));
113114

@@ -295,6 +296,7 @@ impl Step for Rustdoc {
295296
let mut cargo = prepare_tool_cargo(builder,
296297
build_compiler,
297298
target,
299+
"build",
298300
"src/tools/rustdoc");
299301
build.run(&mut cargo);
300302
// Cargo adds a number of paths to the dylib search path on windows, which results in

0 commit comments

Comments
 (0)