Skip to content

Commit 7234d8c

Browse files
Inline prepare_tool_cmd
Removing the tool argument in the previous commit means it's no longer restricted to just bootstrap tools despite being written as such. Inlining it prevents accidental use.
1 parent 0e14818 commit 7234d8c

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

src/bootstrap/tool.rs

+7-15
Original file line numberDiff line numberDiff line change
@@ -655,22 +655,13 @@ impl<'a> Builder<'a> {
655655
pub fn tool_cmd(&self, tool: Tool) -> Command {
656656
let mut cmd = Command::new(self.tool_exe(tool));
657657
let compiler = self.compiler(0, self.config.build);
658-
self.prepare_tool_cmd(compiler, &mut cmd);
659-
cmd
660-
}
661-
662-
/// Prepares the `cmd` provided to be able to run the `compiler` provided.
663-
///
664-
/// Notably this munges the dynamic library lookup path to point to the
665-
/// right location to run `compiler`.
666-
fn prepare_tool_cmd(&self, compiler: Compiler, cmd: &mut Command) {
667658
let host = &compiler.host;
659+
// Prepares the `cmd` provided to be able to run the `compiler` provided.
660+
//
661+
// Notably this munges the dynamic library lookup path to point to the
662+
// right location to run `compiler`.
668663
let mut lib_paths: Vec<PathBuf> = vec![
669-
if compiler.stage == 0 {
670-
self.build.rustc_snapshot_libdir()
671-
} else {
672-
PathBuf::from(&self.sysroot_libdir(compiler, compiler.host))
673-
},
664+
self.build.rustc_snapshot_libdir(),
674665
self.cargo_out(compiler, Mode::ToolBootstrap, *host).join("deps"),
675666
];
676667

@@ -692,6 +683,7 @@ impl<'a> Builder<'a> {
692683
}
693684
}
694685

695-
add_lib_path(lib_paths, cmd);
686+
add_lib_path(lib_paths, &mut cmd);
687+
cmd
696688
}
697689
}

0 commit comments

Comments
 (0)