mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-31 13:40:15 +03:00
explain our shell encoding
This commit is contained in:
@@ -340,6 +340,11 @@ fn setup(ask_user: bool) {
|
||||
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 {
|
||||
// Escape an arbitrary string for the shell: by wrapping it in `'`, the only special
|
||||
// character we have to worry about is `'` itself. Everything else is taken literally
|
||||
// in these strings. `'` is encoded as `'"'"'`: the outer `'` end and being a
|
||||
// `'`-quoted string, respectively; the `"'"` in the middle represents a single `'`.
|
||||
// (We could use `'\''` instead of `'"'"'` if we wanted but let's avoid backslashes.)
|
||||
println!("MIRI_SYSROOT='{}'", sysroot.display().to_string().replace('\'', r#"'"'"'"#));
|
||||
} else if !ask_user {
|
||||
println!("A libstd for Miri is now available in `{}`.", sysroot.display());
|
||||
|
||||
Reference in New Issue
Block a user