Skip to content

Commit 2b3b865

Browse files
committed
change cargo-miri.rs to fix issue #978
1 parent de4a846 commit 2b3b865

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/bin/cargo-miri.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,14 @@ path = "lib.rs"
333333
None => true,
334334
Some(target) => target == rustc_version::version_meta().unwrap().host,
335335
};
336-
let sysroot = if is_host { dir.join("HOST") } else { PathBuf::from(dir) };
336+
let mut sysroot = if is_host { dir.join("HOST") } else { PathBuf::from(dir) };
337+
if cfg!(target_os = "windows") {
338+
// Replace backslashes in path to slashes as they cause problems.
339+
// Win10 Powershell can work with slashes in paths.
340+
sysroot = PathBuf::from(
341+
String::from(sysroot.to_str().unwrap()).replace("\\", "/")
342+
);
343+
}
337344
std::env::set_var("MIRI_SYSROOT", &sysroot); // pass the env var to the processes we spawn, which will turn it into "--sysroot" flags
338345
if print_env {
339346
println!("MIRI_SYSROOT={}", sysroot.display());

0 commit comments

Comments
 (0)