From 1930ee8b945fb2adf0efafbf3b8e9ac72c92153d Mon Sep 17 00:00:00 2001 From: Marc-Antoine Perennou Date: Tue, 14 Nov 2017 09:57:56 +0100 Subject: [PATCH] rustbuild: Install rustfmt as part of extended build Signed-off-by: Marc-Antoine Perennou --- src/bootstrap/builder.rs | 2 +- src/bootstrap/install.rs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 4e2898bd665..b202df76f7c 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -264,7 +264,7 @@ macro_rules! describe { dist::Rls, dist::Rustfmt, dist::Extended, dist::HashSign, dist::DontDistWithMiriEnabled), Kind::Install => describe!(install::Docs, install::Std, install::Cargo, install::Rls, - install::Analysis, install::Src, install::Rustc), + install::Rustfmt, install::Analysis, install::Src, install::Rustc), } } diff --git a/src/bootstrap/install.rs b/src/bootstrap/install.rs index c150459bee5..743f32ece99 100644 --- a/src/bootstrap/install.rs +++ b/src/bootstrap/install.rs @@ -39,6 +39,10 @@ pub fn install_rls(builder: &Builder, stage: u32, host: Interned) { install_sh(builder, "rls", "rls", stage, Some(host)); } +pub fn install_rustfmt(builder: &Builder, stage: u32, host: Interned) { + install_sh(builder, "rustfmt", "rustfmt", stage, Some(host)); +} + pub fn install_analysis(builder: &Builder, stage: u32, host: Interned) { install_sh(builder, "analysis", "rust-analysis", stage, Some(host)); } @@ -192,6 +196,13 @@ fn run($sel, $builder: &Builder) { println!("skipping Install RLS stage{} ({})", self.stage, self.target); } }; + Rustfmt, "rustfmt", _config.extended, only_hosts: true, { + if builder.ensure(dist::Rustfmt { stage: self.stage, target: self.target }).is_some() { + install_rustfmt(builder, self.stage, self.target); + } else { + println!("skipping Install Rustfmt stage{} ({})", self.stage, self.target); + } + }; Analysis, "analysis", _config.extended, only_hosts: false, { builder.ensure(dist::Analysis { compiler: builder.compiler(self.stage, self.host), -- 2.44.0