1 use std::collections::HashSet;
4 use std::path::{Path, PathBuf};
5 use std::process::{exit, Command};
9 use crate::builder::{Builder, Cargo as CargoCommand, RunConfig, ShouldRun, Step};
10 use crate::channel::GitInfo;
12 use crate::config::TargetSelection;
13 use crate::toolstate::ToolState;
14 use crate::util::{add_dylib_path, exe};
18 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
24 #[derive(Debug, Clone, Hash, PartialEq, Eq)]
27 target: TargetSelection,
31 is_optional_tool: bool,
32 source_type: SourceType,
33 extra_features: Vec<String>,
36 impl Step for ToolBuild {
37 type Output = Option<PathBuf>;
39 fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
43 /// Builds a tool in `src/tools`
45 /// This will build the specified tool with the specified `host` compiler in
46 /// `stage` into the normal cargo output directory.
47 fn run(self, builder: &Builder<'_>) -> Option<PathBuf> {
48 let compiler = self.compiler;
49 let target = self.target;
50 let mut tool = self.tool;
52 let is_optional_tool = self.is_optional_tool;
56 builder.ensure(compile::Std { compiler, target: compiler.host });
57 builder.ensure(compile::Rustc { compiler, target });
59 Mode::ToolStd => builder.ensure(compile::Std { compiler, target }),
60 Mode::ToolBootstrap => {} // uses downloaded stage0 compiler libs
61 _ => panic!("unexpected Mode for tool build"),
64 let cargo = prepare_tool_cargo(
75 builder.info(&format!("Building stage{} tool {} ({})", compiler.stage, tool, target));
76 let mut duplicates = Vec::new();
77 let is_expected = compile::stream_cargo(builder, cargo, vec![], &mut |msg| {
78 // Only care about big things like the RLS/Cargo for now
80 "rls" | "cargo" | "clippy-driver" | "miri" | "rustfmt" => {}
84 let (id, features, filenames) = match msg {
85 compile::CargoMessage::CompilerArtifact {
90 } => (package_id, features, filenames),
93 let features = features.iter().map(|s| s.to_string()).collect::<Vec<_>>();
95 for path in filenames {
96 let val = (tool, PathBuf::from(&*path), features.clone());
97 // we're only interested in deduplicating rlibs for now
98 if val.1.extension().and_then(|s| s.to_str()) != Some("rlib") {
102 // Don't worry about compiles that turn out to be host
103 // dependencies or build scripts. To skip these we look for
104 // anything that goes in `.../release/deps` but *doesn't* go in
105 // `$target/release/deps`. This ensure that outputs in
106 // `$target/release` are still considered candidates for
108 if let Some(parent) = val.1.parent() {
109 if parent.ends_with("release/deps") {
110 let maybe_target = parent
112 .and_then(|p| p.parent())
113 .and_then(|p| p.file_name())
114 .and_then(|p| p.to_str())
116 if maybe_target != &*target.triple {
122 // Record that we've built an artifact for `id`, and if one was
123 // already listed then we need to see if we reused the same
124 // artifact or produced a duplicate.
125 let mut artifacts = builder.tool_artifacts.borrow_mut();
126 let prev_artifacts = artifacts.entry(target).or_default();
127 let prev = match prev_artifacts.get(&*id) {
130 prev_artifacts.insert(id.to_string(), val);
135 return; // same path, same artifact
138 // If the paths are different and one of them *isn't* inside of
139 // `release/deps`, then it means it's probably in
140 // `$target/release`, or it's some final artifact like
141 // `libcargo.rlib`. In these situations Cargo probably just
142 // copied it up from `$target/release/deps/libcargo-xxxx.rlib`,
143 // so if the features are equal we can just skip it.
144 let prev_no_hash = prev.1.parent().unwrap().ends_with("release/deps");
145 let val_no_hash = val.1.parent().unwrap().ends_with("release/deps");
146 if prev.2 == val.2 || !prev_no_hash || !val_no_hash {
150 // ... and otherwise this looks like we duplicated some sort of
151 // compilation, so record it to generate an error later.
152 duplicates.push((id.to_string(), val, prev.clone()));
156 if is_expected && !duplicates.is_empty() {
158 "duplicate artifacts found when compiling a tool, this \
159 typically means that something was recompiled because \
160 a transitive dependency has different features activated \
161 than in a previous build:\n"
164 "the following dependencies are duplicated although they \
165 have the same features enabled:"
167 let (same, different): (Vec<_>, Vec<_>) =
168 duplicates.into_iter().partition(|(_, cur, prev)| cur.2 == prev.2);
169 for (id, cur, prev) in same {
172 println!(" `{}` ({:?})\n `{}` ({:?})", cur.0, cur.1, prev.0, prev.1);
174 println!("the following dependencies have different features:");
175 for (id, cur, prev) in different {
177 let cur_features: HashSet<_> = cur.2.into_iter().collect();
178 let prev_features: HashSet<_> = prev.2.into_iter().collect();
180 " `{}` additionally enabled features {:?} at {:?}",
182 &cur_features - &prev_features,
186 " `{}` additionally enabled features {:?} at {:?}",
188 &prev_features - &cur_features,
194 "to fix this you will probably want to edit the local \
195 src/tools/rustc-workspace-hack/Cargo.toml crate, as \
196 that will update the dependency graph to ensure that \
197 these crates all share the same feature set"
199 panic!("tools should not compile multiple copies of the same crate");
202 builder.save_toolstate(
204 if is_expected { ToolState::TestFail } else { ToolState::BuildFail },
208 if !is_optional_tool {
214 // HACK(#82501): on Windows, the tools directory gets added to PATH when running tests, and
215 // compiletest confuses HTML tidy with the in-tree tidy. Name the in-tree tidy something
216 // different so the problem doesn't come up.
220 let cargo_out = builder.cargo_out(compiler, self.mode, target).join(exe(tool, target));
221 let bin = builder.tools_dir(compiler).join(exe(tool, target));
222 builder.copy(&cargo_out, &bin);
228 pub fn prepare_tool_cargo(
229 builder: &Builder<'_>,
232 target: TargetSelection,
233 command: &'static str,
235 source_type: SourceType,
236 extra_features: &[String],
238 let mut cargo = builder.cargo(compiler, mode, source_type, target, command);
239 let dir = builder.src.join(path);
240 cargo.arg("--manifest-path").arg(dir.join("Cargo.toml"));
242 let mut features = extra_features.to_vec();
243 if builder.build.config.cargo_native_static {
244 if path.ends_with("cargo")
245 || path.ends_with("rls")
246 || path.ends_with("clippy")
247 || path.ends_with("miri")
248 || path.ends_with("rustfmt")
250 cargo.env("LIBZ_SYS_STATIC", "1");
251 features.push("rustc-workspace-hack/all-static".to_string());
255 // if tools are using lzma we want to force the build script to build its
257 cargo.env("LZMA_API_STATIC", "1");
259 // CFG_RELEASE is needed by rustfmt (and possibly other tools) which
260 // import rustc-ap-rustc_attr which requires this to be set for the
261 // `#[cfg(version(...))]` attribute.
262 cargo.env("CFG_RELEASE", builder.rust_release());
263 cargo.env("CFG_RELEASE_CHANNEL", &builder.config.channel);
264 cargo.env("CFG_VERSION", builder.rust_version());
265 cargo.env("CFG_RELEASE_NUM", &builder.version);
266 cargo.env("DOC_RUST_LANG_ORG_CHANNEL", builder.doc_rust_lang_org_channel());
268 let info = GitInfo::new(builder.config.ignore_git, &dir);
269 if let Some(sha) = info.sha() {
270 cargo.env("CFG_COMMIT_HASH", sha);
272 if let Some(sha_short) = info.sha_short() {
273 cargo.env("CFG_SHORT_COMMIT_HASH", sha_short);
275 if let Some(date) = info.commit_date() {
276 cargo.env("CFG_COMMIT_DATE", date);
278 if !features.is_empty() {
279 cargo.arg("--features").arg(&features.join(", "));
284 macro_rules! bootstrap_tool {
286 $name:ident, $path:expr, $tool_name:expr
287 $(,is_external_tool = $external:expr)*
288 $(,is_unstable_tool = $unstable:expr)*
291 #[derive(Copy, PartialEq, Eq, Clone)]
298 impl<'a> Builder<'a> {
299 pub fn tool_exe(&self, tool: Tool) -> PathBuf {
303 compiler: self.compiler(0, self.config.build),
304 target: self.config.build,
312 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
314 pub compiler: Compiler,
315 pub target: TargetSelection,
318 impl Step for $name {
319 type Output = PathBuf;
321 fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
325 fn make_run(run: RunConfig<'_>) {
326 run.builder.ensure($name {
328 compiler: run.builder.compiler(0, run.builder.config.build),
333 fn run(self, builder: &Builder<'_>) -> PathBuf {
334 builder.ensure(ToolBuild {
335 compiler: self.compiler,
338 mode: if false $(|| $unstable)* {
339 // use in-tree libraries for unstable features
345 is_optional_tool: false,
346 source_type: if false $(|| $external)* {
347 SourceType::Submodule
351 extra_features: vec![],
352 }).expect("expected to build -- essential tool")
360 Rustbook, "src/tools/rustbook", "rustbook";
361 UnstableBookGen, "src/tools/unstable-book-gen", "unstable-book-gen";
362 Tidy, "src/tools/tidy", "tidy";
363 Linkchecker, "src/tools/linkchecker", "linkchecker";
364 CargoTest, "src/tools/cargotest", "cargotest";
365 Compiletest, "src/tools/compiletest", "compiletest", is_unstable_tool = true;
366 BuildManifest, "src/tools/build-manifest", "build-manifest";
367 RemoteTestClient, "src/tools/remote-test-client", "remote-test-client";
368 RustInstaller, "src/tools/rust-installer", "fabricate", is_external_tool = true;
369 RustdocTheme, "src/tools/rustdoc-themes", "rustdoc-themes";
370 ExpandYamlAnchors, "src/tools/expand-yaml-anchors", "expand-yaml-anchors";
371 LintDocs, "src/tools/lint-docs", "lint-docs";
372 JsonDocCk, "src/tools/jsondocck", "jsondocck";
373 HtmlChecker, "src/tools/html-checker", "html-checker";
374 BumpStage0, "src/tools/bump-stage0", "bump-stage0";
377 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Ord, PartialOrd)]
378 pub struct ErrorIndex {
379 pub compiler: Compiler,
383 pub fn command(builder: &Builder<'_>) -> Command {
384 // This uses stage-1 to match the behavior of building rustdoc.
385 // Error-index-generator links with the rustdoc library, so we want to
386 // use the same librustdoc to avoid building rustdoc twice (and to
387 // avoid building the compiler an extra time). This uses
388 // saturating_sub to deal with building with stage 0. (Using stage 0
389 // isn't recommended, since it will fail if any new error index tests
390 // use new syntax, but it should work otherwise.)
391 let compiler = builder.compiler(builder.top_stage.saturating_sub(1), builder.config.build);
392 let mut cmd = Command::new(builder.ensure(ErrorIndex { compiler }));
395 PathBuf::from(&builder.sysroot_libdir(compiler, compiler.host)),
396 PathBuf::from(builder.rustc_libdir(compiler)),
404 impl Step for ErrorIndex {
405 type Output = PathBuf;
407 fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
408 run.path("src/tools/error_index_generator")
411 fn make_run(run: RunConfig<'_>) {
412 // Compile the error-index in the same stage as rustdoc to avoid
413 // recompiling rustdoc twice if we can.
415 // NOTE: This `make_run` isn't used in normal situations, only if you
416 // manually build the tool with `x.py build
417 // src/tools/error-index-generator` which almost nobody does.
418 // Normally, `x.py test` or `x.py doc` will use the
419 // `ErrorIndex::command` function instead.
421 run.builder.compiler(run.builder.top_stage.saturating_sub(1), run.builder.config.build);
422 run.builder.ensure(ErrorIndex { compiler });
425 fn run(self, builder: &Builder<'_>) -> PathBuf {
428 compiler: self.compiler,
429 target: self.compiler.host,
430 tool: "error_index_generator",
431 mode: Mode::ToolRustc,
432 path: "src/tools/error_index_generator",
433 is_optional_tool: false,
434 source_type: SourceType::InTree,
435 extra_features: Vec::new(),
437 .expect("expected to build -- essential tool")
441 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
442 pub struct RemoteTestServer {
443 pub compiler: Compiler,
444 pub target: TargetSelection,
447 impl Step for RemoteTestServer {
448 type Output = PathBuf;
450 fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
451 run.path("src/tools/remote-test-server")
454 fn make_run(run: RunConfig<'_>) {
455 run.builder.ensure(RemoteTestServer {
456 compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
461 fn run(self, builder: &Builder<'_>) -> PathBuf {
464 compiler: self.compiler,
466 tool: "remote-test-server",
468 path: "src/tools/remote-test-server",
469 is_optional_tool: false,
470 source_type: SourceType::InTree,
471 extra_features: Vec::new(),
473 .expect("expected to build -- essential tool")
477 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Ord, PartialOrd)]
479 /// This should only ever be 0 or 2.
480 /// We sometimes want to reference the "bootstrap" rustdoc, which is why this option is here.
481 pub compiler: Compiler,
484 impl Step for Rustdoc {
485 type Output = PathBuf;
486 const DEFAULT: bool = true;
487 const ONLY_HOSTS: bool = true;
489 fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
490 run.path("src/tools/rustdoc").path("src/librustdoc")
493 fn make_run(run: RunConfig<'_>) {
494 run.builder.ensure(Rustdoc {
495 // Note: this is somewhat unique in that we actually want a *target*
496 // compiler here, because rustdoc *is* a compiler. We won't be using
497 // this as the compiler to build with, but rather this is "what
498 // compiler are we producing"?
499 compiler: run.builder.compiler(run.builder.top_stage, run.target),
503 fn run(self, builder: &Builder<'_>) -> PathBuf {
504 let target_compiler = self.compiler;
505 if target_compiler.stage == 0 {
506 if !target_compiler.is_snapshot(builder) {
507 panic!("rustdoc in stage 0 must be snapshot rustdoc");
509 return builder.initial_rustc.with_file_name(exe("rustdoc", target_compiler.host));
511 let target = target_compiler.host;
512 // Similar to `compile::Assemble`, build with the previous stage's compiler. Otherwise
513 // we'd have stageN/bin/rustc and stageN/bin/rustdoc be effectively different stage
514 // compilers, which isn't what we want. Rustdoc should be linked in the same way as the
515 // rustc compiler it's paired with, so it must be built with the previous stage compiler.
516 let build_compiler = builder.compiler(target_compiler.stage - 1, builder.config.build);
518 // When using `download-rustc` and a stage0 build_compiler, copying rustc doesn't actually
519 // build stage0 libstd (because the libstd in sysroot has the wrong ABI). Explicitly build
521 builder.ensure(compile::Std { compiler: build_compiler, target: target_compiler.host });
522 builder.ensure(compile::Rustc { compiler: build_compiler, target: target_compiler.host });
523 // NOTE: this implies that `download-rustc` is pretty useless when compiling with the stage0
524 // compiler, since you do just as much work.
525 if !builder.config.dry_run && builder.config.download_rustc && build_compiler.stage == 0 {
527 "warning: `download-rustc` does nothing when building stage1 tools; consider using `--stage 2` instead"
531 // The presence of `target_compiler` ensures that the necessary libraries (codegen backends,
532 // compiler libraries, ...) are built. Rustdoc does not require the presence of any
533 // libraries within sysroot_libdir (i.e., rustlib), though doctests may want it (since
534 // they'll be linked to those libraries). As such, don't explicitly `ensure` any additional
535 // libraries here. The intuition here is that If we've built a compiler, we should be able
538 let mut features = Vec::new();
539 if builder.config.jemalloc {
540 features.push("jemalloc".to_string());
543 let cargo = prepare_tool_cargo(
554 builder.info(&format!(
555 "Building rustdoc for stage{} ({})",
556 target_compiler.stage, target_compiler.host
558 builder.run(&mut cargo.into());
560 // Cargo adds a number of paths to the dylib search path on windows, which results in
561 // the wrong rustdoc being executed. To avoid the conflicting rustdocs, we name the "tool"
562 // rustdoc a different name.
563 let tool_rustdoc = builder
564 .cargo_out(build_compiler, Mode::ToolRustc, target)
565 .join(exe("rustdoc_tool_binary", target_compiler.host));
567 // don't create a stage0-sysroot/bin directory.
568 if target_compiler.stage > 0 {
569 let sysroot = builder.sysroot(target_compiler);
570 let bindir = sysroot.join("bin");
571 t!(fs::create_dir_all(&bindir));
572 let bin_rustdoc = bindir.join(exe("rustdoc", target_compiler.host));
573 let _ = fs::remove_file(&bin_rustdoc);
574 builder.copy(&tool_rustdoc, &bin_rustdoc);
582 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
584 pub compiler: Compiler,
585 pub target: TargetSelection,
588 impl Step for Cargo {
589 type Output = PathBuf;
590 const DEFAULT: bool = true;
591 const ONLY_HOSTS: bool = true;
593 fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
594 let builder = run.builder;
595 run.path("src/tools/cargo").default_condition(
596 builder.config.extended
597 && builder.config.tools.as_ref().map_or(
599 // If `tools` is set, search list for this tool.
600 |tools| tools.iter().any(|tool| tool == "cargo"),
605 fn make_run(run: RunConfig<'_>) {
606 run.builder.ensure(Cargo {
607 compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
612 fn run(self, builder: &Builder<'_>) -> PathBuf {
613 let cargo_bin_path = builder
615 compiler: self.compiler,
618 mode: Mode::ToolRustc,
619 path: "src/tools/cargo",
620 is_optional_tool: false,
621 source_type: SourceType::Submodule,
622 extra_features: Vec::new(),
624 .expect("expected to build -- essential tool");
626 let build_cred = |name, path| {
627 // These credential helpers are currently experimental.
628 // Any build failures will be ignored.
629 let _ = builder.ensure(ToolBuild {
630 compiler: self.compiler,
633 mode: Mode::ToolRustc,
635 is_optional_tool: true,
636 source_type: SourceType::Submodule,
637 extra_features: Vec::new(),
641 if self.target.contains("windows") {
643 "cargo-credential-wincred",
644 "src/tools/cargo/crates/credential/cargo-credential-wincred",
647 if self.target.contains("apple-darwin") {
649 "cargo-credential-macos-keychain",
650 "src/tools/cargo/crates/credential/cargo-credential-macos-keychain",
654 "cargo-credential-1password",
655 "src/tools/cargo/crates/credential/cargo-credential-1password",
661 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
662 pub struct LldWrapper {
663 pub compiler: Compiler,
664 pub target: TargetSelection,
665 pub flavor_feature: &'static str,
668 impl Step for LldWrapper {
669 type Output = PathBuf;
671 fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
675 fn run(self, builder: &Builder<'_>) -> PathBuf {
676 let src_exe = builder
678 compiler: self.compiler,
682 path: "src/tools/lld-wrapper",
683 is_optional_tool: false,
684 source_type: SourceType::InTree,
685 extra_features: vec![self.flavor_feature.to_owned()],
687 .expect("expected to build -- essential tool");
693 macro_rules! tool_extended {
694 (($sel:ident, $builder:ident),
699 stable = $stable:expr,
700 $(in_tree = $in_tree:expr,)?
701 $(submodule = $submodule:literal,)?
702 $extra_deps:block;)+) => {
704 #[derive(Debug, Clone, Hash, PartialEq, Eq)]
706 pub compiler: Compiler,
707 pub target: TargetSelection,
708 pub extra_features: Vec<String>,
711 impl Step for $name {
712 type Output = Option<PathBuf>;
713 const DEFAULT: bool = true; // Overwritten below
714 const ONLY_HOSTS: bool = true;
716 fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
717 let builder = run.builder;
718 run.path($path).default_condition(
719 builder.config.extended
720 && builder.config.tools.as_ref().map_or(
721 // By default, on nightly/dev enable all tools, else only
722 // build stable tools.
723 $stable || builder.build.unstable_features(),
724 // If `tools` is set, search list for this tool.
726 tools.iter().any(|tool| match tool.as_ref() {
727 "clippy" => $tool_name == "clippy-driver",
728 x => $tool_name == x,
734 fn make_run(run: RunConfig<'_>) {
735 run.builder.ensure($name {
736 compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
738 extra_features: Vec::new(),
743 fn run(mut $sel, $builder: &Builder<'_>) -> Option<PathBuf> {
745 $( $builder.update_submodule(&Path::new("src").join("tools").join($submodule)); )?
746 $builder.ensure(ToolBuild {
747 compiler: $sel.compiler,
750 mode: Mode::ToolRustc,
752 extra_features: $sel.extra_features,
753 is_optional_tool: true,
754 source_type: if false $(|| $in_tree)* {
757 SourceType::Submodule
766 // Note: tools need to be also added to `Builder::get_step_descriptions` in `builder.rs`
767 // to make `./x.py build <tool>` work.
768 // Note: Most submodule updates for tools are handled by bootstrap.py, since they're needed just to
769 // invoke Cargo to build bootstrap. See the comment there for more details.
770 tool_extended!((self, builder),
771 Cargofmt, rustfmt, "src/tools/rustfmt", "cargo-fmt", stable=true, in_tree=true, {};
772 CargoClippy, clippy, "src/tools/clippy", "cargo-clippy", stable=true, in_tree=true, {};
773 Clippy, clippy, "src/tools/clippy", "clippy-driver", stable=true, in_tree=true, {};
774 Miri, miri, "src/tools/miri", "miri", stable=false, {};
775 CargoMiri, miri, "src/tools/miri/cargo-miri", "cargo-miri", stable=false, {};
776 Rls, rls, "src/tools/rls", "rls", stable=true, {
777 builder.ensure(Clippy {
778 compiler: self.compiler,
780 extra_features: Vec::new(),
782 self.extra_features.push("clippy".to_owned());
784 RustDemangler, rust_demangler, "src/tools/rust-demangler", "rust-demangler", stable=false, in_tree=true, {};
785 Rustfmt, rustfmt, "src/tools/rustfmt", "rustfmt", stable=true, in_tree=true, {};
786 RustAnalyzer, rust_analyzer, "src/tools/rust-analyzer/crates/rust-analyzer", "rust-analyzer", stable=false, submodule="rust-analyzer", {};
789 impl<'a> Builder<'a> {
790 /// Gets a `Command` which is ready to run `tool` in `stage` built for
792 pub fn tool_cmd(&self, tool: Tool) -> Command {
793 let mut cmd = Command::new(self.tool_exe(tool));
794 let compiler = self.compiler(0, self.config.build);
795 let host = &compiler.host;
796 // Prepares the `cmd` provided to be able to run the `compiler` provided.
798 // Notably this munges the dynamic library lookup path to point to the
799 // right location to run `compiler`.
800 let mut lib_paths: Vec<PathBuf> = vec![
801 self.build.rustc_snapshot_libdir(),
802 self.cargo_out(compiler, Mode::ToolBootstrap, *host).join("deps"),
805 // On MSVC a tool may invoke a C compiler (e.g., compiletest in run-make
806 // mode) and that C compiler may need some extra PATH modification. Do
808 if compiler.host.contains("msvc") {
809 let curpaths = env::var_os("PATH").unwrap_or_default();
810 let curpaths = env::split_paths(&curpaths).collect::<Vec<_>>();
811 for &(ref k, ref v) in self.cc[&compiler.host].env() {
815 for path in env::split_paths(v) {
816 if !curpaths.contains(&path) {
817 lib_paths.push(path);
823 add_dylib_path(lib_paths, &mut cmd);
825 // Provide a RUSTC for this command to use.
826 cmd.env("RUSTC", &self.initial_rustc);