Skip to content

Commit 6cfa7ef

Browse files
committed
Remove miri from the submodule list and require it for CI to pass
1 parent d9382d0 commit 6cfa7ef

File tree

12 files changed

+133
-214
lines changed

12 files changed

+133
-214
lines changed

src/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ This directory contains the source code of the rust project, including:
22

33
- The test suite
44
- The bootstrapping build system
5-
- Various submodules for tools, like cargo, miri, etc.
5+
- Various submodules for tools, like cargo, etc.
66

77
For more information on how various parts of the compiler work, see the [rustc dev guide].
88

src/bootstrap/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ tool_check_step!(Rustdoc, "src/tools/rustdoc", "src/librustdoc", SourceType::InT
456456
// behavior, treat it as in-tree so that any new warnings in clippy will be
457457
// rejected.
458458
tool_check_step!(Clippy, "src/tools/clippy", SourceType::InTree);
459-
tool_check_step!(Miri, "src/tools/miri", SourceType::Submodule);
459+
tool_check_step!(Miri, "src/tools/miri", SourceType::InTree);
460460
tool_check_step!(Rls, "src/tools/rls", SourceType::InTree);
461461
tool_check_step!(Rustfmt, "src/tools/rustfmt", SourceType::InTree);
462462

src/bootstrap/dist.rs

+28-55
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,6 @@ pub fn tmpdir(builder: &Builder<'_>) -> PathBuf {
3535
builder.out.join("tmp/dist")
3636
}
3737

38-
fn missing_tool(tool_name: &str, skip: bool) {
39-
if skip {
40-
println!("Unable to build {}, skipping dist", tool_name)
41-
} else {
42-
let help = "note: not all tools are available on all nightlies\nhelp: see https://forge.rust-lang.org/infra/toolstate.html for more information";
43-
panic!(
44-
"Unable to build submodule tool {} (use `missing-tools = true` to ignore this failure)\n{}",
45-
tool_name, help
46-
)
47-
}
48-
}
49-
5038
fn should_build_extended_tool(builder: &Builder<'_>, tool: &str) -> bool {
5139
if !builder.config.extended {
5240
return false;
@@ -1209,18 +1197,9 @@ impl Step for Miri {
12091197
let compiler = self.compiler;
12101198
let target = self.target;
12111199

1212-
let miri = builder
1213-
.ensure(tool::Miri { compiler, target, extra_features: Vec::new() })
1214-
.or_else(|| {
1215-
missing_tool("miri", builder.build.config.missing_tools);
1216-
None
1217-
})?;
1218-
let cargomiri = builder
1219-
.ensure(tool::CargoMiri { compiler, target, extra_features: Vec::new() })
1220-
.or_else(|| {
1221-
missing_tool("cargo miri", builder.build.config.missing_tools);
1222-
None
1223-
})?;
1200+
let miri = builder.ensure(tool::Miri { compiler, target, extra_features: Vec::new() })?;
1201+
let cargomiri =
1202+
builder.ensure(tool::CargoMiri { compiler, target, extra_features: Vec::new() })?;
12241203

12251204
let mut tarball = Tarball::new(builder, "miri", &target.triple);
12261205
tarball.set_overlay(OverlayKind::Miri);
@@ -1451,7 +1430,7 @@ impl Step for Extended {
14511430

14521431
let xform = |p: &Path| {
14531432
let mut contents = t!(fs::read_to_string(p));
1454-
for tool in &["rust-demangler", "rust-analyzer", "miri", "rustfmt"] {
1433+
for tool in &["rust-demangler", "rust-analyzer", "rustfmt"] {
14551434
if !built_tools.contains(tool) {
14561435
contents = filter(&contents, tool);
14571436
}
@@ -1491,7 +1470,8 @@ impl Step for Extended {
14911470
prepare("rust-std");
14921471
prepare("rust-analysis");
14931472
prepare("clippy");
1494-
for tool in &["rust-docs", "rust-demangler", "rust-analyzer", "miri"] {
1473+
prepare("miri");
1474+
for tool in &["rust-docs", "rust-demangler", "rust-analyzer"] {
14951475
if built_tools.contains(tool) {
14961476
prepare(tool);
14971477
}
@@ -1550,7 +1530,8 @@ impl Step for Extended {
15501530
prepare("rust-docs");
15511531
prepare("rust-std");
15521532
prepare("clippy");
1553-
for tool in &["rust-demangler", "rust-analyzer", "miri"] {
1533+
prepare("miri");
1534+
for tool in &["rust-demangler", "rust-analyzer"] {
15541535
if built_tools.contains(tool) {
15551536
prepare(tool);
15561537
}
@@ -1689,25 +1670,23 @@ impl Step for Extended {
16891670
.arg(etc.join("msi/remove-duplicates.xsl")),
16901671
);
16911672
}
1692-
if built_tools.contains("miri") {
1693-
builder.run(
1694-
Command::new(&heat)
1695-
.current_dir(&exe)
1696-
.arg("dir")
1697-
.arg("miri")
1698-
.args(&heat_flags)
1699-
.arg("-cg")
1700-
.arg("MiriGroup")
1701-
.arg("-dr")
1702-
.arg("Miri")
1703-
.arg("-var")
1704-
.arg("var.MiriDir")
1705-
.arg("-out")
1706-
.arg(exe.join("MiriGroup.wxs"))
1707-
.arg("-t")
1708-
.arg(etc.join("msi/remove-duplicates.xsl")),
1709-
);
1710-
}
1673+
builder.run(
1674+
Command::new(&heat)
1675+
.current_dir(&exe)
1676+
.arg("dir")
1677+
.arg("miri")
1678+
.args(&heat_flags)
1679+
.arg("-cg")
1680+
.arg("MiriGroup")
1681+
.arg("-dr")
1682+
.arg("Miri")
1683+
.arg("-var")
1684+
.arg("var.MiriDir")
1685+
.arg("-out")
1686+
.arg(exe.join("MiriGroup.wxs"))
1687+
.arg("-t")
1688+
.arg(etc.join("msi/remove-duplicates.xsl")),
1689+
);
17111690
builder.run(
17121691
Command::new(&heat)
17131692
.current_dir(&exe)
@@ -1755,6 +1734,7 @@ impl Step for Extended {
17551734
.arg("-dStdDir=rust-std")
17561735
.arg("-dAnalysisDir=rust-analysis")
17571736
.arg("-dClippyDir=clippy")
1737+
.arg("-dMiriDir=miri")
17581738
.arg("-arch")
17591739
.arg(&arch)
17601740
.arg("-out")
@@ -1768,9 +1748,6 @@ impl Step for Extended {
17681748
if built_tools.contains("rust-analyzer") {
17691749
cmd.arg("-dRustAnalyzerDir=rust-analyzer");
17701750
}
1771-
if built_tools.contains("miri") {
1772-
cmd.arg("-dMiriDir=miri");
1773-
}
17741751
if target.ends_with("windows-gnu") {
17751752
cmd.arg("-dGccDir=rust-mingw");
17761753
}
@@ -1784,15 +1761,13 @@ impl Step for Extended {
17841761
candle("CargoGroup.wxs".as_ref());
17851762
candle("StdGroup.wxs".as_ref());
17861763
candle("ClippyGroup.wxs".as_ref());
1764+
candle("MiriGroup.wxs".as_ref());
17871765
if built_tools.contains("rust-demangler") {
17881766
candle("RustDemanglerGroup.wxs".as_ref());
17891767
}
17901768
if built_tools.contains("rust-analyzer") {
17911769
candle("RustAnalyzerGroup.wxs".as_ref());
17921770
}
1793-
if built_tools.contains("miri") {
1794-
candle("MiriGroup.wxs".as_ref());
1795-
}
17961771
candle("AnalysisGroup.wxs".as_ref());
17971772

17981773
if target.ends_with("windows-gnu") {
@@ -1822,6 +1797,7 @@ impl Step for Extended {
18221797
.arg("StdGroup.wixobj")
18231798
.arg("AnalysisGroup.wixobj")
18241799
.arg("ClippyGroup.wixobj")
1800+
.arg("MiriGroup.wixobj")
18251801
.current_dir(&exe);
18261802

18271803
if built_tools.contains("rust-analyzer") {
@@ -1830,9 +1806,6 @@ impl Step for Extended {
18301806
if built_tools.contains("rust-demangler") {
18311807
cmd.arg("RustDemanglerGroup.wixobj");
18321808
}
1833-
if built_tools.contains("miri") {
1834-
cmd.arg("MiriGroup.wixobj");
1835-
}
18361809

18371810
if target.ends_with("windows-gnu") {
18381811
cmd.arg("GccGroup.wixobj");

src/bootstrap/doc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ tool_doc!(
851851
in_tree = true
852852
);
853853
tool_doc!(Clippy, "clippy", "src/tools/clippy", ["clippy_utils"], in_tree = true);
854-
tool_doc!(Miri, "miri", "src/tools/miri", ["miri"], in_tree = false);
854+
tool_doc!(Miri, "miri", "src/tools/miri", ["miri"], in_tree = true);
855855

856856
#[derive(Ord, PartialOrd, Debug, Copy, Clone, Hash, PartialEq, Eq)]
857857
pub struct ErrorIndex {

src/bootstrap/install.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,10 @@ install!((self, builder, _config),
200200
install_sh(builder, "clippy", self.compiler.stage, Some(self.target), &tarball);
201201
};
202202
Miri, alias = "miri", Self::should_build(_config), only_hosts: true, {
203-
if let Some(tarball) = builder.ensure(dist::Miri { compiler: self.compiler, target: self.target }) {
204-
install_sh(builder, "miri", self.compiler.stage, Some(self.target), &tarball);
205-
} else {
206-
builder.info(
207-
&format!("skipping Install miri stage{} ({})", self.compiler.stage, self.target),
208-
);
209-
}
203+
let tarball = builder
204+
.ensure(dist::Miri { compiler: self.compiler, target: self.target })
205+
.expect("missing miri");
206+
install_sh(builder, "miri", self.compiler.stage, Some(self.target), &tarball);
210207
};
211208
Rustfmt, alias = "rustfmt", Self::should_build(_config), only_hosts: true, {
212209
if let Some(tarball) = builder.ensure(dist::Rustfmt {

src/bootstrap/lib.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -540,13 +540,8 @@ impl Build {
540540

541541
// Make sure we update these before gathering metadata so we don't get an error about missing
542542
// Cargo.toml files.
543-
let rust_submodules = [
544-
"src/tools/rust-installer",
545-
"src/tools/cargo",
546-
"src/tools/miri",
547-
"library/backtrace",
548-
"library/stdarch",
549-
];
543+
let rust_submodules =
544+
["src/tools/rust-installer", "src/tools/cargo", "library/backtrace", "library/stdarch"];
550545
for s in rust_submodules {
551546
build.update_submodule(Path::new(s));
552547
}

0 commit comments

Comments
 (0)