Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/bin/cargo-miri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,11 @@ path = "lib.rs"
None => true,
Some(target) => target == rustc_version::version_meta().unwrap().host,
};
let sysroot = if is_host { dir.join("HOST") } else { PathBuf::from(dir) };
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); // for Windows users, prints path with backslashes escaped.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not just for Windows users. It just as much affects Linux users with ', " or \ in the path (all of which are valid filename characters on Linux).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. Do you think I should add a macro for conditional compilation for Windows users??

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, what I am saying is the bug you are fixing also affects other platforms. With conditional compilation you'd only fix it on Windows, why do you want that? :D

} else if !ask_user {
println!("A libstd for Miri is now available in `{}`.", sysroot.display());
}
Expand Down