Lines 22-27
use dist::{self, pkgname, sanitize_sh, tmpdir};
Link Here
|
22 |
|
22 |
|
23 |
use builder::{Builder, RunConfig, ShouldRun, Step}; |
23 |
use builder::{Builder, RunConfig, ShouldRun, Step}; |
24 |
use cache::Interned; |
24 |
use cache::Interned; |
|
|
25 |
use config::Config; |
25 |
|
26 |
|
26 |
pub fn install_docs(builder: &Builder, stage: u32, host: Interned<String>) { |
27 |
pub fn install_docs(builder: &Builder, stage: u32, host: Interned<String>) { |
27 |
install_sh(builder, "docs", "rust-docs", stage, Some(host)); |
28 |
install_sh(builder, "docs", "rust-docs", stage, Some(host)); |
Lines 144-149
macro_rules! install {
Link Here
|
144 |
pub host: Interned<String>, |
145 |
pub host: Interned<String>, |
145 |
} |
146 |
} |
146 |
|
147 |
|
|
|
148 |
impl $name { |
149 |
#[allow(dead_code)] |
150 |
fn should_build(config: &Config) -> bool { |
151 |
config.extended && config.tools.as_ref() |
152 |
.map_or(true, |t| t.contains($path)) |
153 |
} |
154 |
|
155 |
#[allow(dead_code)] |
156 |
fn should_install(builder: &Builder) -> bool { |
157 |
builder.config.tools.as_ref().map_or(false, |t| t.contains($path)) |
158 |
} |
159 |
} |
160 |
|
147 |
impl Step for $name { |
161 |
impl Step for $name { |
148 |
type Output = (); |
162 |
type Output = (); |
149 |
const DEFAULT: bool = true; |
163 |
const DEFAULT: bool = true; |
Lines 185-216
install!((self, builder, _config),
Link Here
|
185 |
install_std(builder, self.stage, *target); |
199 |
install_std(builder, self.stage, *target); |
186 |
} |
200 |
} |
187 |
}; |
201 |
}; |
188 |
Cargo, "cargo", _config.extended, only_hosts: true, { |
202 |
Cargo, "cargo", Self::should_build(_config), only_hosts: true, { |
189 |
builder.ensure(dist::Cargo { stage: self.stage, target: self.target }); |
203 |
builder.ensure(dist::Cargo { stage: self.stage, target: self.target }); |
190 |
install_cargo(builder, self.stage, self.target); |
204 |
install_cargo(builder, self.stage, self.target); |
191 |
}; |
205 |
}; |
192 |
Rls, "rls", _config.extended, only_hosts: true, { |
206 |
Rls, "rls", Self::should_build(_config), only_hosts: true, { |
193 |
if builder.ensure(dist::Rls { stage: self.stage, target: self.target }).is_some() { |
207 |
if builder.ensure(dist::Rls { stage: self.stage, target: self.target }).is_some() || |
|
|
208 |
Self::should_install(builder) { |
194 |
install_rls(builder, self.stage, self.target); |
209 |
install_rls(builder, self.stage, self.target); |
195 |
} else { |
210 |
} else { |
196 |
println!("skipping Install RLS stage{} ({})", self.stage, self.target); |
211 |
println!("skipping Install RLS stage{} ({})", self.stage, self.target); |
197 |
} |
212 |
} |
198 |
}; |
213 |
}; |
199 |
Rustfmt, "rustfmt", _config.extended, only_hosts: true, { |
214 |
Rustfmt, "rustfmt", Self::should_build(_config), only_hosts: true, { |
200 |
if builder.ensure(dist::Rustfmt { stage: self.stage, target: self.target }).is_some() { |
215 |
if builder.ensure(dist::Rustfmt { stage: self.stage, target: self.target }).is_some() || |
|
|
216 |
Self::should_install(builder) { |
201 |
install_rustfmt(builder, self.stage, self.target); |
217 |
install_rustfmt(builder, self.stage, self.target); |
202 |
} else { |
218 |
} else { |
203 |
println!("skipping Install Rustfmt stage{} ({})", self.stage, self.target); |
219 |
println!("skipping Install Rustfmt stage{} ({})", self.stage, self.target); |
204 |
} |
220 |
} |
205 |
}; |
221 |
}; |
206 |
Analysis, "analysis", _config.extended, only_hosts: false, { |
222 |
Analysis, "analysis", Self::should_build(_config), only_hosts: false, { |
207 |
builder.ensure(dist::Analysis { |
223 |
builder.ensure(dist::Analysis { |
208 |
compiler: builder.compiler(self.stage, self.host), |
224 |
compiler: builder.compiler(self.stage, self.host), |
209 |
target: self.target |
225 |
target: self.target |
210 |
}); |
226 |
}); |
211 |
install_analysis(builder, self.stage, self.target); |
227 |
install_analysis(builder, self.stage, self.target); |
212 |
}; |
228 |
}; |
213 |
Src, "src", _config.extended, only_hosts: true, { |
229 |
Src, "src", Self::should_build(_config) , only_hosts: true, { |
214 |
builder.ensure(dist::Src); |
230 |
builder.ensure(dist::Src); |
215 |
install_src(builder, self.stage); |
231 |
install_src(builder, self.stage); |
216 |
}, ONLY_BUILD; |
232 |
}, ONLY_BUILD; |
217 |
- |
|
|