diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index c9c9c73c84a..2d15cae4c02 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -806,7 +806,7 @@ impl<'a> Builder<'a> { ); } - if mode == Mode::Tool { + if [Mode::ToolRustc, Mode::ToolStd, Mode::ToolTest].iter().any(|m| &mode == m) { // Tools like cargo and rls don't get debuginfo by default right now, but this can be // enabled in the config. Adding debuginfo makes them several times larger. if self.config.rust_debuginfo_tools { @@ -871,7 +871,7 @@ impl<'a> Builder<'a> { // // If LLVM support is disabled we need to use the snapshot compiler to compile // build scripts, as the new compiler doesn't support executables. - if mode == Mode::Libstd || !self.config.llvm_enabled { + if mode == Mode::Std || !self.config.llvm_enabled { cargo .env("RUSTC_SNAPSHOT", &self.initial_rustc) .env("RUSTC_SNAPSHOT_LIBDIR", self.rustc_snapshot_libdir()); @@ -903,7 +903,7 @@ impl<'a> Builder<'a> { cargo.env("RUSTC_VERBOSE", format!("{}", self.verbosity)); // in std, we want to avoid denying warnings for stage 0 as that makes cfg's painful. - if self.config.deny_warnings && !(mode == Mode::Libstd && stage == 0) { + if self.config.deny_warnings && !(mode == Mode::Std && stage == 0) { cargo.env("RUSTC_DENY_WARNINGS", "1"); } @@ -963,7 +963,7 @@ impl<'a> Builder<'a> { } if cmd == "build" - && mode == Mode::Libstd + && mode == Mode::Std && self.config.extended && compiler.is_final_stage(self) { @@ -1012,7 +1012,7 @@ impl<'a> Builder<'a> { // be resolved because MinGW has the import library. The downside is we // don't get newer functions from Windows, but we don't use any of them // anyway. - if mode != Mode::Tool { + if ![Mode::ToolRustc, Mode::ToolStd, Mode::ToolTest].iter().any(|m| &mode == m) { cargo.env("WINAPI_NO_BUNDLED_LIBRARIES", "1"); } @@ -1751,7 +1751,7 @@ mod __test { &[test::Crate { compiler: Compiler { host, stage: 0 }, target: host, - mode: Mode::Libstd, + mode: Mode::Std, test_kind: test::TestKind::Test, krate: INTERNER.intern_str("std"), },] diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs index a516af58b1e..252f3121a6b 100644 --- a/src/bootstrap/check.rs +++ b/src/bootstrap/check.rs @@ -40,10 +40,10 @@ impl Step for Std { let target = self.target; let compiler = builder.compiler(0, builder.config.build); - let out_dir = builder.stage_out(compiler, Mode::Libstd); + let out_dir = builder.stage_out(compiler, Mode::Std); builder.clear_if_dirty(&out_dir, &builder.rustc(compiler)); - let mut cargo = builder.cargo(compiler, Mode::Libstd, target, "check"); + let mut cargo = builder.cargo(compiler, Mode::Std, target, "check"); std_cargo(builder, &compiler, target, &mut cargo); let _folder = builder.fold_output(|| format!("stage{}-std", compiler.stage)); @@ -87,11 +87,11 @@ impl Step for Rustc { let compiler = builder.compiler(0, builder.config.build); let target = self.target; - let stage_out = builder.stage_out(compiler, Mode::Librustc); + let stage_out = builder.stage_out(compiler, Mode::Rustc); builder.clear_if_dirty(&stage_out, &libstd_stamp(builder, compiler, target)); builder.clear_if_dirty(&stage_out, &libtest_stamp(builder, compiler, target)); - let mut cargo = builder.cargo(compiler, Mode::Librustc, target, "check"); + let mut cargo = builder.cargo(compiler, Mode::Rustc, target, "check"); rustc_cargo(builder, &mut cargo); let _folder = builder.fold_output(|| format!("stage{}-rustc", compiler.stage)); @@ -137,7 +137,7 @@ impl Step for CodegenBackend { let target = self.target; let backend = self.backend; - let mut cargo = builder.cargo(compiler, Mode::Librustc, target, "check"); + let mut cargo = builder.cargo(compiler, Mode::Codegen, target, "check"); let features = builder.rustc_features().to_string(); cargo.arg("--manifest-path").arg(builder.src.join("src/librustc_codegen_llvm/Cargo.toml")); rustc_cargo_env(builder, &mut cargo); @@ -175,10 +175,10 @@ impl Step for Test { let compiler = builder.compiler(0, builder.config.build); let target = self.target; - let out_dir = builder.stage_out(compiler, Mode::Libtest); + let out_dir = builder.stage_out(compiler, Mode::Test); builder.clear_if_dirty(&out_dir, &libstd_stamp(builder, compiler, target)); - let mut cargo = builder.cargo(compiler, Mode::Libtest, target, "check"); + let mut cargo = builder.cargo(compiler, Mode::Test, target, "check"); test_cargo(builder, &compiler, target, &mut cargo); let _folder = builder.fold_output(|| format!("stage{}-test", compiler.stage)); @@ -236,7 +236,7 @@ impl Step for Rustdoc { builder.ensure(tool::CleanTools { compiler, target, - mode: Mode::Tool, + mode: Mode::ToolRustc, }); } } @@ -244,19 +244,19 @@ impl Step for Rustdoc { /// Cargo's output path for the standard library in a given stage, compiled /// by a particular compiler for the specified target. pub fn libstd_stamp(builder: &Builder, compiler: Compiler, target: Interned) -> PathBuf { - builder.cargo_out(compiler, Mode::Libstd, target).join(".libstd-check.stamp") + builder.cargo_out(compiler, Mode::Std, target).join(".libstd-check.stamp") } /// Cargo's output path for libtest in a given stage, compiled by a particular /// compiler for the specified target. pub fn libtest_stamp(builder: &Builder, compiler: Compiler, target: Interned) -> PathBuf { - builder.cargo_out(compiler, Mode::Libtest, target).join(".libtest-check.stamp") + builder.cargo_out(compiler, Mode::Test, target).join(".libtest-check.stamp") } /// Cargo's output path for librustc in a given stage, compiled by a particular /// compiler for the specified target. pub fn librustc_stamp(builder: &Builder, compiler: Compiler, target: Interned) -> PathBuf { - builder.cargo_out(compiler, Mode::Librustc, target).join(".librustc-check.stamp") + builder.cargo_out(compiler, Mode::Rustc, target).join(".librustc-check.stamp") } /// Cargo's output path for librustc_codegen_llvm in a given stage, compiled by a particular @@ -265,12 +265,12 @@ fn codegen_backend_stamp(builder: &Builder, compiler: Compiler, target: Interned, backend: Interned) -> PathBuf { - builder.cargo_out(compiler, Mode::Librustc, target) + builder.cargo_out(compiler, Mode::Codegen, target) .join(format!(".librustc_codegen_llvm-{}-check.stamp", backend)) } /// Cargo's output path for rustdoc in a given stage, compiled by a particular /// compiler for the specified target. pub fn rustdoc_stamp(builder: &Builder, compiler: Compiler, target: Interned) -> PathBuf { - builder.cargo_out(compiler, Mode::Tool, target).join(".rustdoc-check.stamp") + builder.cargo_out(compiler, Mode::ToolRustc, target).join(".rustdoc-check.stamp") } diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index 231ed9d40d2..72fbbf1a5ad 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -98,9 +98,9 @@ impl Step for Std { copy_musl_third_party_objects(builder, target, &libdir); } - let out_dir = builder.cargo_out(compiler, Mode::Libstd, target); + let out_dir = builder.cargo_out(compiler, Mode::Std, target); builder.clear_if_dirty(&out_dir, &builder.rustc(compiler)); - let mut cargo = builder.cargo(compiler, Mode::Libstd, target, "build"); + let mut cargo = builder.cargo(compiler, Mode::Std, target, "build"); std_cargo(builder, &compiler, target, &mut cargo); let _folder = builder.fold_output(|| format!("stage{}-std", compiler.stage)); @@ -240,7 +240,7 @@ impl Step for StdLink { builder.ensure(tool::CleanTools { compiler: target_compiler, target, - mode: Mode::Libstd, + mode: Mode::Std, }); } } @@ -368,9 +368,9 @@ impl Step for Test { return; } - let out_dir = builder.cargo_out(compiler, Mode::Libtest, target); + let out_dir = builder.cargo_out(compiler, Mode::Test, target); builder.clear_if_dirty(&out_dir, &libstd_stamp(builder, compiler, target)); - let mut cargo = builder.cargo(compiler, Mode::Libtest, target, "build"); + let mut cargo = builder.cargo(compiler, Mode::Test, target, "build"); test_cargo(builder, &compiler, target, &mut cargo); let _folder = builder.fold_output(|| format!("stage{}-test", compiler.stage)); @@ -431,7 +431,7 @@ impl Step for TestLink { builder.ensure(tool::CleanTools { compiler: target_compiler, target, - mode: Mode::Libtest, + mode: Mode::Test, }); } } @@ -489,11 +489,11 @@ impl Step for Rustc { compiler: builder.compiler(self.compiler.stage, builder.config.build), target: builder.config.build, }); - let cargo_out = builder.cargo_out(compiler, Mode::Librustc, target); + let cargo_out = builder.cargo_out(compiler, Mode::Rustc, target); builder.clear_if_dirty(&cargo_out, &libstd_stamp(builder, compiler, target)); builder.clear_if_dirty(&cargo_out, &libtest_stamp(builder, compiler, target)); - let mut cargo = builder.cargo(compiler, Mode::Librustc, target, "build"); + let mut cargo = builder.cargo(compiler, Mode::Rustc, target, "build"); rustc_cargo(builder, &mut cargo); let _folder = builder.fold_output(|| format!("stage{}-rustc", compiler.stage)); @@ -585,7 +585,7 @@ impl Step for RustcLink { builder.ensure(tool::CleanTools { compiler: target_compiler, target, - mode: Mode::Librustc, + mode: Mode::Rustc, }); } } @@ -634,7 +634,7 @@ impl Step for CodegenBackend { return; } - let mut cargo = builder.cargo(compiler, Mode::Librustc, target, "build"); + let mut cargo = builder.cargo(compiler, Mode::Codegen, target, "build"); let mut features = builder.rustc_features().to_string(); cargo.arg("--manifest-path") .arg(builder.src.join("src/librustc_codegen_llvm/Cargo.toml")); @@ -642,7 +642,7 @@ impl Step for CodegenBackend { features += &build_codegen_backend(&builder, &mut cargo, &compiler, target, backend); - let tmp_stamp = builder.cargo_out(compiler, Mode::Librustc, target) + let tmp_stamp = builder.cargo_out(compiler, Mode::Codegen, target) .join(".tmp.stamp"); let _folder = builder.fold_output(|| format!("stage{}-rustc_codegen_llvm", compiler.stage)); @@ -793,19 +793,19 @@ fn copy_lld_to_sysroot(builder: &Builder, /// Cargo's output path for the standard library in a given stage, compiled /// by a particular compiler for the specified target. pub fn libstd_stamp(builder: &Builder, compiler: Compiler, target: Interned) -> PathBuf { - builder.cargo_out(compiler, Mode::Libstd, target).join(".libstd.stamp") + builder.cargo_out(compiler, Mode::Std, target).join(".libstd.stamp") } /// Cargo's output path for libtest in a given stage, compiled by a particular /// compiler for the specified target. pub fn libtest_stamp(builder: &Builder, compiler: Compiler, target: Interned) -> PathBuf { - builder.cargo_out(compiler, Mode::Libtest, target).join(".libtest.stamp") + builder.cargo_out(compiler, Mode::Test, target).join(".libtest.stamp") } /// Cargo's output path for librustc in a given stage, compiled by a particular /// compiler for the specified target. pub fn librustc_stamp(builder: &Builder, compiler: Compiler, target: Interned) -> PathBuf { - builder.cargo_out(compiler, Mode::Librustc, target).join(".librustc.stamp") + builder.cargo_out(compiler, Mode::Rustc, target).join(".librustc.stamp") } /// Cargo's output path for librustc_codegen_llvm in a given stage, compiled by a particular @@ -814,7 +814,7 @@ fn codegen_backend_stamp(builder: &Builder, compiler: Compiler, target: Interned, backend: Interned) -> PathBuf { - builder.cargo_out(compiler, Mode::Librustc, target) + builder.cargo_out(compiler, Mode::Codegen, target) .join(format!(".librustc_codegen_llvm-{}.stamp", backend)) } @@ -971,7 +971,7 @@ impl Step for Assemble { } // Link the compiler binary itself into place - let out_dir = builder.cargo_out(build_compiler, Mode::Librustc, host); + let out_dir = builder.cargo_out(build_compiler, Mode::Rustc, host); let rustc = out_dir.join(exe("rustc_binary", &*host)); let bindir = sysroot.join("bin"); t!(fs::create_dir_all(&bindir)); diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 82ba03ec777..3dbeea307c2 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -722,7 +722,7 @@ impl Step for Analysis { let image = tmpdir(builder).join(format!("{}-{}-image", name, target)); - let src = builder.stage_out(compiler, Mode::Libstd) + let src = builder.stage_out(compiler, Mode::Std) .join(target).join(builder.cargo_dir()).join("deps"); let image_src = src.join("save-analysis"); diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs index cb229938521..4aa42a75226 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -463,7 +463,7 @@ impl Step for Std { }; builder.ensure(compile::Std { compiler, target }); - let out_dir = builder.stage_out(compiler, Mode::Libstd) + let out_dir = builder.stage_out(compiler, Mode::Std) .join(target).join("doc"); // Here what we're doing is creating a *symlink* (directory junction on @@ -483,7 +483,7 @@ impl Step for Std { builder.clear_if_dirty(&my_out, &rustdoc); t!(symlink_dir_force(&builder.config, &my_out, &out_dir)); - let mut cargo = builder.cargo(compiler, Mode::Libstd, target, "doc"); + let mut cargo = builder.cargo(compiler, Mode::Std, target, "doc"); compile::std_cargo(builder, &compiler, target, &mut cargo); // Keep a whitelist so we do not build internal stdlib crates, these will be @@ -546,7 +546,7 @@ impl Step for Test { builder.ensure(Std { stage, target }); builder.ensure(compile::Test { compiler, target }); - let out_dir = builder.stage_out(compiler, Mode::Libtest) + let out_dir = builder.stage_out(compiler, Mode::Test) .join(target).join("doc"); // See docs in std above for why we symlink @@ -554,7 +554,7 @@ impl Step for Test { builder.clear_if_dirty(&my_out, &rustdoc); t!(symlink_dir_force(&builder.config, &my_out, &out_dir)); - let mut cargo = builder.cargo(compiler, Mode::Libtest, target, "doc"); + let mut cargo = builder.cargo(compiler, Mode::Test, target, "doc"); compile::test_cargo(builder, &compiler, target, &mut cargo); cargo.arg("--no-deps").arg("-p").arg("test"); @@ -614,7 +614,7 @@ impl Step for WhitelistedRustc { builder.ensure(Std { stage, target }); builder.ensure(compile::Rustc { compiler, target }); - let out_dir = builder.stage_out(compiler, Mode::Librustc) + let out_dir = builder.stage_out(compiler, Mode::Rustc) .join(target).join("doc"); // See docs in std above for why we symlink @@ -622,7 +622,7 @@ impl Step for WhitelistedRustc { builder.clear_if_dirty(&my_out, &rustdoc); t!(symlink_dir_force(&builder.config, &my_out, &out_dir)); - let mut cargo = builder.cargo(compiler, Mode::Librustc, target, "doc"); + let mut cargo = builder.cargo(compiler, Mode::Rustc, target, "doc"); compile::rustc_cargo(builder, &mut cargo); // We don't want to build docs for internal compiler dependencies in this @@ -698,12 +698,12 @@ impl Step for Rustc { // We do not symlink to the same shared folder that already contains std library // documentation from previous steps as we do not want to include that. - let out_dir = builder.stage_out(compiler, Mode::Librustc).join(target).join("doc"); + let out_dir = builder.stage_out(compiler, Mode::Rustc).join(target).join("doc"); builder.clear_if_dirty(&out, &rustdoc); t!(symlink_dir_force(&builder.config, &out, &out_dir)); // Build cargo command. - let mut cargo = builder.cargo(compiler, Mode::Librustc, target, "doc"); + let mut cargo = builder.cargo(compiler, Mode::Rustc, target, "doc"); cargo.env("RUSTDOCFLAGS", "--document-private-items"); compile::rustc_cargo(builder, &mut cargo); diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index f64161fb027..4367fb36947 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -307,16 +307,20 @@ impl Crate { #[derive(Debug, Hash, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub enum Mode { /// Build the standard library, placing output in the "stageN-std" directory. - Libstd, + Std, /// Build libtest, placing output in the "stageN-test" directory. - Libtest, + Test, - /// Build librustc and compiler libraries, placing output in the "stageN-rustc" directory. - Librustc, + /// Build librustc, codegen and compiler libraries, placing output + /// in the "stageN-rustc" directory. + Rustc, + Codegen, - /// Build some tool, placing output in the "stageN-tools" directory. - Tool, + /// Build some tools, placing output in the "stageN-tools" directory. + ToolStd, + ToolTest, + ToolRustc, } impl Build { @@ -517,10 +521,13 @@ impl Build { /// The mode indicates what the root directory is for. fn stage_out(&self, compiler: Compiler, mode: Mode) -> PathBuf { let suffix = match mode { - Mode::Libstd => "-std", - Mode::Libtest => "-test", - Mode::Tool => "-tools", - Mode::Librustc => "-rustc", + Mode::Std => "-std", + Mode::ToolStd => "-tools", + Mode::Test => "-test", + Mode::ToolTest => "-tools", + Mode::Codegen => "-rustc", + Mode::Rustc => "-rustc", + Mode::ToolRustc => "-tools", }; self.out.join(&*compiler.host) .join(format!("stage{}{}", compiler.stage, suffix)) diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index c94cb576032..260581617ac 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -222,7 +222,7 @@ impl Step for Cargo { compiler, target: self.host, }); - let mut cargo = builder.cargo(compiler, Mode::Tool, self.host, "test"); + let mut cargo = builder.cargo(compiler, Mode::ToolRustc, self.host, "test"); cargo .arg("--manifest-path") .arg(builder.src.join("src/tools/cargo/Cargo.toml")); @@ -383,7 +383,7 @@ impl Step for Miri { extra_features: Vec::new(), }); if let Some(miri) = miri { - let mut cargo = builder.cargo(compiler, Mode::Tool, host, "test"); + let mut cargo = builder.cargo(compiler, Mode::ToolRustc, host, "test"); cargo .arg("--manifest-path") .arg(builder.src.join("src/tools/miri/Cargo.toml")); @@ -441,7 +441,7 @@ impl Step for Clippy { extra_features: Vec::new(), }); if let Some(clippy) = clippy { - let mut cargo = builder.cargo(compiler, Mode::Tool, host, "test"); + let mut cargo = builder.cargo(compiler, Mode::ToolRustc, host, "test"); cargo .arg("--manifest-path") .arg(builder.src.join("src/tools/clippy/Cargo.toml")); @@ -453,7 +453,7 @@ impl Step for Clippy { cargo.env("RUSTC_TEST_SUITE", builder.rustc(compiler)); cargo.env("RUSTC_LIB_PATH", builder.rustc_libdir(compiler)); let host_libs = builder - .stage_out(compiler, Mode::Tool) + .stage_out(compiler, Mode::ToolRustc) .join(builder.cargo_dir()); cargo.env("HOST_LIBS", host_libs); // clippy tests need to find the driver @@ -1434,7 +1434,7 @@ impl Step for CrateLibrustc { builder.ensure(Crate { compiler: self.compiler, target: self.target, - mode: Mode::Librustc, + mode: Mode::Rustc, test_kind: self.test_kind, krate: self.krate, }); @@ -1485,7 +1485,7 @@ impl Step for CrateNotDefault { builder.ensure(Crate { compiler: self.compiler, target: self.target, - mode: Mode::Libstd, + mode: Mode::Std, test_kind: self.test_kind, krate: INTERNER.intern_str(self.krate), }); @@ -1538,12 +1538,12 @@ impl Step for Crate { for krate in builder.in_tree_crates("std") { if run.path.ends_with(&krate.local_path(&builder)) { - make(Mode::Libstd, krate); + make(Mode::Std, krate); } } for krate in builder.in_tree_crates("test") { if run.path.ends_with(&krate.local_path(&builder)) { - make(Mode::Libtest, krate); + make(Mode::Test, krate); } } } @@ -1578,13 +1578,13 @@ impl Step for Crate { let mut cargo = builder.cargo(compiler, mode, target, test_kind.subcommand()); match mode { - Mode::Libstd => { + Mode::Std => { compile::std_cargo(builder, &compiler, target, &mut cargo); } - Mode::Libtest => { + Mode::Test => { compile::test_cargo(builder, &compiler, target, &mut cargo); } - Mode::Librustc => { + Mode::Rustc => { builder.ensure(compile::Rustc { compiler, target }); compile::rustc_cargo(builder, &mut cargo); } diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs index 29f37b36e2a..f1eff109306 100644 --- a/src/bootstrap/tool.rs +++ b/src/bootstrap/tool.rs @@ -46,18 +46,18 @@ impl Step for CleanTools { // This is for the original compiler, but if we're forced to use stage 1, then // std/test/rustc stamps won't exist in stage 2, so we need to get those from stage 1, since // we copy the libs forward. - let tools_dir = builder.stage_out(compiler, Mode::Tool); + let tools_dir = builder.stage_out(compiler, Mode::ToolRustc); let compiler = if builder.force_use_stage1(compiler, target) { builder.compiler(1, compiler.host) } else { compiler }; - for &cur_mode in &[Mode::Libstd, Mode::Libtest, Mode::Librustc] { + for &cur_mode in &[Mode::ToolStd, Mode::ToolTest, Mode::ToolRustc] { let stamp = match cur_mode { - Mode::Libstd => libstd_stamp(builder, compiler, target), - Mode::Libtest => libtest_stamp(builder, compiler, target), - Mode::Librustc => librustc_stamp(builder, compiler, target), + Mode::ToolStd => libstd_stamp(builder, compiler, target), + Mode::ToolTest => libtest_stamp(builder, compiler, target), + Mode::ToolRustc => librustc_stamp(builder, compiler, target), _ => panic!(), }; @@ -104,10 +104,10 @@ impl Step for ToolBuild { let is_ext_tool = self.is_ext_tool; match self.mode { - Mode::Libstd => builder.ensure(compile::Std { compiler, target }), - Mode::Libtest => builder.ensure(compile::Test { compiler, target }), - Mode::Librustc => builder.ensure(compile::Rustc { compiler, target }), - Mode::Tool => panic!("unexpected Mode::Tool for tool build") + Mode::ToolStd => builder.ensure(compile::Std { compiler, target }), + Mode::ToolTest => builder.ensure(compile::Test { compiler, target }), + Mode::ToolRustc => builder.ensure(compile::Rustc { compiler, target }), + _ => panic!("unexpected Mode for tool build") } let mut cargo = prepare_tool_cargo(builder, compiler, target, "build", path); @@ -202,7 +202,7 @@ impl Step for ToolBuild { return None; } } else { - let cargo_out = builder.cargo_out(compiler, Mode::Tool, target) + let cargo_out = builder.cargo_out(compiler, Mode::ToolRustc, target) .join(exe(tool, &compiler.host)); let bin = builder.tools_dir(compiler).join(exe(tool, &compiler.host)); builder.copy(&cargo_out, &bin); @@ -218,7 +218,7 @@ pub fn prepare_tool_cargo( command: &'static str, path: &'static str, ) -> Command { - let mut cargo = builder.cargo(compiler, Mode::Tool, target, command); + let mut cargo = builder.cargo(compiler, Mode::ToolRustc, target, command); let dir = builder.src.join(path); cargo.arg("--manifest-path").arg(dir.join("Cargo.toml")); @@ -324,17 +324,17 @@ macro_rules! tool { } tool!( - Rustbook, "src/tools/rustbook", "rustbook", Mode::Librustc; - ErrorIndex, "src/tools/error_index_generator", "error_index_generator", Mode::Librustc; - UnstableBookGen, "src/tools/unstable-book-gen", "unstable-book-gen", Mode::Libstd; - Tidy, "src/tools/tidy", "tidy", Mode::Libstd; - 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::Libstd; - RemoteTestClient, "src/tools/remote-test-client", "remote-test-client", Mode::Libstd; - RustInstaller, "src/tools/rust-installer", "fabricate", Mode::Libstd; - RustdocTheme, "src/tools/rustdoc-themes", "rustdoc-themes", Mode::Libstd; + Rustbook, "src/tools/rustbook", "rustbook", Mode::ToolRustc; + ErrorIndex, "src/tools/error_index_generator", "error_index_generator", Mode::ToolRustc; + UnstableBookGen, "src/tools/unstable-book-gen", "unstable-book-gen", Mode::ToolStd; + Tidy, "src/tools/tidy", "tidy", Mode::ToolStd; + Linkchecker, "src/tools/linkchecker", "linkchecker", Mode::ToolStd; + CargoTest, "src/tools/cargotest", "cargotest", Mode::ToolStd; + Compiletest, "src/tools/compiletest", "compiletest", Mode::ToolTest; + BuildManifest, "src/tools/build-manifest", "build-manifest", Mode::ToolStd; + RemoteTestClient, "src/tools/remote-test-client", "remote-test-client", Mode::ToolStd; + RustInstaller, "src/tools/rust-installer", "fabricate", Mode::ToolStd; + RustdocTheme, "src/tools/rustdoc-themes", "rustdoc-themes", Mode::ToolStd; ); #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] @@ -362,7 +362,7 @@ impl Step for RemoteTestServer { compiler: self.compiler, target: self.target, tool: "remote-test-server", - mode: Mode::Libstd, + mode: Mode::ToolStd, path: "src/tools/remote-test-server", is_ext_tool: false, extra_features: Vec::new(), @@ -430,7 +430,7 @@ impl Step for Rustdoc { // 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 = builder.cargo_out(build_compiler, Mode::Tool, target) + let tool_rustdoc = builder.cargo_out(build_compiler, Mode::ToolRustc, target) .join(exe("rustdoc_tool_binary", &target_compiler.host)); // don't create a stage0-sysroot/bin directory. @@ -485,7 +485,7 @@ impl Step for Cargo { compiler: self.compiler, target: self.target, tool: "cargo", - mode: Mode::Librustc, + mode: Mode::ToolRustc, path: "src/tools/cargo", is_ext_tool: false, extra_features: Vec::new(), @@ -533,7 +533,7 @@ macro_rules! tool_extended { compiler: $sel.compiler, target: $sel.target, tool: $tool_name, - mode: Mode::Librustc, + mode: Mode::ToolRustc, path: $path, extra_features: $sel.extra_features, is_ext_tool: true, @@ -587,7 +587,7 @@ impl<'a> Builder<'a> { let host = &compiler.host; let mut lib_paths: Vec = vec![ PathBuf::from(&self.sysroot_libdir(compiler, compiler.host)), - self.cargo_out(compiler, Mode::Tool, *host).join("deps"), + self.cargo_out(compiler, Mode::ToolRustc, *host).join("deps"), ]; // On MSVC a tool may invoke a C compiler (e.g. compiletest in run-make