Skip to content

Commit 8fbb46c

Browse files
committed
Auto merge of #45980 - Keruspe:master, r=alexcrichton
rustbuild: Install rustfmt as part of extended build Now that we distribute it, this allows `./x.py install` to install it too
2 parents d59f66d + 1930ee8 commit 8fbb46c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/bootstrap/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl<'a> Builder<'a> {
264264
dist::Rls, dist::Rustfmt, dist::Extended, dist::HashSign,
265265
dist::DontDistWithMiriEnabled),
266266
Kind::Install => describe!(install::Docs, install::Std, install::Cargo, install::Rls,
267-
install::Analysis, install::Src, install::Rustc),
267+
install::Rustfmt, install::Analysis, install::Src, install::Rustc),
268268
}
269269
}
270270

src/bootstrap/install.rs

+11
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ pub fn install_rls(builder: &Builder, stage: u32, host: Interned<String>) {
3939
install_sh(builder, "rls", "rls", stage, Some(host));
4040
}
4141

42+
pub fn install_rustfmt(builder: &Builder, stage: u32, host: Interned<String>) {
43+
install_sh(builder, "rustfmt", "rustfmt", stage, Some(host));
44+
}
45+
4246
pub fn install_analysis(builder: &Builder, stage: u32, host: Interned<String>) {
4347
install_sh(builder, "analysis", "rust-analysis", stage, Some(host));
4448
}
@@ -192,6 +196,13 @@ install!((self, builder, _config),
192196
println!("skipping Install RLS stage{} ({})", self.stage, self.target);
193197
}
194198
};
199+
Rustfmt, "rustfmt", _config.extended, only_hosts: true, {
200+
if builder.ensure(dist::Rustfmt { stage: self.stage, target: self.target }).is_some() {
201+
install_rustfmt(builder, self.stage, self.target);
202+
} else {
203+
println!("skipping Install Rustfmt stage{} ({})", self.stage, self.target);
204+
}
205+
};
195206
Analysis, "analysis", _config.extended, only_hosts: false, {
196207
builder.ensure(dist::Analysis {
197208
compiler: builder.compiler(self.stage, self.host),

0 commit comments

Comments
 (0)