提交 276090e8 编写于 作者: M Mark Simulacrum

Fix tool_cmd

上级 1a844ebb
......@@ -535,12 +535,6 @@ fn compiler_path(&self, compiler: Compiler) -> PathBuf {
}
}
/// Get the specified tool built by the specified compiler
fn tool(&self, compiler: Compiler, tool: &str) -> PathBuf {
self.cargo_out(compiler, Mode::Tool, compiler.host)
.join(exe(tool, compiler.host))
}
/// Get the `rustdoc` executable next to the specified compiler
fn rustdoc(&self, compiler: Compiler) -> PathBuf {
let mut rustdoc = self.compiler_path(compiler);
......
......@@ -13,6 +13,7 @@
use std::process::Command;
use Mode;
use Compiler;
use builder::{Step, Builder};
use util::{exe, add_lib_path};
use compile::{self, libtest_stamp, libstd_stamp, librustc_stamp, Rustc};
......@@ -373,8 +374,9 @@ fn run(self, builder: &Builder) -> PathBuf {
impl<'a> Builder<'a> {
/// Get a `Command` which is ready to run `tool` in `stage` built for
/// `host`.
fn tool_cmd(&self, compiler: Compiler, tool: &str) -> Command {
let mut cmd = Command::new(self.tool(compiler, tool));
pub fn tool_cmd(&self, tool: Tool) -> Command {
let mut cmd = Command::new(self.tool_exe(tool));
let compiler = self.compiler(0, &self.build.build);
self.prepare_tool_cmd(compiler, &mut cmd);
cmd
}
......@@ -394,7 +396,7 @@ fn prepare_tool_cmd(&self, compiler: Compiler, cmd: &mut Command) {
// mode) and that C compiler may need some extra PATH modification. Do
// so here.
if compiler.host.contains("msvc") {
let curpaths = env::var_os("PATH").unwrap_or(OsString::new());
let curpaths = env::var_os("PATH").unwrap_or_default();
let curpaths = env::split_paths(&curpaths).collect::<Vec<_>>();
for &(ref k, ref v) in self.cc[compiler.host].0.env() {
if k != "PATH" {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册