Skip to content

Commit c2bb2e1

Browse files
Adjust miri to still be optional
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.
1 parent e83be5d commit c2bb2e1

File tree

1 file changed

+31
-25
lines changed

1 file changed

+31
-25
lines changed

src/bootstrap/dist.rs

+31-25
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ impl Step for Extended {
14271427

14281428
let xform = |p: &Path| {
14291429
let mut contents = t!(fs::read_to_string(p));
1430-
for tool in &["rust-demangler"] {
1430+
for tool in &["rust-demangler", "miri"] {
14311431
if !built_tools.contains(tool) {
14321432
contents = filter(&contents, tool);
14331433
}
@@ -1467,9 +1467,8 @@ impl Step for Extended {
14671467
prepare("rust-std");
14681468
prepare("rust-analysis");
14691469
prepare("clippy");
1470-
prepare("miri");
14711470
prepare("rust-analyzer");
1472-
for tool in &["rust-docs", "rust-demangler"] {
1471+
for tool in &["rust-docs", "rust-demangler", "miri"] {
14731472
if built_tools.contains(tool) {
14741473
prepare(tool);
14751474
}
@@ -1528,9 +1527,8 @@ impl Step for Extended {
15281527
prepare("rust-docs");
15291528
prepare("rust-std");
15301529
prepare("clippy");
1531-
prepare("miri");
15321530
prepare("rust-analyzer");
1533-
for tool in &["rust-demangler"] {
1531+
for tool in &["rust-demangler", "miri"] {
15341532
if built_tools.contains(tool) {
15351533
prepare(tool);
15361534
}
@@ -1667,23 +1665,25 @@ impl Step for Extended {
16671665
.arg(etc.join("msi/remove-duplicates.xsl")),
16681666
);
16691667
}
1670-
builder.run(
1671-
Command::new(&heat)
1672-
.current_dir(&exe)
1673-
.arg("dir")
1674-
.arg("miri")
1675-
.args(&heat_flags)
1676-
.arg("-cg")
1677-
.arg("MiriGroup")
1678-
.arg("-dr")
1679-
.arg("Miri")
1680-
.arg("-var")
1681-
.arg("var.MiriDir")
1682-
.arg("-out")
1683-
.arg(exe.join("MiriGroup.wxs"))
1684-
.arg("-t")
1685-
.arg(etc.join("msi/remove-duplicates.xsl")),
1686-
);
1668+
if built_tools.contains("miri") {
1669+
builder.run(
1670+
Command::new(&heat)
1671+
.current_dir(&exe)
1672+
.arg("dir")
1673+
.arg("miri")
1674+
.args(&heat_flags)
1675+
.arg("-cg")
1676+
.arg("MiriGroup")
1677+
.arg("-dr")
1678+
.arg("Miri")
1679+
.arg("-var")
1680+
.arg("var.MiriDir")
1681+
.arg("-out")
1682+
.arg(exe.join("MiriGroup.wxs"))
1683+
.arg("-t")
1684+
.arg(etc.join("msi/remove-duplicates.xsl")),
1685+
);
1686+
}
16871687
builder.run(
16881688
Command::new(&heat)
16891689
.current_dir(&exe)
@@ -1731,7 +1731,6 @@ impl Step for Extended {
17311731
.arg("-dStdDir=rust-std")
17321732
.arg("-dAnalysisDir=rust-analysis")
17331733
.arg("-dClippyDir=clippy")
1734-
.arg("-dMiriDir=miri")
17351734
.arg("-arch")
17361735
.arg(&arch)
17371736
.arg("-out")
@@ -1745,6 +1744,9 @@ impl Step for Extended {
17451744
if built_tools.contains("rust-analyzer") {
17461745
cmd.arg("-dRustAnalyzerDir=rust-analyzer");
17471746
}
1747+
if built_tools.contains("miri") {
1748+
cmd.arg("-dMiriDir=miri");
1749+
}
17481750
if target.ends_with("windows-gnu") {
17491751
cmd.arg("-dGccDir=rust-mingw");
17501752
}
@@ -1758,7 +1760,9 @@ impl Step for Extended {
17581760
candle("CargoGroup.wxs".as_ref());
17591761
candle("StdGroup.wxs".as_ref());
17601762
candle("ClippyGroup.wxs".as_ref());
1761-
candle("MiriGroup.wxs".as_ref());
1763+
if built_tools.contains("miri") {
1764+
candle("MiriGroup.wxs".as_ref());
1765+
}
17621766
if built_tools.contains("rust-demangler") {
17631767
candle("RustDemanglerGroup.wxs".as_ref());
17641768
}
@@ -1794,9 +1798,11 @@ impl Step for Extended {
17941798
.arg("StdGroup.wixobj")
17951799
.arg("AnalysisGroup.wixobj")
17961800
.arg("ClippyGroup.wixobj")
1797-
.arg("MiriGroup.wixobj")
17981801
.current_dir(&exe);
17991802

1803+
if built_tools.contains("miri") {
1804+
cmd.arg("MiriGroup.wixobj");
1805+
}
18001806
if built_tools.contains("rust-analyzer") {
18011807
cmd.arg("RustAnalyzerGroup.wixobj");
18021808
}

0 commit comments

Comments
 (0)