@@ -129,10 +129,7 @@ impl Step for ToolBuild {
129
129
if tool == "tidy" {
130
130
tool = "rust-tidy" ;
131
131
}
132
- let cargo_out = builder. cargo_out ( compiler, self . mode , target) . join ( exe ( tool, target) ) ;
133
- let bin = builder. tools_dir ( compiler) . join ( exe ( tool, target) ) ;
134
- builder. copy_link ( & cargo_out, & bin) ;
135
- bin
132
+ copy_tool_bin ( builder, self . compiler , self . target , self . mode , tool)
136
133
}
137
134
}
138
135
}
@@ -217,6 +214,21 @@ pub fn prepare_tool_cargo(
217
214
cargo
218
215
}
219
216
217
+ /// Copies a built tool binary with the given `name` from the build directory to the
218
+ /// tools directory.
219
+ fn copy_tool_bin (
220
+ builder : & Builder < ' _ > ,
221
+ compiler : Compiler ,
222
+ target : TargetSelection ,
223
+ mode : Mode ,
224
+ name : & str ,
225
+ ) -> PathBuf {
226
+ let cargo_out = builder. cargo_out ( compiler, mode, target) . join ( exe ( name, target) ) ;
227
+ let bin = builder. tools_dir ( compiler) . join ( exe ( name, target) ) ;
228
+ builder. copy_link ( & cargo_out, & bin) ;
229
+ bin
230
+ }
231
+
220
232
macro_rules! bootstrap_tool {
221
233
( $(
222
234
$name: ident, $path: expr, $tool_name: expr
@@ -385,7 +397,7 @@ impl Step for RustcPerf {
385
397
// We need to ensure the rustc-perf submodule is initialized.
386
398
builder. update_submodule ( Path :: new ( "src/tools/rustc-perf" ) ) ;
387
399
388
- let target = builder . ensure ( ToolBuild {
400
+ let tool = ToolBuild {
389
401
compiler : self . compiler ,
390
402
target : self . target ,
391
403
tool : "collector" ,
@@ -397,8 +409,13 @@ impl Step for RustcPerf {
397
409
// Only build the collector package, which is used for benchmarking through
398
410
// a CLI.
399
411
cargo_args : vec ! [ "-p" . to_string( ) , "collector" . to_string( ) ] ,
400
- } ) ;
401
- target
412
+ } ;
413
+ let collector_bin = builder. ensure ( tool. clone ( ) ) ;
414
+ // We also need to symlink the `rustc-fake` binary to the corresponding directory,
415
+ // because `collector` expects it in the same directory.
416
+ copy_tool_bin ( builder, tool. compiler , tool. target , tool. mode , "rustc-fake" ) ;
417
+
418
+ collector_bin
402
419
}
403
420
}
404
421
0 commit comments