Skip to content

Commit 7fe5f45

Browse files
committed
does reverting to the old build_miri_sysroot help?
1 parent e2babaa commit 7fe5f45

File tree

1 file changed

+30
-11
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+30
-11
lines changed

src/bootstrap/src/core/build_steps/test.rs

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -500,27 +500,46 @@ impl Miri {
500500
/// Run `cargo miri setup` for the given target, return where the Miri sysroot was put.
501501
pub fn build_miri_sysroot(
502502
builder: &Builder<'_>,
503-
compiler: Compiler,
503+
host_compiler: Compiler,
504504
target: TargetSelection,
505505
) -> String {
506-
let miri_sysroot = builder.out.join(compiler.host.triple).join("miri-sysroot");
507-
let mut cargo = builder::Cargo::new(
506+
let miri = builder.ensure(tool::Miri {
507+
compiler: host_compiler,
508+
target: host_compiler.host,
509+
extra_features: Vec::new(),
510+
});
511+
let miri_sysroot = builder.out.join(host_compiler.host.triple).join("miri-sysroot");
512+
let mut cargo = tool::prepare_tool_cargo(
508513
builder,
509-
compiler,
510-
Mode::Std,
511-
SourceType::Submodule,
512-
target,
513-
"miri-setup",
514+
host_compiler,
515+
Mode::ToolRustc,
516+
host_compiler.host,
517+
"run",
518+
"src/tools/miri/cargo-miri",
519+
SourceType::InTree,
520+
&[],
514521
);
522+
cargo.add_rustc_lib_path(builder);
523+
cargo.arg("--").arg("miri").arg("setup");
524+
cargo.arg("--target").arg(target.rustc_target_arg());
515525

516526
// Tell `cargo miri setup` where to find the sources.
517527
cargo.env("MIRI_LIB_SRC", builder.src.join("library"));
528+
// Tell it where to find Miri.
529+
cargo.env("MIRI", miri);
518530
// Tell it where to put the sysroot.
519531
cargo.env("MIRI_SYSROOT", &miri_sysroot);
532+
// Debug things.
533+
cargo.env("RUST_BACKTRACE", "1");
520534

521535
let mut cargo = Command::from(cargo);
522-
let _guard =
523-
builder.msg(Kind::Build, compiler.stage, "miri sysroot", compiler.host, target);
536+
let _guard = builder.msg(
537+
Kind::Build,
538+
host_compiler.stage + 1,
539+
"miri sysroot",
540+
host_compiler.host,
541+
host_compiler.host,
542+
);
524543
builder.run(&mut cargo);
525544

526545
// # Determine where Miri put its sysroot.
@@ -593,7 +612,7 @@ impl Step for Miri {
593612

594613
// We also need sysroots, for Miri and for the host (the latter for build scripts).
595614
// This is for the tests so everything is done with the target compiler.
596-
let miri_sysroot = Miri::build_miri_sysroot(builder, target_compiler, target);
615+
let miri_sysroot = Miri::build_miri_sysroot(builder, host_compiler, target);
597616
builder.ensure(compile::Std::new(target_compiler, host));
598617
let sysroot = builder.sysroot(target_compiler);
599618

0 commit comments

Comments
 (0)