use cache::Interned;
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-struct CleanTools {
- compiler: Compiler,
- target: Interned<String>,
- mode: Mode,
+pub struct CleanTools {
+ pub compiler: Compiler,
+ pub target: Interned<String>,
+ pub mode: Mode,
}
impl Step for CleanTools {
let target = self.target;
let tool = self.tool;
- builder.ensure(CleanTools { compiler, target, mode: self.mode });
match self.mode {
Mode::Libstd => builder.ensure(compile::Std { compiler, target }),
Mode::Libtest => builder.ensure(compile::Test { compiler, target }),
}
cargo.env("CFG_RELEASE_CHANNEL", &build.config.channel);
+ cargo.env("CFG_VERSION", build.rust_version());
let info = GitInfo::new(&build.config, &dir);
if let Some(sha) = info.sha() {
Linkchecker, "src/tools/linkchecker", "linkchecker", Mode::Libstd;
CargoTest, "src/tools/cargotest", "cargotest", Mode::Libstd;
Compiletest, "src/tools/compiletest", "compiletest", Mode::Libtest;
- BuildManifest, "src/tools/build-manifest", "build-manifest", Mode::Librustc;
+ BuildManifest, "src/tools/build-manifest", "build-manifest", Mode::Libstd;
RemoteTestClient, "src/tools/remote-test-client", "remote-test-client", Mode::Libstd;
RustInstaller, "src/tools/rust-installer", "rust-installer", Mode::Libstd;
);
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Rustdoc {
- pub target_compiler: Compiler,
+ pub host: Interned<String>,
}
impl Step for Rustdoc {
fn make_run(run: RunConfig) {
run.builder.ensure(Rustdoc {
- target_compiler: run.builder.compiler(run.builder.top_stage, run.host),
+ host: run.host,
});
}
fn run(self, builder: &Builder) -> PathBuf {
let build = builder.build;
- let target_compiler = self.target_compiler;
+ let target_compiler = builder.compiler(builder.top_stage, self.host);
let target = target_compiler.host;
let build_compiler = if target_compiler.stage == 0 {
builder.compiler(0, builder.build.build)
} else if target_compiler.stage >= 2 {
// Past stage 2, we consider the compiler to be ABI-compatible and hence capable of
// building rustdoc itself.
- target_compiler
+ builder.compiler(target_compiler.stage, builder.build.build)
} else {
// Similar to `compile::Assemble`, build with the previous stage's compiler. Otherwise
// we'd have stageN/bin/rustc and stageN/bin/rustdoc be effectively different stage
builder.compiler(target_compiler.stage - 1, builder.build.build)
};
- builder.ensure(CleanTools { compiler: build_compiler, target, mode: Mode::Librustc });
builder.ensure(compile::Rustc { compiler: build_compiler, target });
let _folder = build.fold_output(|| format!("stage{}-rustdoc", target_compiler.stage));
let mut cargo = prepare_tool_cargo(builder, build_compiler, target, "rustdoc");
build.run(&mut cargo);
+ // Cargo adds a number of paths to the dylib search path on windows, which results in
+ // the wrong rustdoc being executed. To avoid the conflicting rustdocs, we name the "tool"
+ // rustdoc a different name.
let tool_rustdoc = build.cargo_out(build_compiler, Mode::Tool, target)
- .join(exe("rustdoc", &target_compiler.host));
+ .join(exe("rustdoc-tool-binary", &target_compiler.host));
// don't create a stage0-sysroot/bin directory.
if target_compiler.stage > 0 {