@@ -93,7 +93,7 @@ fn prepare_dir(mut path: PathBuf) -> String {
93
93
macro_rules! install {
94
94
( ( $sel: ident, $builder: ident, $_config: ident) ,
95
95
$( $name: ident,
96
- $path : expr ,
96
+ $condition_name : ident = $path_or_alias : literal ,
97
97
$default_cond: expr,
98
98
only_hosts: $only_hosts: expr,
99
99
$run_item: block $( , $c: ident) * ; ) +) => {
@@ -108,7 +108,7 @@ macro_rules! install {
108
108
#[ allow( dead_code) ]
109
109
fn should_build( config: & Config ) -> bool {
110
110
config. extended && config. tools. as_ref( )
111
- . map_or( true , |t| t. contains( $path ) )
111
+ . map_or( true , |t| t. contains( $path_or_alias ) )
112
112
}
113
113
}
114
114
@@ -120,7 +120,7 @@ macro_rules! install {
120
120
121
121
fn should_run( run: ShouldRun <' _>) -> ShouldRun <' _> {
122
122
let $_config = & run. builder. config;
123
- run. path ( $path ) . default_condition( $default_cond)
123
+ run. $condition_name ( $path_or_alias ) . default_condition( $default_cond)
124
124
}
125
125
126
126
fn make_run( run: RunConfig <' _>) {
@@ -138,11 +138,11 @@ macro_rules! install {
138
138
}
139
139
140
140
install ! ( ( self , builder, _config) ,
141
- Docs , "src/doc" , _config. docs, only_hosts: false , {
141
+ Docs , path = "src/doc" , _config. docs, only_hosts: false , {
142
142
let tarball = builder. ensure( dist:: Docs { host: self . target } ) . expect( "missing docs" ) ;
143
143
install_sh( builder, "docs" , self . compiler. stage, Some ( self . target) , & tarball) ;
144
144
} ;
145
- Std , "library/std" , true , only_hosts: false , {
145
+ Std , path = "library/std" , true , only_hosts: false , {
146
146
for target in & builder. targets {
147
147
// `expect` should be safe, only None when host != build, but this
148
148
// only runs when host == build
@@ -153,13 +153,13 @@ install!((self, builder, _config),
153
153
install_sh( builder, "std" , self . compiler. stage, Some ( * target) , & tarball) ;
154
154
}
155
155
} ;
156
- Cargo , "cargo" , Self :: should_build( _config) , only_hosts: true , {
156
+ Cargo , alias = "cargo" , Self :: should_build( _config) , only_hosts: true , {
157
157
let tarball = builder
158
158
. ensure( dist:: Cargo { compiler: self . compiler, target: self . target } )
159
159
. expect( "missing cargo" ) ;
160
160
install_sh( builder, "cargo" , self . compiler. stage, Some ( self . target) , & tarball) ;
161
161
} ;
162
- Rls , "rls" , Self :: should_build( _config) , only_hosts: true , {
162
+ Rls , alias = "rls" , Self :: should_build( _config) , only_hosts: true , {
163
163
if let Some ( tarball) = builder. ensure( dist:: Rls { compiler: self . compiler, target: self . target } ) {
164
164
install_sh( builder, "rls" , self . compiler. stage, Some ( self . target) , & tarball) ;
165
165
} else {
@@ -168,7 +168,7 @@ install!((self, builder, _config),
168
168
) ;
169
169
}
170
170
} ;
171
- RustAnalyzer , "rust-analyzer" , Self :: should_build( _config) , only_hosts: true , {
171
+ RustAnalyzer , alias = "rust-analyzer" , Self :: should_build( _config) , only_hosts: true , {
172
172
if let Some ( tarball) =
173
173
builder. ensure( dist:: RustAnalyzer { compiler: self . compiler, target: self . target } )
174
174
{
@@ -179,13 +179,13 @@ install!((self, builder, _config),
179
179
) ;
180
180
}
181
181
} ;
182
- Clippy , "clippy" , Self :: should_build( _config) , only_hosts: true , {
182
+ Clippy , alias = "clippy" , Self :: should_build( _config) , only_hosts: true , {
183
183
let tarball = builder
184
184
. ensure( dist:: Clippy { compiler: self . compiler, target: self . target } )
185
185
. expect( "missing clippy" ) ;
186
186
install_sh( builder, "clippy" , self . compiler. stage, Some ( self . target) , & tarball) ;
187
187
} ;
188
- Miri , "miri" , Self :: should_build( _config) , only_hosts: true , {
188
+ Miri , alias = "miri" , Self :: should_build( _config) , only_hosts: true , {
189
189
if let Some ( tarball) = builder. ensure( dist:: Miri { compiler: self . compiler, target: self . target } ) {
190
190
install_sh( builder, "miri" , self . compiler. stage, Some ( self . target) , & tarball) ;
191
191
} else {
@@ -194,7 +194,7 @@ install!((self, builder, _config),
194
194
) ;
195
195
}
196
196
} ;
197
- Rustfmt , "rustfmt" , Self :: should_build( _config) , only_hosts: true , {
197
+ Rustfmt , alias = "rustfmt" , Self :: should_build( _config) , only_hosts: true , {
198
198
if let Some ( tarball) = builder. ensure( dist:: Rustfmt {
199
199
compiler: self . compiler,
200
200
target: self . target
@@ -206,7 +206,7 @@ install!((self, builder, _config),
206
206
) ;
207
207
}
208
208
} ;
209
- RustDemangler , "rust-demangler" , Self :: should_build( _config) , only_hosts: true , {
209
+ RustDemangler , alias = "rust-demangler" , Self :: should_build( _config) , only_hosts: true , {
210
210
// Note: Even though `should_build` may return true for `extended` default tools,
211
211
// dist::RustDemangler may still return None, unless the target-dependent `profiler` config
212
212
// is also true, or the `tools` array explicitly includes "rust-demangler".
@@ -222,7 +222,7 @@ install!((self, builder, _config),
222
222
) ;
223
223
}
224
224
} ;
225
- Analysis , "analysis" , Self :: should_build( _config) , only_hosts: false , {
225
+ Analysis , alias = "analysis" , Self :: should_build( _config) , only_hosts: false , {
226
226
// `expect` should be safe, only None with host != build, but this
227
227
// only uses the `build` compiler
228
228
let tarball = builder. ensure( dist:: Analysis {
@@ -234,7 +234,7 @@ install!((self, builder, _config),
234
234
} ) . expect( "missing analysis" ) ;
235
235
install_sh( builder, "analysis" , self . compiler. stage, Some ( self . target) , & tarball) ;
236
236
} ;
237
- Rustc , "src/librustc ", true , only_hosts: true , {
237
+ Rustc , path = "compiler/rustc ", true , only_hosts: true , {
238
238
let tarball = builder. ensure( dist:: Rustc {
239
239
compiler: builder. compiler( builder. top_stage, self . target) ,
240
240
} ) ;
0 commit comments