Skip to content

Commit 5192daf

Browse files
committed
adjust miri sysroot determination
1 parent f704c09 commit 5192daf

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/bootstrap/test.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ impl Step for Miri {
427427
// (We do this separately from the above so that when the setup actually
428428
// happens we get some output.)
429429
// We re-use the `cargo` from above.
430-
cargo.arg("--env");
430+
cargo.arg("--print-sysroot");
431431

432432
// FIXME: Is there a way in which we can re-use the usual `run` helpers?
433433
let miri_sysroot = if builder.config.dry_run {
@@ -437,13 +437,11 @@ impl Step for Miri {
437437
let out = cargo.output()
438438
.expect("We already ran `cargo miri setup` before and that worked");
439439
assert!(out.status.success(), "`cargo miri setup` returned with non-0 exit code");
440-
// Output is "MIRI_SYSROOT=<str>\n".
440+
// Output is "<sysroot>\n".
441441
let stdout = String::from_utf8(out.stdout)
442442
.expect("`cargo miri setup` stdout is not valid UTF-8");
443-
let stdout = stdout.trim();
444-
builder.verbose(&format!("`cargo miri setup --env` returned: {:?}", stdout));
445-
let sysroot = stdout.splitn(2, '=')
446-
.nth(1).expect("`cargo miri setup` stdout did not contain '='");
443+
let sysroot = stdout.trim_end();
444+
builder.verbose(&format!("`cargo miri setup --print-sysroot` said: {:?}", sysroot));
447445
sysroot.to_owned()
448446
};
449447

0 commit comments

Comments
 (0)