about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-10-19 17:17:02 +0200
committerRalf Jung <post@ralfj.de>2019-10-19 17:17:02 +0200
commit5192daf43e8f913ed1c49322630fbb84ac00d8df (patch)
tree02055e4ff1e2136668e4d1775975e908b3c1da20
parentf704c099ebd51e2fe34209d5a733501f317e37b8 (diff)
downloadrust-5192daf43e8f913ed1c49322630fbb84ac00d8df.tar.gz
rust-5192daf43e8f913ed1c49322630fbb84ac00d8df.zip
adjust miri sysroot determination
-rw-r--r--src/bootstrap/test.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index e09e25de64a..0b7aa0750a1 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -427,7 +427,7 @@ impl Step for Miri {
             // (We do this separately from the above so that when the setup actually
             // happens we get some output.)
             // We re-use the `cargo` from above.
-            cargo.arg("--env");
+            cargo.arg("--print-sysroot");
 
             // FIXME: Is there a way in which we can re-use the usual `run` helpers?
             let miri_sysroot = if builder.config.dry_run {
@@ -437,13 +437,11 @@ impl Step for Miri {
                 let out = cargo.output()
                     .expect("We already ran `cargo miri setup` before and that worked");
                 assert!(out.status.success(), "`cargo miri setup` returned with non-0 exit code");
-                // Output is "MIRI_SYSROOT=<str>\n".
+                // Output is "<sysroot>\n".
                 let stdout = String::from_utf8(out.stdout)
                     .expect("`cargo miri setup` stdout is not valid UTF-8");
-                let stdout = stdout.trim();
-                builder.verbose(&format!("`cargo miri setup --env` returned: {:?}", stdout));
-                let sysroot = stdout.splitn(2, '=')
-                    .nth(1).expect("`cargo miri setup` stdout did not contain '='");
+                let sysroot = stdout.trim_end();
+                builder.verbose(&format!("`cargo miri setup --print-sysroot` said: {:?}", sysroot));
                 sysroot.to_owned()
             };