@@ -82,7 +82,8 @@ struct ToolBuild {
82
82
tool : & ' static str ,
83
83
path : & ' static str ,
84
84
mode : Mode ,
85
- is_ext_tool : bool ,
85
+ is_optional_tool : bool ,
86
+ is_external_tool : bool ,
86
87
extra_features : Vec < String > ,
87
88
}
88
89
@@ -102,7 +103,7 @@ impl Step for ToolBuild {
102
103
let target = self . target ;
103
104
let tool = self . tool ;
104
105
let path = self . path ;
105
- let is_ext_tool = self . is_ext_tool ;
106
+ let is_optional_tool = self . is_optional_tool ;
106
107
107
108
match self . mode {
108
109
Mode :: ToolRustc => {
@@ -122,7 +123,7 @@ impl Step for ToolBuild {
122
123
target,
123
124
"build" ,
124
125
path,
125
- is_ext_tool ,
126
+ self . is_external_tool ,
126
127
) ;
127
128
cargo. arg ( "--features" ) . arg ( self . extra_features . join ( " " ) ) ;
128
129
@@ -224,7 +225,7 @@ impl Step for ToolBuild {
224
225
} ) ;
225
226
226
227
if !is_expected {
227
- if !is_ext_tool {
228
+ if !is_optional_tool {
228
229
exit ( 1 ) ;
229
230
} else {
230
231
return None ;
@@ -246,7 +247,7 @@ pub fn prepare_tool_cargo(
246
247
target : Interned < String > ,
247
248
command : & ' static str ,
248
249
path : & ' static str ,
249
- is_ext_tool : bool ,
250
+ is_external_tool : bool ,
250
251
) -> Command {
251
252
let mut cargo = builder. cargo ( compiler, mode, target, command) ;
252
253
let dir = builder. src . join ( path) ;
@@ -256,8 +257,8 @@ pub fn prepare_tool_cargo(
256
257
// stages and such and it's just easier if they're not dynamically linked.
257
258
cargo. env ( "RUSTC_NO_PREFER_DYNAMIC" , "1" ) ;
258
259
259
- if is_ext_tool {
260
- cargo. env ( "RUSTC_EXT_TOOL " , "1" ) ;
260
+ if is_external_tool {
261
+ cargo. env ( "RUSTC_EXTERNAL_TOOL " , "1" ) ;
261
262
}
262
263
263
264
if let Some ( dir) = builder. openssl_install_dir ( target) {
@@ -287,7 +288,8 @@ pub fn prepare_tool_cargo(
287
288
}
288
289
289
290
macro_rules! tool {
290
- ( $( $name: ident, $path: expr, $tool_name: expr, $mode: expr $( , llvm_tools = $llvm: expr) * ; ) +) => {
291
+ ( $( $name: ident, $path: expr, $tool_name: expr, $mode: expr
292
+ $( , llvm_tools = $llvm: expr) * $( , external_tool = $external: expr) * ; ) +) => {
291
293
#[ derive( Copy , PartialEq , Eq , Clone ) ]
292
294
pub enum Tool {
293
295
$(
@@ -364,7 +366,8 @@ macro_rules! tool {
364
366
tool: $tool_name,
365
367
mode: $mode,
366
368
path: $path,
367
- is_ext_tool: false ,
369
+ is_optional_tool: false ,
370
+ is_external_tool: false $( || $external) * ,
368
371
extra_features: Vec :: new( ) ,
369
372
} ) . expect( "expected to build -- essential tool" )
370
373
}
@@ -383,7 +386,8 @@ tool!(
383
386
Compiletest , "src/tools/compiletest" , "compiletest" , Mode :: ToolBootstrap , llvm_tools = true ;
384
387
BuildManifest , "src/tools/build-manifest" , "build-manifest" , Mode :: ToolBootstrap ;
385
388
RemoteTestClient , "src/tools/remote-test-client" , "remote-test-client" , Mode :: ToolBootstrap ;
386
- RustInstaller , "src/tools/rust-installer" , "fabricate" , Mode :: ToolBootstrap ;
389
+ RustInstaller , "src/tools/rust-installer" , "fabricate" , Mode :: ToolBootstrap ,
390
+ external_tool = true ;
387
391
RustdocTheme , "src/tools/rustdoc-themes" , "rustdoc-themes" , Mode :: ToolBootstrap ;
388
392
) ;
389
393
@@ -414,7 +418,8 @@ impl Step for RemoteTestServer {
414
418
tool : "remote-test-server" ,
415
419
mode : Mode :: ToolStd ,
416
420
path : "src/tools/remote-test-server" ,
417
- is_ext_tool : false ,
421
+ is_optional_tool : false ,
422
+ is_external_tool : false ,
418
423
extra_features : Vec :: new ( ) ,
419
424
} ) . expect ( "expected to build -- essential tool" )
420
425
}
@@ -541,7 +546,8 @@ impl Step for Cargo {
541
546
tool : "cargo" ,
542
547
mode : Mode :: ToolRustc ,
543
548
path : "src/tools/cargo" ,
544
- is_ext_tool : false ,
549
+ is_optional_tool : false ,
550
+ is_external_tool : true ,
545
551
extra_features : Vec :: new ( ) ,
546
552
} ) . expect ( "expected to build -- essential tool" )
547
553
}
@@ -590,7 +596,8 @@ macro_rules! tool_extended {
590
596
mode: Mode :: ToolRustc ,
591
597
path: $path,
592
598
extra_features: $sel. extra_features,
593
- is_ext_tool: true ,
599
+ is_optional_tool: true ,
600
+ is_external_tool: true ,
594
601
} )
595
602
}
596
603
}
0 commit comments