diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs index aec75df82c1eb8453df8c1d427150affb9ba2193..bd77f7a91d94a1a391c2f2c32c136bbfbb919c15 100644 --- a/src/bootstrap/tool.rs +++ b/src/bootstrap/tool.rs @@ -655,22 +655,13 @@ impl<'a> Builder<'a> { pub fn tool_cmd(&self, tool: Tool) -> Command { let mut cmd = Command::new(self.tool_exe(tool)); let compiler = self.compiler(0, self.config.build); - self.prepare_tool_cmd(compiler, &mut cmd); - cmd - } - - /// Prepares the `cmd` provided to be able to run the `compiler` provided. - /// - /// Notably this munges the dynamic library lookup path to point to the - /// right location to run `compiler`. - fn prepare_tool_cmd(&self, compiler: Compiler, cmd: &mut Command) { let host = &compiler.host; + // Prepares the `cmd` provided to be able to run the `compiler` provided. + // + // Notably this munges the dynamic library lookup path to point to the + // right location to run `compiler`. let mut lib_paths: Vec = vec![ - if compiler.stage == 0 { - self.build.rustc_snapshot_libdir() - } else { - PathBuf::from(&self.sysroot_libdir(compiler, compiler.host)) - }, + self.build.rustc_snapshot_libdir(), self.cargo_out(compiler, Mode::ToolBootstrap, *host).join("deps"), ]; @@ -692,6 +683,7 @@ fn prepare_tool_cmd(&self, compiler: Compiler, cmd: &mut Command) { } } - add_lib_path(lib_paths, cmd); + add_lib_path(lib_paths, &mut cmd); + cmd } }