From f8033a29236978942d1f83fa260de43bb05ab47a Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Sun, 23 Dec 2018 21:31:45 +0100 Subject: [PATCH] fixup --- src/bootstrap/dist.rs | 37 +++++++++++++++++++++++++++++++++++++ src/bootstrap/install.rs | 2 +- src/bootstrap/lib.rs | 5 +++++ src/bootstrap/tool.rs | 4 +++- 4 files changed, 46 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index edac90b0495f1..3f9a093149423 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -32,6 +32,8 @@ pub fn pkgname(builder: &Builder, component: &str) -> String { format!("{}-{}", component, builder.rls_package_vers()) } else if component == "clippy" { format!("{}-{}", component, builder.clippy_package_vers()) + } else if component == "miri" { + format!("{}-{}", component, builder.miri_package_vers()) } else if component == "rustfmt" { format!("{}-{}", component, builder.rustfmt_package_vers()) } else if component == "llvm-tools" { @@ -1480,6 +1482,7 @@ impl Step for Extended { let rls_installer = builder.ensure(Rls { stage, target }); let llvm_tools_installer = builder.ensure(LlvmTools { stage, target }); let clippy_installer = builder.ensure(Clippy { stage, target }); + let miri_installer = builder.ensure(Miri { stage, target }); let lldb_installer = builder.ensure(Lldb { target }); let mingw_installer = builder.ensure(Mingw { host: target }); let analysis_installer = builder.ensure(Analysis { @@ -1518,6 +1521,7 @@ impl Step for Extended { tarballs.push(cargo_installer); tarballs.extend(rls_installer.clone()); tarballs.extend(clippy_installer.clone()); + tarballs.extend(miri_installer.clone()); tarballs.extend(rustfmt_installer.clone()); tarballs.extend(llvm_tools_installer); tarballs.extend(lldb_installer); @@ -1590,6 +1594,9 @@ impl Step for Extended { if clippy_installer.is_none() { contents = filter(&contents, "clippy"); } + if miri_installer.is_none() { + contents = filter(&contents, "miri"); + } if rustfmt_installer.is_none() { contents = filter(&contents, "rustfmt"); } @@ -1630,6 +1637,9 @@ impl Step for Extended { if clippy_installer.is_some() { prepare("clippy"); } + if miri_installer.is_some() { + prepare("miri"); + } // create an 'uninstall' package builder.install(&etc.join("pkg/postinstall"), &pkg.join("uninstall"), 0o755); @@ -1660,6 +1670,8 @@ impl Step for Extended { "rls-preview".to_string() } else if name == "clippy" { "clippy-preview".to_string() + } else if name == "miri" { + "miri-preview".to_string() } else { name.to_string() }; @@ -1679,6 +1691,9 @@ impl Step for Extended { if clippy_installer.is_some() { prepare("clippy"); } + if miri_installer.is_some() { + prepare("miri"); + } if target.contains("windows-gnu") { prepare("rust-mingw"); } @@ -1771,6 +1786,18 @@ impl Step for Extended { .arg("-out").arg(exe.join("ClippyGroup.wxs")) .arg("-t").arg(etc.join("msi/remove-duplicates.xsl"))); } + if miri_installer.is_some() { + builder.run(Command::new(&heat) + .current_dir(&exe) + .arg("dir") + .arg("miri") + .args(&heat_flags) + .arg("-cg").arg("MiriGroup") + .arg("-dr").arg("Miri") + .arg("-var").arg("var.MiriDir") + .arg("-out").arg(exe.join("MiriGroup.wxs")) + .arg("-t").arg(etc.join("msi/remove-duplicates.xsl"))); + } builder.run(Command::new(&heat) .current_dir(&exe) .arg("dir") @@ -1816,6 +1843,9 @@ impl Step for Extended { if clippy_installer.is_some() { cmd.arg("-dClippyDir=clippy"); } + if miri_installer.is_some() { + cmd.arg("-dMiriDir=miri"); + } if target.contains("windows-gnu") { cmd.arg("-dGccDir=rust-mingw"); } @@ -1834,6 +1864,9 @@ impl Step for Extended { if clippy_installer.is_some() { candle("ClippyGroup.wxs".as_ref()); } + if miri_installer.is_some() { + candle("MiriGroup.wxs".as_ref()); + } candle("AnalysisGroup.wxs".as_ref()); if target.contains("windows-gnu") { @@ -1866,6 +1899,9 @@ impl Step for Extended { if clippy_installer.is_some() { cmd.arg("ClippyGroup.wixobj"); } + if miri_installer.is_some() { + cmd.arg("MiriGroup.wixobj"); + } if target.contains("windows-gnu") { cmd.arg("GccGroup.wixobj"); @@ -1951,6 +1987,7 @@ impl Step for HashSign { cmd.arg(builder.package_vers(&builder.release_num("cargo"))); cmd.arg(builder.package_vers(&builder.release_num("rls"))); cmd.arg(builder.package_vers(&builder.release_num("clippy"))); + cmd.arg(builder.package_vers(&builder.release_num("miri"))); cmd.arg(builder.package_vers(&builder.release_num("rustfmt"))); cmd.arg(builder.llvm_tools_package_vers()); cmd.arg(builder.lldb_package_vers()); diff --git a/src/bootstrap/install.rs b/src/bootstrap/install.rs index fffb0ba488f6f..1265fa9eff45b 100644 --- a/src/bootstrap/install.rs +++ b/src/bootstrap/install.rs @@ -221,7 +221,7 @@ install!((self, builder, _config), } }; Miri, "miri", Self::should_build(_config), only_hosts: true, { - if builder.ensure(dist::Clippy { stage: self.stage, target: self.target }).is_some() || + if builder.ensure(dist::Miri { stage: self.stage, target: self.target }).is_some() || Self::should_install(builder) { install_miri(builder, self.stage, self.target); } else { diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 2a91aab7c4ac2..bddc6362389ad 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -1019,6 +1019,11 @@ impl Build { self.package_vers(&self.release_num("clippy")) } + /// Returns the value of `package_vers` above for miri + fn miri_package_vers(&self) -> String { + self.package_vers(&self.release_num("miri")) + } + /// Returns the value of `package_vers` above for rustfmt fn rustfmt_package_vers(&self) -> String { self.package_vers(&self.release_num("rustfmt")) diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs index af90693014575..9f6db73e6f713 100644 --- a/src/bootstrap/tool.rs +++ b/src/bootstrap/tool.rs @@ -83,6 +83,7 @@ impl Step for ToolBuild { | "rls" | "cargo" | "clippy-driver" + | "miri" => {} _ => return, @@ -218,6 +219,7 @@ pub fn prepare_tool_cargo( if path.ends_with("cargo") || path.ends_with("rls") || path.ends_with("clippy") || + path.ends_with("miri") || path.ends_with("rustfmt") { cargo.env("LIBZ_SYS_STATIC", "1"); @@ -592,7 +594,7 @@ tool_extended!((self, builder), }); }; Miri, miri, "src/tools/miri", "miri", {}; - CargoMiri, clippy, "src/tools/miri", "cargo-miri", { + CargoMiri, miri, "src/tools/miri", "cargo-miri", { // Miri depends on procedural macros (serde), which requires a full host // compiler to be available, so we need to depend on that. builder.ensure(compile::Rustc {