@@ -86,7 +86,7 @@ struct ToolBuild {
86
86
}
87
87
88
88
impl Step for ToolBuild {
89
- type Output = PathBuf ;
89
+ type Output = Option < PathBuf > ;
90
90
91
91
fn should_run ( run : ShouldRun ) -> ShouldRun {
92
92
run. never ( )
@@ -96,7 +96,7 @@ impl Step for ToolBuild {
96
96
///
97
97
/// This will build the specified tool with the specified `host` compiler in
98
98
/// `stage` into the normal cargo output directory.
99
- fn run ( self , builder : & Builder ) -> PathBuf {
99
+ fn run ( self , builder : & Builder ) -> Option < PathBuf > {
100
100
let build = builder. build ;
101
101
let compiler = self . compiler ;
102
102
let target = self . target ;
@@ -116,11 +116,15 @@ impl Step for ToolBuild {
116
116
117
117
let mut cargo = prepare_tool_cargo ( builder, compiler, target, "build" , path) ;
118
118
build. run_expecting ( & mut cargo, expectation) ;
119
- let cargo_out = build. cargo_out ( compiler, Mode :: Tool , target)
120
- . join ( exe ( tool, & compiler. host ) ) ;
121
- let bin = build. tools_dir ( compiler) . join ( exe ( tool, & compiler. host ) ) ;
122
- copy ( & cargo_out, & bin) ;
123
- bin
119
+ if expectation == BuildExpectation :: Succeeding || expectation == BuildExpectation :: None {
120
+ let cargo_out = build. cargo_out ( compiler, Mode :: Tool , target)
121
+ . join ( exe ( tool, & compiler. host ) ) ;
122
+ let bin = build. tools_dir ( compiler) . join ( exe ( tool, & compiler. host ) ) ;
123
+ copy ( & cargo_out, & bin) ;
124
+ Some ( bin)
125
+ } else {
126
+ None
127
+ }
124
128
}
125
129
}
126
130
@@ -229,7 +233,7 @@ macro_rules! tool {
229
233
mode: $mode,
230
234
path: $path,
231
235
expectation: BuildExpectation :: None ,
232
- } )
236
+ } ) . expect ( "expected to build -- BuildExpectation::None" )
233
237
}
234
238
}
235
239
) +
@@ -277,7 +281,7 @@ impl Step for RemoteTestServer {
277
281
mode : Mode :: Libstd ,
278
282
path : "src/tools/remote-test-server" ,
279
283
expectation : BuildExpectation :: None ,
280
- } )
284
+ } ) . expect ( "expected to build -- BuildExpectation::None" )
281
285
}
282
286
}
283
287
@@ -395,7 +399,7 @@ impl Step for Cargo {
395
399
mode : Mode :: Librustc ,
396
400
path : "src/tools/cargo" ,
397
401
expectation : BuildExpectation :: None ,
398
- } )
402
+ } ) . expect ( "BuildExpectation::None - expected to build" )
399
403
}
400
404
}
401
405
@@ -406,7 +410,7 @@ pub struct Clippy {
406
410
}
407
411
408
412
impl Step for Clippy {
409
- type Output = PathBuf ;
413
+ type Output = Option < PathBuf > ;
410
414
const DEFAULT : bool = true ;
411
415
const ONLY_HOSTS : bool = true ;
412
416
@@ -421,7 +425,7 @@ impl Step for Clippy {
421
425
} ) ;
422
426
}
423
427
424
- fn run ( self , builder : & Builder ) -> PathBuf {
428
+ fn run ( self , builder : & Builder ) -> Option < PathBuf > {
425
429
// Clippy depends on procedural macros (serde), which requires a full host
426
430
// compiler to be available, so we need to depend on that.
427
431
builder. ensure ( compile:: Rustc {
@@ -446,7 +450,7 @@ pub struct Rls {
446
450
}
447
451
448
452
impl Step for Rls {
449
- type Output = PathBuf ;
453
+ type Output = Option < PathBuf > ;
450
454
const DEFAULT : bool = true ;
451
455
const ONLY_HOSTS : bool = true ;
452
456
@@ -462,7 +466,7 @@ impl Step for Rls {
462
466
} ) ;
463
467
}
464
468
465
- fn run ( self , builder : & Builder ) -> PathBuf {
469
+ fn run ( self , builder : & Builder ) -> Option < PathBuf > {
466
470
builder. ensure ( native:: Openssl {
467
471
target : self . target ,
468
472
} ) ;
@@ -490,7 +494,7 @@ pub struct Rustfmt {
490
494
}
491
495
492
496
impl Step for Rustfmt {
493
- type Output = PathBuf ;
497
+ type Output = Option < PathBuf > ;
494
498
const DEFAULT : bool = true ;
495
499
const ONLY_HOSTS : bool = true ;
496
500
@@ -506,7 +510,7 @@ impl Step for Rustfmt {
506
510
} ) ;
507
511
}
508
512
509
- fn run ( self , builder : & Builder ) -> PathBuf {
513
+ fn run ( self , builder : & Builder ) -> Option < PathBuf > {
510
514
builder. ensure ( ToolBuild {
511
515
compiler : self . compiler ,
512
516
target : self . target ,
@@ -526,7 +530,7 @@ pub struct Miri {
526
530
}
527
531
528
532
impl Step for Miri {
529
- type Output = PathBuf ;
533
+ type Output = Option < PathBuf > ;
530
534
const DEFAULT : bool = true ;
531
535
const ONLY_HOSTS : bool = true ;
532
536
@@ -542,7 +546,7 @@ impl Step for Miri {
542
546
} ) ;
543
547
}
544
548
545
- fn run ( self , builder : & Builder ) -> PathBuf {
549
+ fn run ( self , builder : & Builder ) -> Option < PathBuf > {
546
550
builder. ensure ( ToolBuild {
547
551
compiler : self . compiler ,
548
552
target : self . target ,
0 commit comments