Skip to content

Commit

Permalink
Run xargo check instead of xargo build to build libstd
Browse files Browse the repository at this point in the history
This gives us crate metadata without running any codegen
  • Loading branch information
Aaron1011 committed Nov 13, 2019
1 parent 07fa6f8 commit da61b24
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/bin/cargo-miri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,12 @@ path = "lib.rs"
let target = get_arg_flag_value("--target");
let print_sysroot = !ask_user && has_arg_flag("--print-sysroot"); // whether we just print the sysroot path
let mut command = xargo();
command.arg("build").arg("-q");
// This may seen somewhat suprising - we are 'building' libstd
// by running (the equivalent of) `cargo check`. It turns out
// that `cargo check` has exactly the behavior that we want:
// it emits crate metadata (including MIR) without running any
// codegen.
command.arg("check").arg("-q");
command.current_dir(&dir);
command.env("RUSTFLAGS", miri::miri_default_args().join(" "));
command.env("XARGO_HOME", dir.to_str().unwrap());
Expand Down

0 comments on commit da61b24

Please sign in to comment.