bump Miri, update for cargo-miri being a separate project

This commit is contained in:
Ralf Jung 2020-06-01 20:17:20 +02:00
parent d3cba254e4
commit 759e495bbf
6 changed files with 34 additions and 15 deletions

View File

@ -345,6 +345,19 @@ dependencies = [
"winapi 0.3.8", "winapi 0.3.8",
] ]
[[package]]
name = "cargo-miri"
version = "0.1.0"
dependencies = [
"cargo_metadata 0.9.1",
"directories",
"rustc-workspace-hack",
"rustc_version",
"serde",
"serde_json",
"vergen",
]
[[package]] [[package]]
name = "cargo-platform" name = "cargo-platform"
version = "0.1.1" version = "0.1.1"
@ -2220,22 +2233,17 @@ name = "miri"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"byteorder", "byteorder",
"cargo_metadata 0.9.1",
"colored", "colored",
"compiletest_rs", "compiletest_rs",
"directories",
"env_logger 0.7.1", "env_logger 0.7.1",
"getrandom", "getrandom",
"hex 0.4.0", "hex 0.4.0",
"libc",
"log", "log",
"num-traits",
"rand 0.7.3", "rand 0.7.3",
"rustc-workspace-hack", "rustc-workspace-hack",
"rustc_version", "rustc_version",
"serde",
"serde_json",
"shell-escape", "shell-escape",
"vergen",
] ]
[[package]] [[package]]
@ -5555,13 +5563,12 @@ checksum = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
[[package]] [[package]]
name = "vergen" name = "vergen"
version = "3.0.4" version = "3.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6aba5e34f93dc7051dfad05b98a18e9156f27e7b431fe1d2398cb6061c0a1dba" checksum = "4ce50d8996df1f85af15f2cd8d33daae6e479575123ef4314a51a70a230739cb"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"chrono", "chrono",
"failure",
] ]
[[package]] [[package]]

View File

@ -22,6 +22,7 @@ members = [
"src/tools/rls", "src/tools/rls",
"src/tools/rustfmt", "src/tools/rustfmt",
"src/tools/miri", "src/tools/miri",
"src/tools/miri/cargo-miri",
"src/tools/rustdoc-themes", "src/tools/rustdoc-themes",
"src/tools/unicode-table-generator", "src/tools/unicode-table-generator",
"src/tools/expand-yaml-anchors", "src/tools/expand-yaml-anchors",

View File

@ -344,10 +344,12 @@ impl<'a> Builder<'a> {
tool::Rls, tool::Rls,
tool::Rustdoc, tool::Rustdoc,
tool::Clippy, tool::Clippy,
tool::CargoClippy,
native::Llvm, native::Llvm,
native::Sanitizers, native::Sanitizers,
tool::Rustfmt, tool::Rustfmt,
tool::Miri, tool::Miri,
tool::CargoMiri,
native::Lld native::Lld
), ),
Kind::Check | Kind::Clippy | Kind::Fix | Kind::Format => { Kind::Check | Kind::Clippy | Kind::Fix | Kind::Format => {

View File

@ -360,7 +360,12 @@ impl Step for Miri {
let miri = let miri =
builder.ensure(tool::Miri { compiler, target: self.host, extra_features: Vec::new() }); builder.ensure(tool::Miri { compiler, target: self.host, extra_features: Vec::new() });
if let Some(miri) = miri { let cargo_miri = builder.ensure(tool::CargoMiri {
compiler,
target: self.host,
extra_features: Vec::new(),
});
if let (Some(miri), Some(_cargo_miri)) = (miri, cargo_miri) {
let mut cargo = builder.cargo(compiler, Mode::ToolRustc, host, "install"); let mut cargo = builder.cargo(compiler, Mode::ToolRustc, host, "install");
cargo.arg("xargo"); cargo.arg("xargo");
// Configure `cargo install` path. cargo adds a `bin/`. // Configure `cargo install` path. cargo adds a `bin/`.
@ -378,14 +383,16 @@ impl Step for Miri {
Mode::ToolRustc, Mode::ToolRustc,
host, host,
"run", "run",
"src/tools/miri", "src/tools/miri/cargo-miri",
SourceType::Submodule, SourceType::Submodule,
&[], &[],
); );
cargo.arg("--bin").arg("cargo-miri").arg("--").arg("miri").arg("setup"); cargo.arg("--").arg("miri").arg("setup");
// Tell `cargo miri setup` where to find the sources. // Tell `cargo miri setup` where to find the sources.
cargo.env("XARGO_RUST_SRC", builder.src.join("src")); cargo.env("XARGO_RUST_SRC", builder.src.join("src"));
// Tell it where to find Miri.
cargo.env("MIRI", &miri);
// Debug things. // Debug things.
cargo.env("RUST_BACKTRACE", "1"); cargo.env("RUST_BACKTRACE", "1");
// Overwrite bootstrap's `rustc` wrapper overwriting our flags. // Overwrite bootstrap's `rustc` wrapper overwriting our flags.
@ -437,7 +444,7 @@ impl Step for Miri {
// miri tests need to know about the stage sysroot // miri tests need to know about the stage sysroot
cargo.env("MIRI_SYSROOT", miri_sysroot); cargo.env("MIRI_SYSROOT", miri_sysroot);
cargo.env("RUSTC_LIB_PATH", builder.rustc_libdir(compiler)); cargo.env("RUSTC_LIB_PATH", builder.rustc_libdir(compiler));
cargo.env("MIRI_PATH", miri); cargo.env("MIRI", miri);
cargo.arg("--").args(builder.config.cmd.test_args()); cargo.arg("--").args(builder.config.cmd.test_args());

View File

@ -649,12 +649,14 @@ macro_rules! tool_extended {
} }
} }
// Note: tools need to be also added to `Builder::get_step_descriptions` in `build.rs`
// to make `./x.py build <tool>` work.
tool_extended!((self, builder), tool_extended!((self, builder),
Cargofmt, rustfmt, "src/tools/rustfmt", "cargo-fmt", {}; Cargofmt, rustfmt, "src/tools/rustfmt", "cargo-fmt", {};
CargoClippy, clippy, "src/tools/clippy", "cargo-clippy", {}; CargoClippy, clippy, "src/tools/clippy", "cargo-clippy", {};
Clippy, clippy, "src/tools/clippy", "clippy-driver", {}; Clippy, clippy, "src/tools/clippy", "clippy-driver", {};
Miri, miri, "src/tools/miri", "miri", {}; Miri, miri, "src/tools/miri", "miri", {};
CargoMiri, miri, "src/tools/miri", "cargo-miri", {}; CargoMiri, miri, "src/tools/miri/cargo-miri", "cargo-miri", {};
Rls, rls, "src/tools/rls", "rls", { Rls, rls, "src/tools/rls", "rls", {
builder.ensure(Clippy { builder.ensure(Clippy {
compiler: self.compiler, compiler: self.compiler,

@ -1 +1 @@
Subproject commit a6c28f08458e15cead0e80f3b5b7009786bce4a4 Subproject commit faff9a7ad9f2d07c1702bd8be392134d27e3eaf8