@@ -93,7 +93,7 @@ fn prepare_dir(mut path: PathBuf) -> String {
9393macro_rules! install {
9494 ( ( $sel: ident, $builder: ident, $_config: ident) ,
9595 $( $name: ident,
96- $path : expr ,
96+ $condition_name : ident = $path_or_alias : literal ,
9797 $default_cond: expr,
9898 only_hosts: $only_hosts: expr,
9999 $run_item: block $( , $c: ident) * ; ) +) => {
@@ -108,7 +108,7 @@ macro_rules! install {
108108 #[ allow( dead_code) ]
109109 fn should_build( config: & Config ) -> bool {
110110 config. extended && config. tools. as_ref( )
111- . map_or( true , |t| t. contains( $path ) )
111+ . map_or( true , |t| t. contains( $path_or_alias ) )
112112 }
113113 }
114114
@@ -120,7 +120,7 @@ macro_rules! install {
120120
121121 fn should_run( run: ShouldRun <' _>) -> ShouldRun <' _> {
122122 let $_config = & run. builder. config;
123- run. path ( $path ) . default_condition( $default_cond)
123+ run. $condition_name ( $path_or_alias ) . default_condition( $default_cond)
124124 }
125125
126126 fn make_run( run: RunConfig <' _>) {
@@ -138,11 +138,11 @@ macro_rules! install {
138138}
139139
140140install ! ( ( self , builder, _config) ,
141- Docs , "src/doc" , _config. docs, only_hosts: false , {
141+ Docs , path = "src/doc" , _config. docs, only_hosts: false , {
142142 let tarball = builder. ensure( dist:: Docs { host: self . target } ) . expect( "missing docs" ) ;
143143 install_sh( builder, "docs" , self . compiler. stage, Some ( self . target) , & tarball) ;
144144 } ;
145- Std , "library/std" , true , only_hosts: false , {
145+ Std , path = "library/std" , true , only_hosts: false , {
146146 for target in & builder. targets {
147147 // `expect` should be safe, only None when host != build, but this
148148 // only runs when host == build
@@ -153,13 +153,13 @@ install!((self, builder, _config),
153153 install_sh( builder, "std" , self . compiler. stage, Some ( * target) , & tarball) ;
154154 }
155155 } ;
156- Cargo , "cargo" , Self :: should_build( _config) , only_hosts: true , {
156+ Cargo , alias = "cargo" , Self :: should_build( _config) , only_hosts: true , {
157157 let tarball = builder
158158 . ensure( dist:: Cargo { compiler: self . compiler, target: self . target } )
159159 . expect( "missing cargo" ) ;
160160 install_sh( builder, "cargo" , self . compiler. stage, Some ( self . target) , & tarball) ;
161161 } ;
162- Rls , "rls" , Self :: should_build( _config) , only_hosts: true , {
162+ Rls , alias = "rls" , Self :: should_build( _config) , only_hosts: true , {
163163 if let Some ( tarball) = builder. ensure( dist:: Rls { compiler: self . compiler, target: self . target } ) {
164164 install_sh( builder, "rls" , self . compiler. stage, Some ( self . target) , & tarball) ;
165165 } else {
@@ -168,7 +168,7 @@ install!((self, builder, _config),
168168 ) ;
169169 }
170170 } ;
171- RustAnalyzer , "rust-analyzer" , Self :: should_build( _config) , only_hosts: true , {
171+ RustAnalyzer , alias = "rust-analyzer" , Self :: should_build( _config) , only_hosts: true , {
172172 if let Some ( tarball) =
173173 builder. ensure( dist:: RustAnalyzer { compiler: self . compiler, target: self . target } )
174174 {
@@ -179,13 +179,13 @@ install!((self, builder, _config),
179179 ) ;
180180 }
181181 } ;
182- Clippy , "clippy" , Self :: should_build( _config) , only_hosts: true , {
182+ Clippy , alias = "clippy" , Self :: should_build( _config) , only_hosts: true , {
183183 let tarball = builder
184184 . ensure( dist:: Clippy { compiler: self . compiler, target: self . target } )
185185 . expect( "missing clippy" ) ;
186186 install_sh( builder, "clippy" , self . compiler. stage, Some ( self . target) , & tarball) ;
187187 } ;
188- Miri , "miri" , Self :: should_build( _config) , only_hosts: true , {
188+ Miri , alias = "miri" , Self :: should_build( _config) , only_hosts: true , {
189189 if let Some ( tarball) = builder. ensure( dist:: Miri { compiler: self . compiler, target: self . target } ) {
190190 install_sh( builder, "miri" , self . compiler. stage, Some ( self . target) , & tarball) ;
191191 } else {
@@ -194,7 +194,7 @@ install!((self, builder, _config),
194194 ) ;
195195 }
196196 } ;
197- Rustfmt , "rustfmt" , Self :: should_build( _config) , only_hosts: true , {
197+ Rustfmt , alias = "rustfmt" , Self :: should_build( _config) , only_hosts: true , {
198198 if let Some ( tarball) = builder. ensure( dist:: Rustfmt {
199199 compiler: self . compiler,
200200 target: self . target
@@ -206,7 +206,7 @@ install!((self, builder, _config),
206206 ) ;
207207 }
208208 } ;
209- RustDemangler , "rust-demangler" , Self :: should_build( _config) , only_hosts: true , {
209+ RustDemangler , alias = "rust-demangler" , Self :: should_build( _config) , only_hosts: true , {
210210 // Note: Even though `should_build` may return true for `extended` default tools,
211211 // dist::RustDemangler may still return None, unless the target-dependent `profiler` config
212212 // is also true, or the `tools` array explicitly includes "rust-demangler".
@@ -222,7 +222,7 @@ install!((self, builder, _config),
222222 ) ;
223223 }
224224 } ;
225- Analysis , "analysis" , Self :: should_build( _config) , only_hosts: false , {
225+ Analysis , alias = "analysis" , Self :: should_build( _config) , only_hosts: false , {
226226 // `expect` should be safe, only None with host != build, but this
227227 // only uses the `build` compiler
228228 let tarball = builder. ensure( dist:: Analysis {
@@ -234,7 +234,7 @@ install!((self, builder, _config),
234234 } ) . expect( "missing analysis" ) ;
235235 install_sh( builder, "analysis" , self . compiler. stage, Some ( self . target) , & tarball) ;
236236 } ;
237- Rustc , "src/librustc ", true , only_hosts: true , {
237+ Rustc , path = "compiler/rustc ", true , only_hosts: true , {
238238 let tarball = builder. ensure( dist:: Rustc {
239239 compiler: builder. compiler( builder. top_stage, self . target) ,
240240 } ) ;
0 commit comments