Rollup merge of #47505 - alexcrichton:fix-bat-spawn-regression, r=estebank
rustc: Spawn `cmd /c` for `.bat` scripts This fixes an accidental regression #46335 where the behavior of `Path::ends_with` is different from `str::ends_with` (paths operate over components, strs operate over chars).
This commit is contained in:
commit
54299e2eb7
@ -69,13 +69,14 @@ pub fn get_linker(sess: &Session) -> (PathBuf, Command, Vec<(OsString, OsString)
|
|||||||
// was tagged as #42791) and some more info can be found on #44443 for
|
// was tagged as #42791) and some more info can be found on #44443 for
|
||||||
// emscripten itself.
|
// emscripten itself.
|
||||||
let cmd = |linker: &Path| {
|
let cmd = |linker: &Path| {
|
||||||
if cfg!(windows) && linker.ends_with(".bat") {
|
if let Some(linker) = linker.to_str() {
|
||||||
let mut cmd = Command::new("cmd");
|
if cfg!(windows) && linker.ends_with(".bat") {
|
||||||
cmd.arg("/c").arg(linker);
|
let mut cmd = Command::new("cmd");
|
||||||
cmd
|
cmd.arg("/c").arg(linker);
|
||||||
} else {
|
return cmd
|
||||||
Command::new(linker)
|
}
|
||||||
}
|
}
|
||||||
|
Command::new(linker)
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Some(ref linker) = sess.opts.cg.linker {
|
if let Some(ref linker) = sess.opts.cg.linker {
|
||||||
|
Loading…
Reference in New Issue
Block a user