Skip to content

Commit

Permalink
Rollup merge of rust-lang#100832 - ehuss:bootstrap-cleanup, r=jyn514
Browse files Browse the repository at this point in the history
Some small bootstrap cleanup

This is a collection of a few small cleanups. See commits for more details.

* Remove some unused fields from the tool_extended macro.
* Remove rustfmt from publish_toolstate.
* Remove Steve from toolstate failure notices.
* Don't allow rustfmt to fail on dist.
  • Loading branch information
matthiaskrgr authored Aug 23, 2022
2 parents 490b922 + 757913d commit 3d201a1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 27 deletions.
11 changes: 2 additions & 9 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
19 changes: 8 additions & 11 deletions src/bootstrap/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;)+) => {
$(
Expand Down Expand Up @@ -828,7 +826,6 @@ macro_rules! tool_extended {
#[allow(unused_mut)]
fn run(mut $sel, $builder: &Builder<'_>) -> Option<PathBuf> {
$extra_deps
$( $builder.update_submodule(&Path::new("src").join("tools").join($submodule)); )?
$builder.ensure(ToolBuild {
compiler: $sel.compiler,
target: $sel.target,
Expand All @@ -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,
Expand All @@ -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> {
Expand Down
11 changes: 4 additions & 7 deletions src/tools/publish_toolstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,18 @@
MAINTAINERS = {
'miri': {'oli-obk', 'RalfJung'},
'rls': {'Xanewok'},
'rustfmt': {'topecongiro', 'calebcartwright'},
'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'},
}

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'],
Expand All @@ -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',
Expand Down

0 comments on commit 3d201a1

Please sign in to comment.