Skip to content

Commit

Permalink
Adjust miri to still be optional
Browse files Browse the repository at this point in the history
We don't distribute a miri build for beta/stable so it needs to be kept
optional. In the future it likely makes sense to switch the miri
*artifacts* to always be built, but the rustup component to not be
included -- this will avoid some of this pain.
  • Loading branch information
Mark-Simulacrum committed Nov 1, 2022
1 parent e83be5d commit c2bb2e1
Showing 1 changed file with 31 additions and 25 deletions.
56 changes: 31 additions & 25 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,7 @@ impl Step for Extended {

let xform = |p: &Path| {
let mut contents = t!(fs::read_to_string(p));
for tool in &["rust-demangler"] {
for tool in &["rust-demangler", "miri"] {
if !built_tools.contains(tool) {
contents = filter(&contents, tool);
}
Expand Down Expand Up @@ -1467,9 +1467,8 @@ impl Step for Extended {
prepare("rust-std");
prepare("rust-analysis");
prepare("clippy");
prepare("miri");
prepare("rust-analyzer");
for tool in &["rust-docs", "rust-demangler"] {
for tool in &["rust-docs", "rust-demangler", "miri"] {
if built_tools.contains(tool) {
prepare(tool);
}
Expand Down Expand Up @@ -1528,9 +1527,8 @@ impl Step for Extended {
prepare("rust-docs");
prepare("rust-std");
prepare("clippy");
prepare("miri");
prepare("rust-analyzer");
for tool in &["rust-demangler"] {
for tool in &["rust-demangler", "miri"] {
if built_tools.contains(tool) {
prepare(tool);
}
Expand Down Expand Up @@ -1667,23 +1665,25 @@ impl Step for Extended {
.arg(etc.join("msi/remove-duplicates.xsl")),
);
}
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")),
);
if built_tools.contains("miri") {
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)
Expand Down Expand Up @@ -1731,7 +1731,6 @@ impl Step for Extended {
.arg("-dStdDir=rust-std")
.arg("-dAnalysisDir=rust-analysis")
.arg("-dClippyDir=clippy")
.arg("-dMiriDir=miri")
.arg("-arch")
.arg(&arch)
.arg("-out")
Expand All @@ -1745,6 +1744,9 @@ impl Step for Extended {
if built_tools.contains("rust-analyzer") {
cmd.arg("-dRustAnalyzerDir=rust-analyzer");
}
if built_tools.contains("miri") {
cmd.arg("-dMiriDir=miri");
}
if target.ends_with("windows-gnu") {
cmd.arg("-dGccDir=rust-mingw");
}
Expand All @@ -1758,7 +1760,9 @@ impl Step for Extended {
candle("CargoGroup.wxs".as_ref());
candle("StdGroup.wxs".as_ref());
candle("ClippyGroup.wxs".as_ref());
candle("MiriGroup.wxs".as_ref());
if built_tools.contains("miri") {
candle("MiriGroup.wxs".as_ref());
}
if built_tools.contains("rust-demangler") {
candle("RustDemanglerGroup.wxs".as_ref());
}
Expand Down Expand Up @@ -1794,9 +1798,11 @@ impl Step for Extended {
.arg("StdGroup.wixobj")
.arg("AnalysisGroup.wixobj")
.arg("ClippyGroup.wixobj")
.arg("MiriGroup.wixobj")
.current_dir(&exe);

if built_tools.contains("miri") {
cmd.arg("MiriGroup.wixobj");
}
if built_tools.contains("rust-analyzer") {
cmd.arg("RustAnalyzerGroup.wixobj");
}
Expand Down

0 comments on commit c2bb2e1

Please sign in to comment.