|
@ -61,16 +61,15 @@ |
|
|
extern crate rayon; |
|
|
extern crate rayon; |
|
|
|
|
|
|
|
|
use std::env; |
|
|
use std::env; |
|
|
use std::ffi::{OsString, OsStr}; |
|
|
use std::ffi::{OsStr, OsString}; |
|
|
use std::fs; |
|
|
use std::fs; |
|
|
use std::path::{PathBuf, Path}; |
|
|
use std::path::{Path, PathBuf}; |
|
|
use std::process::{Command, Stdio, Child}; |
|
|
use std::process::{Child, Command, Stdio}; |
|
|
use std::io::{self, BufReader, BufRead, Read, Write}; |
|
|
use std::io::{self, BufRead, BufReader, Read, Write}; |
|
|
use std::thread::{self, JoinHandle}; |
|
|
use std::thread::{self, JoinHandle}; |
|
|
use std::collections::HashMap; |
|
|
use std::collections::HashMap; |
|
|
use std::sync::{Arc, Mutex}; |
|
|
use std::sync::{Arc, Mutex}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// These modules are all glue to support reading the MSVC version from
|
|
|
// These modules are all glue to support reading the MSVC version from
|
|
|
// the registry and from COM interfaces
|
|
|
// the registry and from COM interfaces
|
|
|
#[cfg(windows)] |
|
|
#[cfg(windows)] |
|
@ -242,8 +241,7 @@ impl ToolFamily { |
|
|
fn nvcc_debug_flag(&self) -> &'static str { |
|
|
fn nvcc_debug_flag(&self) -> &'static str { |
|
|
match *self { |
|
|
match *self { |
|
|
ToolFamily::Msvc => unimplemented!(), |
|
|
ToolFamily::Msvc => unimplemented!(), |
|
|
ToolFamily::Gnu | |
|
|
ToolFamily::Gnu | ToolFamily::Clang => "-G", |
|
|
ToolFamily::Clang => "-G", |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -252,8 +250,7 @@ impl ToolFamily { |
|
|
fn nvcc_redirect_flag(&self) -> &'static str { |
|
|
fn nvcc_redirect_flag(&self) -> &'static str { |
|
|
match *self { |
|
|
match *self { |
|
|
ToolFamily::Msvc => unimplemented!(), |
|
|
ToolFamily::Msvc => unimplemented!(), |
|
|
ToolFamily::Gnu | |
|
|
ToolFamily::Gnu | ToolFamily::Clang => "-Xcompiler", |
|
|
ToolFamily::Clang => "-Xcompiler", |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -270,10 +267,7 @@ struct Object { |
|
|
impl Object { |
|
|
impl Object { |
|
|
/// Create a new source file -> object file pair.
|
|
|
/// Create a new source file -> object file pair.
|
|
|
fn new(src: PathBuf, dst: PathBuf) -> Object { |
|
|
fn new(src: PathBuf, dst: PathBuf) -> Object { |
|
|
Object { |
|
|
Object { src: src, dst: dst } |
|
|
src: src, |
|
|
|
|
|
dst: dst, |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -346,10 +340,8 @@ impl Build { |
|
|
/// .compile("foo");
|
|
|
/// .compile("foo");
|
|
|
/// ```
|
|
|
/// ```
|
|
|
pub fn define<'a, V: Into<Option<&'a str>>>(&mut self, var: &str, val: V) -> &mut Build { |
|
|
pub fn define<'a, V: Into<Option<&'a str>>>(&mut self, var: &str, val: V) -> &mut Build { |
|
|
self.definitions.push(( |
|
|
self.definitions |
|
|
var.to_string(), |
|
|
.push((var.to_string(), val.into().map(|s| s.to_string()))); |
|
|
val.into().map(|s| s.to_string()), |
|
|
|
|
|
)); |
|
|
|
|
|
self |
|
|
self |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -405,10 +397,12 @@ impl Build { |
|
|
/// `known_flag_support` field. If `is_flag_supported(flag)`
|
|
|
/// `known_flag_support` field. If `is_flag_supported(flag)`
|
|
|
/// is called again, the result will be read from the hash table.
|
|
|
/// is called again, the result will be read from the hash table.
|
|
|
pub fn is_flag_supported(&self, flag: &str) -> Result<bool, Error> { |
|
|
pub fn is_flag_supported(&self, flag: &str) -> Result<bool, Error> { |
|
|
let known_status = self.known_flag_support_status.lock().ok() |
|
|
let known_status = self.known_flag_support_status |
|
|
|
|
|
.lock() |
|
|
|
|
|
.ok() |
|
|
.and_then(|flag_status| flag_status.get(flag).cloned()); |
|
|
.and_then(|flag_status| flag_status.get(flag).cloned()); |
|
|
if let Some(is_supported) = known_status { |
|
|
if let Some(is_supported) = known_status { |
|
|
return Ok(is_supported) |
|
|
return Ok(is_supported); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
let out_dir = self.get_out_dir()?; |
|
|
let out_dir = self.get_out_dir()?; |
|
@ -426,8 +420,7 @@ impl Build { |
|
|
let compiler = cfg.try_get_compiler()?; |
|
|
let compiler = cfg.try_get_compiler()?; |
|
|
let mut cmd = compiler.to_command(); |
|
|
let mut cmd = compiler.to_command(); |
|
|
let is_arm = target.contains("aarch64") || target.contains("arm"); |
|
|
let is_arm = target.contains("aarch64") || target.contains("arm"); |
|
|
command_add_output_file(&mut cmd, &obj, target.contains("msvc"), false, |
|
|
command_add_output_file(&mut cmd, &obj, target.contains("msvc"), false, is_arm); |
|
|
is_arm); |
|
|
|
|
|
|
|
|
|
|
|
// We need to explicitly tell msvc not to link and create an exe
|
|
|
// We need to explicitly tell msvc not to link and create an exe
|
|
|
// in the root directory of the crate
|
|
|
// in the root directory of the crate
|
|
@ -796,9 +789,8 @@ impl Build { |
|
|
A: AsRef<OsStr>, |
|
|
A: AsRef<OsStr>, |
|
|
B: AsRef<OsStr>, |
|
|
B: AsRef<OsStr>, |
|
|
{ |
|
|
{ |
|
|
self.env.push( |
|
|
self.env |
|
|
(a.as_ref().to_owned(), b.as_ref().to_owned()), |
|
|
.push((a.as_ref().to_owned(), b.as_ref().to_owned())); |
|
|
); |
|
|
|
|
|
self |
|
|
self |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -939,9 +931,7 @@ impl Build { |
|
|
compiler |
|
|
compiler |
|
|
.path |
|
|
.path |
|
|
.file_name() |
|
|
.file_name() |
|
|
.ok_or_else(|| { |
|
|
.ok_or_else(|| Error::new(ErrorKind::IOError, "Failed to get compiler path."))? |
|
|
Error::new(ErrorKind::IOError, "Failed to get compiler path.") |
|
|
|
|
|
})? |
|
|
|
|
|
.to_string_lossy() |
|
|
.to_string_lossy() |
|
|
.into_owned(), |
|
|
.into_owned(), |
|
|
) |
|
|
) |
|
@ -979,9 +969,7 @@ impl Build { |
|
|
let name = compiler |
|
|
let name = compiler |
|
|
.path |
|
|
.path |
|
|
.file_name() |
|
|
.file_name() |
|
|
.ok_or_else(|| { |
|
|
.ok_or_else(|| Error::new(ErrorKind::IOError, "Failed to get compiler path."))? |
|
|
Error::new(ErrorKind::IOError, "Failed to get compiler path.") |
|
|
|
|
|
})? |
|
|
|
|
|
.to_string_lossy() |
|
|
.to_string_lossy() |
|
|
.into_owned(); |
|
|
.into_owned(); |
|
|
|
|
|
|
|
@ -1226,8 +1214,7 @@ impl Build { |
|
|
if self.cpp { |
|
|
if self.cpp { |
|
|
match (self.cpp_set_stdlib.as_ref(), cmd.family) { |
|
|
match (self.cpp_set_stdlib.as_ref(), cmd.family) { |
|
|
(None, _) => {} |
|
|
(None, _) => {} |
|
|
(Some(stdlib), ToolFamily::Gnu) | |
|
|
(Some(stdlib), ToolFamily::Gnu) | (Some(stdlib), ToolFamily::Clang) => { |
|
|
(Some(stdlib), ToolFamily::Clang) => { |
|
|
|
|
|
cmd.push_cc_arg(format!("-stdlib=lib{}", stdlib).into()); |
|
|
cmd.push_cc_arg(format!("-stdlib=lib{}", stdlib).into()); |
|
|
} |
|
|
} |
|
|
_ => { |
|
|
_ => { |
|
@ -1325,13 +1312,8 @@ impl Build { |
|
|
if target.contains("msvc") { |
|
|
if target.contains("msvc") { |
|
|
let mut cmd = match self.archiver { |
|
|
let mut cmd = match self.archiver { |
|
|
Some(ref s) => self.cmd(s), |
|
|
Some(ref s) => self.cmd(s), |
|
|
None => { |
|
|
None => windows_registry::find(&target, "lib.exe") |
|
|
windows_registry::find(&target, "lib.exe").unwrap_or_else( |
|
|
.unwrap_or_else(|| self.cmd("lib.exe")), |
|
|
|| { |
|
|
|
|
|
self.cmd("lib.exe") |
|
|
|
|
|
}, |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
let mut out = OsString::from("/OUT:"); |
|
|
let mut out = OsString::from("/OUT:"); |
|
@ -1340,8 +1322,11 @@ impl Build { |
|
|
|
|
|
|
|
|
// Similar to https://github.com/rust-lang/rust/pull/47507
|
|
|
// Similar to https://github.com/rust-lang/rust/pull/47507
|
|
|
// and https://github.com/rust-lang/rust/pull/48548
|
|
|
// and https://github.com/rust-lang/rust/pull/48548
|
|
|
let estimated_command_line_len = |
|
|
let estimated_command_line_len = objects |
|
|
objects.iter().chain(&self.objects).map(|a| a.as_os_str().len()).sum::<usize>(); |
|
|
.iter() |
|
|
|
|
|
.chain(&self.objects) |
|
|
|
|
|
.map(|a| a.as_os_str().len()) |
|
|
|
|
|
.sum::<usize>(); |
|
|
if estimated_command_line_len > 1024 * 6 { |
|
|
if estimated_command_line_len > 1024 * 6 { |
|
|
let mut args = String::from("\u{FEFF}"); // BOM
|
|
|
let mut args = String::from("\u{FEFF}"); // BOM
|
|
|
for arg in objects.iter().chain(&self.objects) { |
|
|
for arg in objects.iter().chain(&self.objects) { |
|
@ -1364,7 +1349,10 @@ impl Build { |
|
|
|
|
|
|
|
|
let mut args_file = OsString::from(dst); |
|
|
let mut args_file = OsString::from(dst); |
|
|
args_file.push(".args"); |
|
|
args_file.push(".args"); |
|
|
fs::File::create(&args_file).unwrap().write_all(&utf16le).unwrap(); |
|
|
fs::File::create(&args_file) |
|
|
|
|
|
.unwrap() |
|
|
|
|
|
.write_all(&utf16le) |
|
|
|
|
|
.unwrap(); |
|
|
|
|
|
|
|
|
let mut args_file_arg = OsString::from("@"); |
|
|
let mut args_file_arg = OsString::from("@"); |
|
|
args_file_arg.push(args_file); |
|
|
args_file_arg.push(args_file); |
|
@ -1493,10 +1481,13 @@ impl Build { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// On Solaris, c++/cc unlikely to exist or be correct.
|
|
|
// On Solaris, c++/cc unlikely to exist or be correct.
|
|
|
let default = if host.contains("solaris") { gnu } else { traditional }; |
|
|
let default = if host.contains("solaris") { |
|
|
|
|
|
gnu |
|
|
|
|
|
} else { |
|
|
|
|
|
traditional |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
let tool_opt: Option<Tool> = |
|
|
let tool_opt: Option<Tool> = self.env_tool(env) |
|
|
self.env_tool(env) |
|
|
|
|
|
.map(|(tool, cc, args)| { |
|
|
.map(|(tool, cc, args)| { |
|
|
// chop off leading/trailing whitespace to work around
|
|
|
// chop off leading/trailing whitespace to work around
|
|
|
// semi-buggy build scripts which are shared in
|
|
|
// semi-buggy build scripts which are shared in
|
|
@ -1601,14 +1592,18 @@ impl Build { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
let tool = if self.cuda { |
|
|
let tool = if self.cuda { |
|
|
assert!(tool.args.is_empty(), |
|
|
assert!( |
|
|
"CUDA compilation currently assumes empty pre-existing args"); |
|
|
tool.args.is_empty(), |
|
|
|
|
|
"CUDA compilation currently assumes empty pre-existing args" |
|
|
|
|
|
); |
|
|
let nvcc = match self.get_var("NVCC") { |
|
|
let nvcc = match self.get_var("NVCC") { |
|
|
Err(_) => "nvcc".into(), |
|
|
Err(_) => "nvcc".into(), |
|
|
Ok(nvcc) => nvcc, |
|
|
Ok(nvcc) => nvcc, |
|
|
}; |
|
|
}; |
|
|
let mut nvcc_tool = Tool::with_features(PathBuf::from(nvcc), self.cuda); |
|
|
let mut nvcc_tool = Tool::with_features(PathBuf::from(nvcc), self.cuda); |
|
|
nvcc_tool.args.push(format!("-ccbin={}", tool.path.display()).into()); |
|
|
nvcc_tool |
|
|
|
|
|
.args |
|
|
|
|
|
.push(format!("-ccbin={}", tool.path.display()).into()); |
|
|
nvcc_tool |
|
|
nvcc_tool |
|
|
} else { |
|
|
} else { |
|
|
tool |
|
|
tool |
|
@ -1631,10 +1626,7 @@ impl Build { |
|
|
Some(res) => Ok(res), |
|
|
Some(res) => Ok(res), |
|
|
None => Err(Error::new( |
|
|
None => Err(Error::new( |
|
|
ErrorKind::EnvVarNotFound, |
|
|
ErrorKind::EnvVarNotFound, |
|
|
&format!( |
|
|
&format!("Could not find environment variable {}.", var_base), |
|
|
"Could not find environment variable {}.", |
|
|
|
|
|
var_base |
|
|
|
|
|
), |
|
|
|
|
|
)), |
|
|
)), |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -1648,7 +1640,6 @@ impl Build { |
|
|
.collect() |
|
|
.collect() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Returns compiler path, optional modifier name from whitelist, and arguments vec
|
|
|
/// Returns compiler path, optional modifier name from whitelist, and arguments vec
|
|
|
fn env_tool(&self, name: &str) -> Option<(String, Option<String>, Vec<String>)> { |
|
|
fn env_tool(&self, name: &str) -> Option<(String, Option<String>, Vec<String>)> { |
|
|
let tool = match self.get_var(name) { |
|
|
let tool = match self.get_var(name) { |
|
@ -1674,14 +1665,18 @@ impl Build { |
|
|
None => return None, |
|
|
None => return None, |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
let file_stem = Path::new(maybe_wrapper).file_stem().unwrap().to_str().unwrap(); |
|
|
let file_stem = Path::new(maybe_wrapper) |
|
|
|
|
|
.file_stem() |
|
|
|
|
|
.unwrap() |
|
|
|
|
|
.to_str() |
|
|
|
|
|
.unwrap(); |
|
|
if whitelist.contains(&file_stem) { |
|
|
if whitelist.contains(&file_stem) { |
|
|
if let Some(compiler) = parts.next() { |
|
|
if let Some(compiler) = parts.next() { |
|
|
return Some(( |
|
|
return Some(( |
|
|
compiler.to_string(), |
|
|
compiler.to_string(), |
|
|
Some(maybe_wrapper.to_string()), |
|
|
Some(maybe_wrapper.to_string()), |
|
|
parts.map(|s| s.to_string()).collect(), |
|
|
parts.map(|s| s.to_string()).collect(), |
|
|
)) |
|
|
)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -1786,10 +1781,7 @@ impl Build { |
|
|
Some(s) => Ok(s), |
|
|
Some(s) => Ok(s), |
|
|
None => Err(Error::new( |
|
|
None => Err(Error::new( |
|
|
ErrorKind::EnvVarNotFound, |
|
|
ErrorKind::EnvVarNotFound, |
|
|
&format!( |
|
|
&format!("Environment variable {} not defined.", v.to_string()), |
|
|
"Environment variable {} not defined.", |
|
|
|
|
|
v.to_string() |
|
|
|
|
|
), |
|
|
|
|
|
)), |
|
|
)), |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -1817,8 +1809,9 @@ impl Tool { |
|
|
let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) { |
|
|
let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) { |
|
|
if fname.contains("clang") { |
|
|
if fname.contains("clang") { |
|
|
ToolFamily::Clang |
|
|
ToolFamily::Clang |
|
|
} else if fname.contains("cl") && !fname.contains("cloudabi") && |
|
|
} else if fname.contains("cl") && !fname.contains("cloudabi") |
|
|
!fname.contains("uclibc") { |
|
|
&& !fname.contains("uclibc") |
|
|
|
|
|
{ |
|
|
ToolFamily::Msvc |
|
|
ToolFamily::Msvc |
|
|
} else { |
|
|
} else { |
|
|
ToolFamily::Gnu |
|
|
ToolFamily::Gnu |
|
@ -1861,8 +1854,8 @@ impl Tool { |
|
|
cmd.arg(&self.path); |
|
|
cmd.arg(&self.path); |
|
|
cmd.args(&self.cc_wrapper_args); |
|
|
cmd.args(&self.cc_wrapper_args); |
|
|
cmd |
|
|
cmd |
|
|
}, |
|
|
} |
|
|
None => Command::new(&self.path) |
|
|
None => Command::new(&self.path), |
|
|
}; |
|
|
}; |
|
|
cmd.args(&self.args); |
|
|
cmd.args(&self.args); |
|
|
for &(ref k, ref v) in self.env.iter() { |
|
|
for &(ref k, ref v) in self.env.iter() { |
|
@ -1908,10 +1901,8 @@ impl Tool { |
|
|
cc_env.push(arg); |
|
|
cc_env.push(arg); |
|
|
} |
|
|
} |
|
|
cc_env |
|
|
cc_env |
|
|
}, |
|
|
|
|
|
None => { |
|
|
|
|
|
OsString::from("") |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
None => OsString::from(""), |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -1954,8 +1945,7 @@ fn run(cmd: &mut Command, program: &str) -> Result<(), Error> { |
|
|
ErrorKind::ToolExecError, |
|
|
ErrorKind::ToolExecError, |
|
|
&format!( |
|
|
&format!( |
|
|
"Failed to wait on spawned child process, command {:?} with args {:?}.", |
|
|
"Failed to wait on spawned child process, command {:?} with args {:?}.", |
|
|
cmd, |
|
|
cmd, program |
|
|
program |
|
|
|
|
|
), |
|
|
), |
|
|
)) |
|
|
)) |
|
|
} |
|
|
} |
|
@ -1970,9 +1960,7 @@ fn run(cmd: &mut Command, program: &str) -> Result<(), Error> { |
|
|
ErrorKind::ToolExecError, |
|
|
ErrorKind::ToolExecError, |
|
|
&format!( |
|
|
&format!( |
|
|
"Command {:?} with args {:?} did not execute successfully (status code {}).", |
|
|
"Command {:?} with args {:?} did not execute successfully (status code {}).", |
|
|
cmd, |
|
|
cmd, program, status |
|
|
program, |
|
|
|
|
|
status |
|
|
|
|
|
), |
|
|
), |
|
|
)) |
|
|
)) |
|
|
} |
|
|
} |
|
@ -1995,8 +1983,7 @@ fn run_output(cmd: &mut Command, program: &str) -> Result<Vec<u8>, Error> { |
|
|
ErrorKind::ToolExecError, |
|
|
ErrorKind::ToolExecError, |
|
|
&format!( |
|
|
&format!( |
|
|
"Failed to wait on spawned child process, command {:?} with args {:?}.", |
|
|
"Failed to wait on spawned child process, command {:?} with args {:?}.", |
|
|
cmd, |
|
|
cmd, program |
|
|
program |
|
|
|
|
|
), |
|
|
), |
|
|
)) |
|
|
)) |
|
|
} |
|
|
} |
|
@ -2011,9 +1998,7 @@ fn run_output(cmd: &mut Command, program: &str) -> Result<Vec<u8>, Error> { |
|
|
ErrorKind::ToolExecError, |
|
|
ErrorKind::ToolExecError, |
|
|
&format!( |
|
|
&format!( |
|
|
"Command {:?} with args {:?} did not execute successfully (status code {}).", |
|
|
"Command {:?} with args {:?} did not execute successfully (status code {}).", |
|
|
cmd, |
|
|
cmd, program, status |
|
|
program, |
|
|
|
|
|
status |
|
|
|
|
|
), |
|
|
), |
|
|
)) |
|
|
)) |
|
|
} |
|
|
} |
|
@ -2029,13 +2014,12 @@ fn spawn(cmd: &mut Command, program: &str) -> Result<(Child, JoinHandle<()>), Er |
|
|
match cmd.stderr(Stdio::piped()).spawn() { |
|
|
match cmd.stderr(Stdio::piped()).spawn() { |
|
|
Ok(mut child) => { |
|
|
Ok(mut child) => { |
|
|
let stderr = BufReader::new(child.stderr.take().unwrap()); |
|
|
let stderr = BufReader::new(child.stderr.take().unwrap()); |
|
|
let print = thread::spawn(move || for line in stderr.split(b'\n').filter_map( |
|
|
let print = thread::spawn(move || { |
|
|
|l| l.ok(), |
|
|
for line in stderr.split(b'\n').filter_map(|l| l.ok()) { |
|
|
) |
|
|
|
|
|
{ |
|
|
|
|
|
print!("cargo:warning="); |
|
|
print!("cargo:warning="); |
|
|
std::io::stdout().write_all(&line).unwrap(); |
|
|
std::io::stdout().write_all(&line).unwrap(); |
|
|
println!(""); |
|
|
println!(""); |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
Ok((child, print)) |
|
|
Ok((child, print)) |
|
|
} |
|
|
} |
|
@ -2048,20 +2032,12 @@ fn spawn(cmd: &mut Command, program: &str) -> Result<(Child, JoinHandle<()>), Er |
|
|
}; |
|
|
}; |
|
|
Err(Error::new( |
|
|
Err(Error::new( |
|
|
ErrorKind::ToolNotFound, |
|
|
ErrorKind::ToolNotFound, |
|
|
&format!( |
|
|
&format!("Failed to find tool. Is `{}` installed?{}", program, extra), |
|
|
"Failed to find tool. Is `{}` installed?{}", |
|
|
|
|
|
program, |
|
|
|
|
|
extra |
|
|
|
|
|
), |
|
|
|
|
|
)) |
|
|
)) |
|
|
} |
|
|
} |
|
|
Err(_) => Err(Error::new( |
|
|
Err(_) => Err(Error::new( |
|
|
ErrorKind::ToolExecError, |
|
|
ErrorKind::ToolExecError, |
|
|
&format!( |
|
|
&format!("Command {:?} with args {:?} failed to start.", cmd, program), |
|
|
"Command {:?} with args {:?} failed to start.", |
|
|
|
|
|
cmd, |
|
|
|
|
|
program |
|
|
|
|
|
), |
|
|
|
|
|
)), |
|
|
)), |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -2070,7 +2046,6 @@ fn fail(s: &str) -> ! { |
|
|
panic!("\n\nInternal error occurred: {}\n\n", s) |
|
|
panic!("\n\nInternal error occurred: {}\n\n", s) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn command_add_output_file(cmd: &mut Command, dst: &Path, msvc: bool, is_asm: bool, is_arm: bool) { |
|
|
fn command_add_output_file(cmd: &mut Command, dst: &Path, msvc: bool, is_asm: bool, is_arm: bool) { |
|
|
if msvc && is_asm && is_arm { |
|
|
if msvc && is_asm && is_arm { |
|
|
cmd.arg("-o").arg(&dst); |
|
|
cmd.arg("-o").arg(&dst); |
|
|