Auto merge of #980 - JOE1994:master, r=RalfJung

change cargo-miri.rs to fix issue #978

In Windows 10, there was an issue with building MIRI locally and getting it running,
due to unpredictable backslash escaping issues in paths.
I added a code snippet that would only be compiled in Windows OS, which replaces all backslashes in paths to slashes.
This fix should only affect Windows users.
Building and testing MIRI locally now works fine after the fix.
![miri_result_after_fix0](https://user-images.githubusercontent.com/10286488/66260998-344abc80-e794-11e9-9d7c-b4ef098443de.PNG)

Fixes https://github.com/rust-lang/miri/issues/978
This commit is contained in:
bors 2019-10-15 08:22:26 +00:00
commit 42c1e779cb

View file

@ -340,7 +340,7 @@ path = "lib.rs"
let sysroot = if is_host { dir.join("HOST") } else { PathBuf::from(dir) };
std::env::set_var("MIRI_SYSROOT", &sysroot); // pass the env var to the processes we spawn, which will turn it into "--sysroot" flags
if print_env {
println!("MIRI_SYSROOT={}", sysroot.display());
println!("MIRI_SYSROOT='{}'", sysroot.display().to_string().replace('\'', r#"'"'"'"#));
} else if !ask_user {
println!("A libstd for Miri is now available in `{}`.", sysroot.display());
}