From 12386da38aa46eff4c229fdbfb2496ce0a4c5b7e Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 20 Aug 2022 22:07:04 -0700 Subject: [PATCH 1/4] bootstrap: Remove some unused fields from the tool_extended macro. --- src/bootstrap/tool.rs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs index 06fa5039fdf92..570da20e7d60d 100644 --- a/src/bootstrap/tool.rs +++ b/src/bootstrap/tool.rs @@ -778,12 +778,10 @@ impl Step for RustAnalyzerProcMacroSrv { macro_rules! tool_extended { (($sel:ident, $builder:ident), $($name:ident, - $toolstate:ident, $path:expr, $tool_name:expr, stable = $stable:expr, $(in_tree = $in_tree:expr,)? - $(submodule = $submodule:literal,)? $(tool_std = $tool_std:literal,)? $extra_deps:block;)+) => { $( @@ -828,7 +826,6 @@ macro_rules! tool_extended { #[allow(unused_mut)] fn run(mut $sel, $builder: &Builder<'_>) -> Option { $extra_deps - $( $builder.update_submodule(&Path::new("src").join("tools").join($submodule)); )? $builder.ensure(ToolBuild { compiler: $sel.compiler, target: $sel.target, @@ -854,12 +851,12 @@ macro_rules! tool_extended { // Note: Most submodule updates for tools are handled by bootstrap.py, since they're needed just to // invoke Cargo to build bootstrap. See the comment there for more details. tool_extended!((self, builder), - Cargofmt, rustfmt, "src/tools/rustfmt", "cargo-fmt", stable=true, in_tree=true, {}; - CargoClippy, clippy, "src/tools/clippy", "cargo-clippy", stable=true, in_tree=true, {}; - Clippy, clippy, "src/tools/clippy", "clippy-driver", stable=true, in_tree=true, {}; - Miri, miri, "src/tools/miri", "miri", stable=false, {}; - CargoMiri, miri, "src/tools/miri/cargo-miri", "cargo-miri", stable=false, {}; - Rls, rls, "src/tools/rls", "rls", stable=true, { + Cargofmt, "src/tools/rustfmt", "cargo-fmt", stable=true, in_tree=true, {}; + CargoClippy, "src/tools/clippy", "cargo-clippy", stable=true, in_tree=true, {}; + Clippy, "src/tools/clippy", "clippy-driver", stable=true, in_tree=true, {}; + Miri, "src/tools/miri", "miri", stable=false, {}; + CargoMiri, "src/tools/miri/cargo-miri", "cargo-miri", stable=false, {}; + Rls, "src/tools/rls", "rls", stable=true, { builder.ensure(Clippy { compiler: self.compiler, target: self.target, @@ -870,8 +867,8 @@ tool_extended!((self, builder), // FIXME: tool_std is not quite right, we shouldn't allow nightly features. // But `builder.cargo` doesn't know how to handle ToolBootstrap in stages other than 0, // and this is close enough for now. - RustDemangler, rust_demangler, "src/tools/rust-demangler", "rust-demangler", stable=false, in_tree=true, tool_std=true, {}; - Rustfmt, rustfmt, "src/tools/rustfmt", "rustfmt", stable=true, in_tree=true, {}; + RustDemangler, "src/tools/rust-demangler", "rust-demangler", stable=false, in_tree=true, tool_std=true, {}; + Rustfmt, "src/tools/rustfmt", "rustfmt", stable=true, in_tree=true, {}; ); impl<'a> Builder<'a> { From 3b1b35bf03bafc9df9b854ac1bf83af671483aa3 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 20 Aug 2022 22:08:50 -0700 Subject: [PATCH 2/4] Remove rustfmt from publish_toolstate Rustfmt is no longer tracked in toolstate, so this isn't necessary. --- src/tools/publish_toolstate.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/tools/publish_toolstate.py b/src/tools/publish_toolstate.py index fe5195738c10a..e609d7bf92fe2 100755 --- a/src/tools/publish_toolstate.py +++ b/src/tools/publish_toolstate.py @@ -32,7 +32,6 @@ MAINTAINERS = { 'miri': {'oli-obk', 'RalfJung'}, 'rls': {'Xanewok'}, - 'rustfmt': {'topecongiro', 'calebcartwright'}, 'book': {'carols10cents', 'steveklabnik'}, 'nomicon': {'frewsxcv', 'Gankra', 'JohnTitor'}, 'reference': {'steveklabnik', 'Havvy', 'matthewjasper', 'ehuss'}, @@ -45,7 +44,6 @@ LABELS = { 'miri': ['A-miri', 'C-bug'], 'rls': ['A-rls', 'C-bug'], - 'rustfmt': ['A-rustfmt', 'C-bug'], 'book': ['C-bug'], 'nomicon': ['C-bug'], 'reference': ['C-bug'], @@ -58,7 +56,6 @@ REPOS = { 'miri': 'https://github.com/rust-lang/miri', 'rls': 'https://github.com/rust-lang/rls', - 'rustfmt': 'https://github.com/rust-lang/rustfmt', 'book': 'https://github.com/rust-lang/book', 'nomicon': 'https://github.com/rust-lang/nomicon', 'reference': 'https://github.com/rust-lang/reference', From 45e2fc3d4fd948441806f273bf34218fced0ad07 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 20 Aug 2022 22:11:27 -0700 Subject: [PATCH 3/4] Remove Steve from toolstate failure notices. They have not been involved in a while. --- src/tools/publish_toolstate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tools/publish_toolstate.py b/src/tools/publish_toolstate.py index e609d7bf92fe2..1c57b731aaa3f 100755 --- a/src/tools/publish_toolstate.py +++ b/src/tools/publish_toolstate.py @@ -32,12 +32,12 @@ MAINTAINERS = { 'miri': {'oli-obk', 'RalfJung'}, 'rls': {'Xanewok'}, - 'book': {'carols10cents', 'steveklabnik'}, + 'book': {'carols10cents'}, 'nomicon': {'frewsxcv', 'Gankra', 'JohnTitor'}, - 'reference': {'steveklabnik', 'Havvy', 'matthewjasper', 'ehuss'}, - 'rust-by-example': {'steveklabnik', 'marioidival'}, + 'reference': {'Havvy', 'matthewjasper', 'ehuss'}, + 'rust-by-example': {'marioidival'}, 'embedded-book': {'adamgreig', 'andre-richter', 'jamesmunns', 'therealprof'}, - 'edition-guide': {'ehuss', 'steveklabnik'}, + 'edition-guide': {'ehuss'}, 'rustc-dev-guide': {'spastorino', 'amanjeev', 'JohnTitor'}, } From 757913df08f11e216b617a557959f5c28d2974ca Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 20 Aug 2022 22:24:31 -0700 Subject: [PATCH 4/4] bootstrap: Don't allow rustfmt to fail on dist. When running `x.py dist`, rustfmt was being allowed to fail when missing-tools is true. This isn't much of an issue in practice since other CI jobs will fail if rustfmt fails. This code was just leftovers from when rustfmt was tracked in toolstate, and this removes it to make it clear that it no longer works that way. --- src/bootstrap/dist.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 6291b204e485f..6bf57a89e896f 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -1226,17 +1226,10 @@ impl Step for Rustfmt { let rustfmt = builder .ensure(tool::Rustfmt { compiler, target, extra_features: Vec::new() }) - .or_else(|| { - missing_tool("Rustfmt", builder.build.config.missing_tools); - None - })?; + .expect("rustfmt expected to build - essential tool"); let cargofmt = builder .ensure(tool::Cargofmt { compiler, target, extra_features: Vec::new() }) - .or_else(|| { - missing_tool("Cargofmt", builder.build.config.missing_tools); - None - })?; - + .expect("cargo fmt expected to build - essential tool"); let mut tarball = Tarball::new(builder, "rustfmt", &target.triple); tarball.set_overlay(OverlayKind::Rustfmt); tarball.is_preview(true);